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


Python sys.Sys类代码示例

本文整理汇总了Python中psr.sys.Sys的典型用法代码示例。如果您正苦于以下问题:Python Sys类的具体用法?Python Sys怎么用?Python Sys使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onCommandInfo

 def onCommandInfo(self):
     """"""
     key = self.getMatchKey()
     if key is not None:
         Sys.clear()
         self.pheader()
         self.impst.getInfo(int(self.a[1]))
开发者ID:pluie-org,项目名称:imprastorage,代码行数:7,代码来源:cliapp.py

示例2: getCountParts

 def getCountParts(self, fromPath):
     """"""
     fsize = Sys.getsize(fromPath)
     count = Sys.ceil(fsize / 19710000)
     minp, maxp = 52, 62
     if fsize < 4800000:
         minp, maxp = 8, 16
     elif fsize < 22200000:
         minp, maxp = 16, 22
     elif fsize < 48000000:
         minp, maxp = 22, 32
     elif fsize < 222000000:
         minp, maxp = 32, 42
     if count < minp:
         count = choice(list(range(minp, maxp)))
     if not count > 62:
         return count
     else:
         raise Exception(
             fromPath
             + " size exceeds limits (max : "
             + formatBytes(self.ck.psize * 62)
             + " ["
             + str(self.ck.psize * 64)
             + " bytes])"
         )
开发者ID:pluie-org,项目名称:imprastorage,代码行数:26,代码来源:core.py

示例3: getBackupAddMap

 def getBackupAddMap(self):
     """"""
     data = None
     if Io.file_exists(self.addmapPath + Kirmah.EXT):
         call = " ".join(
             [
                 Sys.executable,
                 "kirmah-cli.py",
                 "dec",
                 "-qf",
                 self.addmapPath + Kirmah.EXT,
                 "-z",
                 "-r",
                 "-m",
                 "-o",
                 self.addmapPath,
                 "-k",
                 self.idxu.index.keyPath,
             ]
         )
         print(call)
         Sys.sysCall(call)
         data = jloads(Io.get_data(self.addmapPath))
         Io.removeFile(self.addmapPath)
     return data
开发者ID:pluie-org,项目名称:imprastorage,代码行数:25,代码来源:core.py

示例4: update

    def update(self):
        """"""
        self.switchFileAccount(self.conf.profile)
        try:
            if self.idx != None :
                if not isinstance(self.idx,bytes):
                    self.idx = Io.bytes(self.idx)                
                self.delids.append(self.idx)
        except Exception as e :
            Sys.dprint('error : ')
            Sys.dprint(e)   

        self.index.fixDuplicateIds()
        #~ self.index.fixAccount('gmail5')
        self.index.encrypt()
        msgIndex    = self.mb.buildIndex(self.pathIdx)
        _, self.idx = self.ih.send(msgIndex.as_string(), self.rootBox)
        date        = self.ih.headerField(self.idx, 'date', True)
        self.conf.sets((['uid'  , self.idx              , 'index'],
                       ['date' , date                   , 'index'],
                       ['time' , str(Sys.datetime.now()), 'index']))
        
        Sys.pwlog([(' Index updated ('  , Const.CLZ_0),
                   (str(int(self.idx))  , Const.CLZ_2),
                   (') '                , Const.CLZ_0),
                   (str(date)           , Const.CLZ_7, True)])
        
        try :
            self.ih.delete(self.delids, True)       
        except :
            Sys.dprint('error : ')
            Sys.dprint(e)
        self.ih.clearTrash()
        return True
开发者ID:pluie-org,项目名称:imprastorage,代码行数:34,代码来源:index.py

示例5: save

 def save(self,path=None,notAssign=False):
     """"""
     path = path if path is not None else self.path
     Io.set_data(path, '# last updated : '+str(Sys.datetime.now())+Const.LF+self.toString())
     call = ' '.join(['python3', 'kirmah-cli.py', 'enc', '-qf', path, '-z', '-r', '-m', '-o', path+'.kmh', '-k', self.keyPath ])
     Sys.sysCall(call)
     Io.removeFile(path)
     if not notAssign : self.path = path
开发者ID:pluie-org,项目名称:imprastorage,代码行数:8,代码来源:ini.py

示例6: pheader

 def pheader(self):
     self.Cli.printLineSep(Const.LINE_SEP_CHAR, Const.LINE_SEP_LEN)
     self.Cli.printHeaderTitle(self.Cli.conf.PRG_CLI_NAME)
     self.Cli.printHeaderPart("account", self.account)
     self.Cli.printHeaderPart("index", self.uid)
     self.Cli.printHeaderPart("box", self.rootBox)
     Sys.echo(self.date, Sys.Clz.fgB7, True, True)
     self.Cli.printLineSep(Const.LINE_SEP_CHAR, Const.LINE_SEP_LEN)
