summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
66dd8b6)
Important bugfix. If the extraction directory is None, then we can safely
assume that we just don't want to do anything but a default extraction, not
outputting the files anywhere special.
Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
self.heads.append (os.path.join (dir, head))
self.heads.append (os.path.join (dir, head))
- def extract (self, todir):
+ def extract (self, todir=None):
# Extract all heads of this set
# Create the directory $todir if it doesn't exist
# Extract all heads of this set
# Create the directory $todir if it doesn't exist
- if not os.path.isdir (todir):
+ if todir != None and not os.path.isdir (todir):
# TODO: LOGGER
try:
os.makedirs (todir)
# TODO: LOGGER
try:
os.makedirs (todir)
# Call the extraction function on each head
for h in self.heads:
# Call the extraction function on each head
for h in self.heads:
- extraction_func (h, todir)
+ if todir == None:
+ # Run in the head's directory
+ extraction_func (h, os.path.dirname (h))
+ else:
+ extraction_func (h, todir)
def __extract_rar (self, file, todir):
assert os.path.isfile (file)
def __extract_rar (self, file, todir):
assert os.path.isfile (file)