예제 #1
0
파일: file.py 프로젝트: Readon/cydra
    def delete_project(self, project):
        # Check name
        if not is_valid_project_name(project.name):
            return None

        path = self._get_project_path(project.name)
        os.remove(path)
예제 #2
0
파일: file.py 프로젝트: mensi/cydra
    def delete_project(self, project):
        # Check name
        if not is_valid_project_name(project.name):
            return None

        path = self._get_project_path(project.name)
        os.remove(path)
예제 #3
0
파일: file.py 프로젝트: Readon/cydra
    def save_project(self, project):
        # Check name
        if not is_valid_project_name(project.name):
            return None

        path = self._get_project_path(project.name)
        with open(path, 'w') as f:
                yaml.safe_dump(project.data, f)
예제 #4
0
파일: file.py 프로젝트: mensi/cydra
    def save_project(self, project):
        # Check name
        if not is_valid_project_name(project.name):
            return None

        path = self._get_project_path(project.name)
        with open(path, 'w') as f:
            yaml.safe_dump(project.data, f)
예제 #5
0
파일: mongo.py 프로젝트: akuendig/cydra
    def create_project(self, projectname, owner):
        # Check name
        if not is_valid_project_name(projectname):
            return None

        if self.get_project(projectname) is None:
            self.database.projects.insert({'name': projectname, 'owner': owner.userid})
            return self.get_project(projectname)
예제 #6
0
파일: mongo.py 프로젝트: akuendig/cydra
    def get_project(self, projectname):
        # Check name
        if not is_valid_project_name(projectname):
            return None

        project = self.database.projects.find_one({'name': projectname})
        if project is not None:
            return Project(self.compmgr, self._decode_dict_keys(project))
예제 #7
0
    def get_project(self, projectname):
        # Check name
        if not is_valid_project_name(projectname):
            return None

        project = self.database.projects.find_one({'name': projectname})
        if project is not None:
            return Project(self.compmgr, self._decode_dict_keys(project))
예제 #8
0
파일: file.py 프로젝트: Readon/cydra
    def create_project(self, projectname, owner):
        # Check name
        if not is_valid_project_name(projectname):
            return None

        if self.get_project(projectname) is None:
            path = self._get_project_path(projectname)
            with open(path, 'w') as f:
                yaml.safe_dump({'name': projectname, 'owner': owner.userid}, f)
            return self.get_project(projectname)
예제 #9
0
파일: file.py 프로젝트: Readon/cydra
    def get_project(self, projectname):
        # Check name
        if not is_valid_project_name(projectname):
            return None

        path = self._get_project_path(projectname)

        if os.path.exists(path):
            with open(path, 'r') as f:
                return Project(self.compmgr, yaml.safe_load(f))
예제 #10
0
파일: file.py 프로젝트: mensi/cydra
    def create_project(self, projectname, owner):
        # Check name
        if not is_valid_project_name(projectname):
            return None

        if self.get_project(projectname) is None:
            path = self._get_project_path(projectname)
            with open(path, 'w') as f:
                yaml.safe_dump({'name': projectname, 'owner': owner.userid}, f)
            return self.get_project(projectname)
예제 #11
0
파일: file.py 프로젝트: mensi/cydra
    def get_project(self, projectname):
        # Check name
        if not is_valid_project_name(projectname):
            return None

        path = self._get_project_path(projectname)

        if os.path.exists(path):
            with open(path, 'r') as f:
                return Project(self.compmgr, yaml.safe_load(f))
예제 #12
0
    def create_project(self, projectname, owner):
        # Check name
        if not is_valid_project_name(projectname):
            return None

        if self.get_project(projectname) is None:
            self.database.projects.insert({
                'name': projectname,
                'owner': owner.userid
            })
            return self.get_project(projectname)