Python os 模块,makedir() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用os.makedir()

项目:charm-swift-proxy    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-swift-proxy    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-heat    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-heat    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-nova-cloud-controller    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-nova-cloud-controller    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-nova-compute    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-nova-compute    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceph-osd    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceph-osd    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-neutron-api    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-neutron-api    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceph-mon    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceph-mon    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-openstack-dashboard    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-openstack-dashboard    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceilometer    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceilometer    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceilometer    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceilometer    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceilometer    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceph    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceph    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:Basic-discord-bot    作者:TheWizoid    | 项目源码 | 文件源码
def add_points(message):
    """
    Every time someone sends a message, they gain one point.
    This is because any time based ones would result in mobile users having
    the same amount of each, due to idling.
    """

    split_message = message.content.split()

    message.author.name = message.author.name.lower()
    points = load_points(message, message.author.name)
    message_amount = messages.load_messages(message, message.author.name)

    non_trigger = ["!points","!roulette","!userpoints","!givepoints","!barryroulette","!rps","!rockpaperscissors"]
    non_message_trigger = ["!usermessages","!messages"]
    if message.author.name not in message_amount:
        message_amount[message.author.name] = 0
    elif len(split_message) == 0 or split_message[0] not in non_message_trigger:
        message_amount[message.author.name] += 1

    if message.author.name not in points:
        points[message.author.name] = 0
    elif len(split_message) == 0 or split_message[0] not in non_trigger:
        points[message.author.name] += 1

    try:
        pickle.dump(points, open("{0}/{0}_points.txt".format(str(message.server)),"wb"))
    except FileNotFoundError:
        try:
            os.makedir("{}".format(message.server))
        except FileExistsError:
            temp_points = open("{0}/{0}_points.txt".format(str(message.server)),"w")
            temp_points.close()
        pickle.dump(points, open("{0}/{0}_points.txt".format(str(message.server)),"wb"))
    pickle.dump(message_amount, open("{0}/{0}_messages.txt".format(str(message.server)),"wb"))
    return True

#Sets emotes in points, is its own function due to me using it twice.
项目:charm-ceph-radosgw    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-ceph-radosgw    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:equlipse    作者:konono    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:equlipse    作者:konono    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['server']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)
项目:equlipse    作者:konono    | 项目源码 | 文件源码
def pre_write(self):
        settings = utils.get_settings('ssh')
        apt_update(fatal=True)
        apt_install(settings['client']['package'])
        if not os.path.exists('/etc/ssh'):
            os.makedir('/etc/ssh')
            # NOTE: don't recurse
            utils.ensure_permissions('/etc/ssh', 'root', 'root', 0o0755,
                                     maxdepth=0)