Browse Source

app: init throws meaningful errors

aria-example
miili 1 year ago
parent
commit
4cda5e200c
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/apps/cmd_init.py

+ 7
- 2
src/apps/cmd_init.py View File

@ -4,7 +4,9 @@ import logging
import glob
import os.path as op
from distutils.dir_util import copy_tree
import distutils.errors
logger = logging.getLogger('grond.init')
km = 1e3
@ -84,8 +86,11 @@ class GrondInit(object):
pass
example_dir = self.abbrv_to_example_dir(abbrv)
logger.info('Initialising example "%s" in "%s".' % (abbrv, path))
copy_tree(example_dir, path)
logger.info('Initialising example "%s" in "%s".', abbrv, path)
try:
copy_tree(example_dir, path)
except distutils.errors.DistutilsFileError:
logger.error('Could not find example %s!', abbrv)
def abbrv_to_filename(self, abbrv):
ext = '.gronf'


Loading…
Cancel
Save