示例#1
0
 def input_dir(self, config=None):
     """
     Full input dir path for specified config.
     """
     if config is None:
         config = self.config
     return fs.real(fs.join(self.path, config.get('input_path', '.')))
示例#2
0
    def cmd_init(self):
        import docta

        # Test if dir is empty
        for name in os.listdir(self.current_dir()):
            if not name.startswith('.'):
                command = ' '.join((self.script_name(), self.args.command))
                exit_with_error("Current dir is not empty. Please run `%s` in empty dir." % command)

        # Copy initial project
        source_dir = fs.real(fs.dirname(docta.__file__))
        initial_dir = fs.join(source_dir, 'initial', 'default')
        fs.cp(initial_dir, self.current_dir())