开发者ID:pluie-org,项目名称:imprastorage,代码行数:8,代码来源:cliapp.py

示例7: on_new_file_source

 def on_new_file_source(self, fc, data=None):
     """"""
     try:
         self.app.setSourceFile(fc.get_filename())
         self.IS_SOURCE_DEF = True
     except FileNotFoundException as e:
         Sys.eprint('FileNotFoundException :' + str(fc.get_filename()), Const.ERROR)
         self.IS_SOURCE_DEF = False
     self.refreshProceed()
开发者ID:pluie-org,项目名称:imprastorage,代码行数:9,代码来源:gui.py

示例8: createDefaultKeyIfNone

 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)
开发者ID:necrose99,项目名称:Kirmah,代码行数:9,代码来源:app.py

示例9: main

def main():
    try:
        c = 0
        Cli('.'+Sys.sep)
    except Exception as e :
        Sys.pwarn((('main : ',(str(e),Sys.CLZ_ERROR_PARAM), ' !'),), True)
        #~ raise e
        c = 1
    return c
开发者ID:pluie-org,项目名称:imprastorage,代码行数:9,代码来源:kirmah-cli.py

示例10: main

def main():
    try:
        c = 0
        AppGui()
    except Exception as e:
        Sys.pwarn((('main : ',(str(e),Sys.CLZ_ERROR_PARAM), ' !'),), True)
        raise e
        c = 1
    return c
开发者ID:pluie-org,项目名称:imprastorage,代码行数:9,代码来源:impra.py

示例11: add

 def add(self, key, label, count, ext='', usr='', cat='', fhash='', size=0, account=''):
     """Add an entry to the index
     """
     if self.get(fhash) == None :
         self.dic[fhash] = (self.id, fhash, label, size, count, ext, usr, cat, account, key)
         self.id +=1
         return self.id-1 
     else :
        Sys.dprint(label+' already exist')
开发者ID:pluie-org,项目名称:imprastorage,代码行数:9,代码来源:index.py

示例12: build

 def build(self):
     Sys.pwlog([(' Reading index, please wait...', Const.CLZ_7, True)])
     self.index = ImpraIndex(self.conf.get('key','keys'), self.pathIdx, self.getIndexDefaultCatg(), self.getAccountList())
     defUsers   = self.conf.get('users','catg')
     if not ImpraIndex.SEP_KEY_INTERN+'users' in self.index.dic:
         self.index.dic[ImpraIndex.SEP_KEY_INTERN+'users'] = {}
     for k in self.index.dic[ImpraIndex.SEP_KEY_INTERN+'users']:
         if self.index.dic[ImpraIndex.SEP_KEY_INTERN+'users'][k] not in [ i.strip() for i in defUsers.split(',')]:
             self.conf.set('users',defUsers+', '+self.index.dic[ImpraIndex.SEP_KEY_INTERN+'users'][k],'catg')
开发者ID:pluie-org,项目名称:imprastorage,代码行数:9,代码来源:index.py

示例13: printHeaderPart

 def printHeaderPart(label,value):
     """"""
     a, b, c = ' [',':' ,'] '
     Sys.echo(a    , Sys.CLZ_HEAD_SEP, False)
     Sys.echo(label, Sys.CLZ_HEAD_KEY, False)
     Sys.echo(b    , Sys.CLZ_HEAD_SEP, False)
     Sys.echo(value, Sys.CLZ_HEAD_VAL, False)
     Sys.echo(c    , Sys.CLZ_HEAD_SEP, False)
     return [(a,Const.CLZ_HEAD_SEP),(label,Const.CLZ_HEAD_KEY),(b,Const.CLZ_HEAD_SEP),(value,Const.CLZ_HEAD_VAL),(c,Const.CLZ_HEAD_SEP)]
开发者ID:pluie-org,项目名称:imprastorage,代码行数:9,代码来源:cli.py

示例14: stop

 def stop(self):
     """"""
     if self.isAlive():
         self.cancel()
         if current_thread().getName()==self.getName():
             try:
                 self.emit('interrupted')
                 Sys.thread_exit()
             except RuntimeError as e :
                 print(str(self.getName()) + ' COULD NOT BE TERMINATED')
                 raise e
开发者ID:pluie-org,项目名称:imprastorage,代码行数:11,代码来源:app.py

示例15: halt_thread

 def halt_thread(self, *args):
     Sys.wlog(Sys.dprint())
     Sys.pwarn(('thread interrupt',), False)
     self.get('button1').set_sensitive(False)
     if self.thkmh is not None and self.thkmh.isAlive():
         self.thkmh.cancel()
     else :
         self.textbuffer.insert_at_cursor('Kmh Thread is not Alive\n')
         self.on_proceed_end(True)
         self.pb.hide()
         self.show_log()
开发者ID:pluie-org,项目名称:imprastorage,代码行数:11,代码来源:gui.py


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