zoukankan      html  css  js  c++  java
  • python Queue

    import Queue
    
    class Publish:
        def removeOldTar(self):
            cmd='ls ' + self.oss_root_dir + " | awk '{print $5}'"
            self.debug(cmd)
            rs=commands.getoutput(cmd)
            arrList=rs.split('
    ')
            keeplist=Queue.Queue(self.keepOldPackageNum)
            for tar in arrList:
                if len(tar) < 20:
                    continue
                if keeplist.full():
                    deltar=keeplist.get()
                    print deltar
                    cmd_del_tar='del ' + tar                                                                                                                               
                    self.debug(cmd_del_tar)
                    os.system(cmd_del_tar)
                    keeplist.put(tar)
                else:
                    keeplist.put(tar)
        def execute(self):
            self.removeOldTar()
    
    obj=Publish()
    obj.execute()
    

      

  • 相关阅读:
    Numpy
    啊大大阿达
    asda
    啊大大
    初识python
    初识python
    初识python
    初识python
    初识python
    初识python
  • 原文地址:https://www.cnblogs.com/allenhaozi/p/5961488.html
Copyright © 2011-2022 走看看