当前位置: 首页>>代码示例>>Python>>正文


Python Shell.mkdir方法代码示例

本文整理汇总了Python中cloudmesh_base.Shell.Shell.mkdir方法的典型用法代码示例。如果您正苦于以下问题:Python Shell.mkdir方法的具体用法?Python Shell.mkdir怎么用?Python Shell.mkdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cloudmesh_base.Shell.Shell的用法示例。


在下文中一共展示了Shell.mkdir方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: open

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import mkdir [as 别名]
 def open(self, filename=None):
     if filename is not None:
         self.filename = filename
     else:
         self.filename = path_expand(self.pbs.database_filename())
     path = os.path.dirname(self.filename)
     Shell.mkdir(path)
     self.load()
开发者ID:kwtillma,项目名称:pbs,代码行数:10,代码来源:DbPBS.py

示例2: create_cloudmesh_yaml

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import mkdir [as 别名]
def create_cloudmesh_yaml(filename):
    if not os.path.exists(filename):
        path = os.path.dirname(filename)
        if not os.path.isdir(path):
            Shell.mkdir(path)
        etc_path = os.path.dirname(cloudmesh_client.__file__)
        etc_file = os.path.join(etc_path, "etc", "cloudmesh.yaml")
        to_dir = path_expand("~/.cloudmesh")
        shutil.copy(etc_file, to_dir)
        Console.ok("~/.cloudmesh/cloudmesh.yaml created")
开发者ID:atavism,项目名称:client,代码行数:12,代码来源:cm.py

示例3: create_config

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import mkdir [as 别名]
    def create_config(cls, username):
        dir_path = path_expand("~/.cloudmesh/{0}".format("accounts"))

        if not os.path.exists(dir_path):
            Shell.mkdir(dir_path)

        filename = path_expand("~/.cloudmesh/{0}/{1}".format("accounts", ".config"))
        data = dict(user=username)

        with open(filename, 'w') as outfile:
            outfile.write(yaml.dump(data, default_flow_style=True))
开发者ID:rajaramcomputers,项目名称:management,代码行数:13,代码来源:user.py

示例4: run

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import mkdir [as 别名]
    def run(self):
        banner("Setup the cmd3.yaml file")

        cmd3_yaml = path_expand("~/.cloudmesh/cmd3.yaml")

        if os.path.isfile(cmd3_yaml):
            print ("ERROR: the file {0} already exists".format(cmd3_yaml))
            print
            print ("If you like to reinstall it, please remove the file")
        else:
            print ("Copy file:  {0} -> {1} ".format(path_expand("etc/cmd3.yaml"), cmd3_yaml))
            Shell.mkdir("~/.cloudmesh")

            shutil.copy("etc/cmd3.yaml", path_expand("~/.cloudmesh/cmd3.yaml"))
开发者ID:cloudmesh,项目名称:cmd3,代码行数:16,代码来源:setup-orig.py

示例5: start

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import mkdir [as 别名]
    def start(self):
        """
        Starts the cloudmesh_job process in the background.
        """
        for key in ['dbpath', 'logpath']:
            path = os.dirname(self.config[key])
            Shell.mkdir(path)

        r = Shell.sh("mongod", "--fork",
                     "--logpath", self.config['logpath'],
                     "--prot", self.config['port'],
                     '--dbpath', self.config['dbpath'])
        print (r)
        # TODO
        # get the id from r
        self.config['id'] = None  # put here the real id
开发者ID:kwtillma,项目名称:pbs,代码行数:18,代码来源:DatabaseMongo.py

示例6: deploy

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import mkdir [as 别名]
 def deploy(self):
     """
     creates the directories if they do not exist
     """
     try:
         r = Shell.mkdir(self.db_path)
     except Exception, e:
         Console.error("Problem creating the database directory {:}".format(self.db_path))
         print(e)
开发者ID:rajpushkar83,项目名称:pbs,代码行数:11,代码来源:cm_jobdb.py

示例7: run

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import mkdir [as 别名]
    def run(self):
        banner("Setup the cloudmesh management yaml files ")

        yamlfiles = ['cloudmesh_user.yaml', 'cloudmesh_project.yaml']
        dir_path = path_expand("~/.cloudmesh/{0}".format("accounts"))

        if not os.path.exists(dir_path):
            Shell.mkdir(dir_path)

        for yamlfile in yamlfiles:

            filename = path_expand("~/.cloudmesh/{0}/{1}".format("accounts", yamlfile))

            if os.path.isfile(filename):
                Console.error("File {0} already exists. If you like to reinstall it, please remove the file".format(yamlfile))
            else:
                Console.info("Copying file:  {0} -> {1} ".format(path_expand("etc/{0}/{1}".format("accounts", yamlfile)), filename))
                shutil.copy("etc/{0}/{1}".format("accounts", yamlfile), path_expand("~/.cloudmesh/{0}/{1}".format("accounts", yamlfile)))
开发者ID:rajaramcomputers,项目名称:management,代码行数:20,代码来源:setup.py

示例8: config_dir_setup

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import mkdir [as 别名]
def config_dir_setup(filename):
    path = os.path.dirname(filename)
    if not os.path.isdir(path):
        Shell.mkdir(path)
开发者ID:rajpushkar83,项目名称:base,代码行数:6,代码来源:locations.py


注:本文中的cloudmesh_base.Shell.Shell.mkdir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。