示例#1
0
文件: holding.py 项目: abhi11/dak
 def clean(self):
     cwd = os.getcwd()
     os.chdir(self.holding_dir)
     for f in self.in_holding.keys():
         # TODO: Sanitize path in a much better manner...
         if os.path.exists(f):
             if f.find('/') != -1:
                 fubar("WTF? clean_holding() got a file ('%s') with / in it!" % (f))
             else:
                 os.unlink(f)
     self.in_holding = {}
     os.chdir(cwd)
示例#2
0
 def clean(self):
     cwd = os.getcwd()
     os.chdir(self.holding_dir)
     for f in self.in_holding.keys():
         # TODO: Sanitize path in a much better manner...
         if os.path.exists(f):
             if f.find('/') != -1:
                 fubar(
                     "WTF? clean_holding() got a file ('%s') with / in it!"
                     % (f))
             else:
                 os.unlink(f)
     self.in_holding = {}
     os.chdir(cwd)