Skip to content

Commit

Permalink
v1.2 - Bugfix for windows and --mkdir.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lattyware committed Jan 8, 2012
1 parent 2336aee commit d085111
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions unrpa
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

'''
This program is free software: you can redistribute it and/or modify
Expand All @@ -17,7 +17,11 @@

### Copyright Gareth Latty 2009

### Version 1.1 (Current)
### Version 1.2 (Current)
### BUGFIX: Presumed a forwards slash in the make_directory_structure function,
### Broke under windows when using --mkdir.

### Version 1.1
### BUGFIX: Crash upon listing files when in verbose mode.
### BUGFIX: A few extra bytes were appended to the end of every file.

Expand Down Expand Up @@ -58,6 +62,9 @@ class UnRPA:
for item, data in index.iteritems():
self.make_directory_structure(os.path.join(self.path, os.path.split(item)[0]))
raw_file = self.extract_file(item, data)
print(self.path)
print(item)
print(os.path.join(self.path, item))
with open(os.path.join(self.path, item), "wb") as f:
f.write(raw_file)

Expand Down Expand Up @@ -90,7 +97,7 @@ class UnRPA:
while os.path.basename(name):
name, dirname = os.path.split(name)
dirs.append(dirname)
current = "/"
current = os.sep
dirs.reverse()
for directory in dirs:
current = os.path.join(current, directory)
Expand Down

0 comments on commit d085111

Please sign in to comment.