def run(self): logger.info("Initializing new project") git_path = self._search_for_git_project() if git_path: config_path = git_path + "/.checkmate" project_path = git_path else: return -1 if os.path.exists(config_path): logger.error("Found another project with the same path, aborting.") return -1 if not self.opts['backend'] in ('file', 'mongo'): logger.error("Unknown backend: %s" % args.backend) return -1 config = { 'project_id': uuid.uuid4().hex if not self.opts['pk'] else self.opts['pk'], 'project_class': 'GitProject', 'backend': { 'driver': self.opts['backend'], } } self.configure_backend(config) os.makedirs(config_path) save_project_config(config_path, config)
def run(self): logger.info("Initializing new project in the current directory.") project_path = self.opts['path'] or os.getcwd() config_path = project_path + "/.checkmate" if os.path.exists(config_path): logger.error("Found another project with the same path, aborting.") return -1 if not self.opts['backend'] in ('sql'): logger.error("Unsupported backend: %s" % self.opts['backend']) return -1 config = { 'project_id': uuid.uuid4().hex if not self.opts['pk'] else self.opts['pk'], 'project_class': 'Project', 'backend': { 'driver': self.opts['backend'], } } os.makedirs(config_path) save_project_config(project_path, config)
def run(self): logger.info("Initializing new project") git_path = self._search_for_git_project() if git_path: config_path = git_path+"/.checkmate" project_path = git_path else: return -1 if os.path.exists(config_path): logger.error("Found another project with the same path, aborting.") return -1 if not self.opts['backend'] in ('file','mongo'): logger.error("Unknown backend: %s" % args.backend) return -1 config = { 'project_id' : uuid.uuid4().hex if not self.opts['pk'] else self.opts['pk'], 'project_class' : 'GitProject', 'backend' : { 'driver' : self.opts['backend'], } } self.configure_backend(config) os.makedirs(config_path) save_project_config(config_path,config)
def run(self): logger.info("Initializing new disk-based project in the current directory.") project_path = self.opts["path"] or os.getcwd() config_path = project_path + "/.checkmate" if os.path.exists(config_path): logger.error("Found another project with the same path, aborting.") return -1 if not self.opts["backend"] in ("file", "mongo"): logger.error("Unknown backend: %s" % args.backend) return -1 config = { "project_id": uuid.uuid4().hex if not self.opts["pk"] else self.opts["pk"], "project_class": "DiskProject", "backend": {"driver": self.opts["backend"]}, } self.configure_backend(config) os.makedirs(config_path) save_project_config(config_path, config)