]> git.donarmstrong.com Git - dak.git/blobdiff - daklib/holding.py
Improve dsc_in_suite function documentation
[dak.git] / daklib / holding.py
index f77416cadc224c7a6827608883df8db6037dd2c6..6c9ce570a863319bde2e3bef679ddcbe264f94eb 100644 (file)
@@ -45,19 +45,22 @@ class Holding(object):
             self.initialised = True
 
             self.in_holding = {}
-            self.holding_dir = Config()["Dir::Queue::Holding"]
+            self.holding_dir = Config()["Dir::Holding"]
             # ftptrainees haven't access to holding, use a temp directory instead
             if not os.access(self.holding_dir, os.W_OK):
                 self.holding_dir = Config()["Dir::TempPath"]
 
+    def chdir_to_holding(self):
+        os.chdir(self.holding_dir)
+
     def copy_to_holding(self, filename):
         base_filename = os.path.basename(filename)
 
         dest = os.path.join(self.holding_dir, base_filename)
         try:
-            fd = os.open(dest, os.O_RDWR | os.O_CREAT | os.O_EXCL, 0640)
+            fd = os.open(dest, os.O_RDWR | os.O_CREAT | os.O_EXCL, 0o640)
             os.close(fd)
-        except OSError, e:
+        except OSError as e:
             # Shouldn't happen, but will if, for example, someone lists a
             # file twice in the .changes.
             if e.errno == EEXIST:
@@ -65,7 +68,7 @@ class Holding(object):
 
         try:
             shutil.copy(filename, dest)
-        except IOError, e:
+        except IOError as e:
             # In either case (ENOENT or EACCES) we want to remove the
             # O_CREAT | O_EXCLed ghost file, so add the file to the list
             # of 'in holding' even if it's not the real file.