本文整理汇总了Python中psr.sys.Sys.mkdir_p方法的典型用法代码示例。如果您正苦于以下问题:Python Sys.mkdir_p方法的具体用法?Python Sys.mkdir_p怎么用?Python Sys.mkdir_p使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类psr.sys.Sys
的用法示例。
在下文中一共展示了Sys.mkdir_p方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createDefaultKeyIfNone
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import mkdir_p [as 别名]
def createDefaultKeyIfNone(self):
""""""
kpath = self.getDefaultKeyPath()
if not Io.file_exists(kpath):
if Sys.isUnix():
if not Sys.isdir(conf.DEFVAL_UKEY_PATH):
Sys.mkdir_p(conf.DEFVAL_UKEY_PATH)
Io.set_data(kpath, KeyGen(conf.DEFVAL_UKEY_LENGHT).key)
self.selectKey(kpath)
示例2: createDefaultKeyIfNone
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import mkdir_p [as 别名]
def createDefaultKeyIfNone(self):
""""""
kpath = self.getDefaultKeyPath()
if not Io.file_exists(kpath):
#if Sys.isUnix() :
if not Sys.isdir(conf.DEFVAL_UKEY_PATH) :
Sys.mkdir_p(conf.DEFVAL_UKEY_PATH)
k = KeyGen(conf.DEFVAL_UKEY_LENGHT)
print(k)
content = k.key
print('content')
Io.set_data(kpath, content)
print('set content')
self.selectKey(kpath)
示例3: getFileParts
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import mkdir_p [as 别名]
def getFileParts(self, row, ids):
""""""
done = False
if len(ids) >= row[self.idxu.index.PARTS]:
for i, uid in enumerate(ids):
d = Sys.datetime.now()
self.idxu.ih.getAttachment(uid, self.inbox, True)
Sys.pwlog(
[
(" part ", Const.CLZ_0),
(str(i + 1).rjust(2, " "), Const.CLZ_2),
(" / ", Const.CLZ_0),
(str(len(ids)), Const.CLZ_3),
(" downloaded in ", Const.CLZ_0),
(Sys.getDelta(d), Const.CLZ_4, True),
]
)
Sys.cli_emit_progress(int((i + 1) * 100 / len(ids)))
Sys.sleep(0.5)
Sys.mkdir_p(self.deploy + row[self.idxu.index.CATG])
Sys.cli_emit_progress(100)
示例4: __init__
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import mkdir_p [as 别名]
def __init__(self, path, remote=False, rwargs=None, thread=None, loglvl=Const.LOG_ALL):
""""""
AbstractCli.__init__(self, conf, self)
Cli.HOME = conf.DEFVAL_USER_PATH
Cli.DIRKEY = Cli.HOME+'.'+conf.PRG_NAME.lower()+Sys.sep
if not Sys.isUnix() :
Cli.CHQ = '"'
Cli.HOME = 'C:'+Sys.sep+conf.PRG_NAME.lower()+Sys.sep
Cli.DIRKEY = self.HOME+'keys'+Sys.sep
Sys.mkdir_p(Cli.DIRKEY)
gpData = OptionGroup(self.parser, '')
gpData = OptionGroup(self.parser, '')
gpConf = OptionGroup(self.parser, '')
gpData.add_option('-c', '--category' , action='store', metavar='CATG ')
gpData.add_option('-u', '--user' , action='store', metavar='OWNER ')
gpData.add_option('-l', '--label' , action='store', metavar='LABEL ')
gpData.add_option('-o', '--order' , action='store', metavar='ORDER ' , default='ID')
gpData.add_option('-O', '--order-inv' , action='store', metavar='ORDER_INVERSE ')
gpData.add_option('-a', '--account' , action='store', metavar='ACCOUNT ')
self.parser.add_option_group(gpData)
gpConf.add_option('-V', '--view' , action='store' )
gpConf.add_option('-L', '--load' , action='store' )
gpConf.add_option('-S', '--save' , action='store' )
gpConf.add_option('-C', '--check' , action='store' )
gpConf.add_option('-H', '--set-host' , action='store', metavar='HOST ')
gpConf.add_option('-U', '--set-user' , action='store', metavar='USER ')
gpConf.add_option('-X', '--set-pass' , action='store', metavar='PASS ')
gpConf.add_option('-P', '--set-port' , action='store', metavar='PORT ')
gpConf.add_option('-N', '--set-name' , action='store', metavar='NAME ')
gpConf.add_option('-M', '--set-multi' , action='store', metavar='PROFILE ')
gpConf.add_option('-R', '--remove-multi' , action='store', metavar='PROFILE ')
gpConf.add_option('-B', '--set-boxname' , action='store', metavar='BOXNAME ')
gpConf.add_option('-K', '--gen-key' , action='store_true', default=False)
self.parser.add_option_group(gpConf)
# rewrite argv sended by remote
if rwargs is not None :
import sys
sys.argv = rwargs
(o, a) = self.parser.parse_args()
Sys.g.QUIET = o.quiet
Sys.g.THREAD_CLI = thread
Sys.g.GUI = thread is not None
init(conf.PRG_NAME, o.debug, remote, not o.no_color, loglvl)
Const.LINE_SEP_LEN = 120
if not a:
try :
if not o.help or not o.version:
self.parser.error_cmd(('no command specified',), True)
else :
Sys.clear()
Cli.print_help()
except :
if not o.version :
self.parser.error_cmd(('no command specified',), True)
else :
Cli.print_header()
else:
if a[0] == 'help':
Sys.clear()
Cli.print_help()
elif a[0] in ['add','conf','import','info', 'edit','export','get','list','remove','search'] :
app = CliApp(self.HOME, path, self.parser, Cli, a, o)
if a[0]=='add':
app.onCommandAdd()
elif a[0]=='conf':
app.onCommandConf()
elif a[0]=='info':
app.onCommandInfo()
elif a[0]=='import':
app.onCommandImport()
elif a[0]=='edit':
app.onCommandEdit()
elif a[0]=='export':
app.onCommandExport()
elif a[0]=='get':
app.onCommandGet()
elif a[0]=='list':
app.onCommandList()
elif a[0]=='remove':
app.onCommandRemove()
elif a[0]=='search':
app.onCommandSearch()
Sys.dprint('PUT END SIGNAL')
if Sys.g.LOG_QUEUE is not None :
Sys.g.LOG_QUEUE.put(Sys.g.SIGNAL_STOP)
else :
#.........这里部分代码省略.........
示例5: createNewKey
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import mkdir_p [as 别名]
def createNewKey(self, filename, size):
""""""
if not Sys.isdir(Sys.dirname(filename)):
Sys.mkdir_p(Sys.dirname(filename))
Io.set_data(filename,KeyGen(size).key[:size])