summaryrefslogtreecommitdiffstats
path: root/a
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2009-05-23 12:24:01 +0200
committerFlorian Pritz <f-p@gmx.at>2009-05-23 12:24:01 +0200
commitf116bd94122b2e37e935aea6bdc5475aa4ca4a3b (patch)
tree1c48c9e83ed535b742a6b21942c84933f172a902 /a
parente7eb5a6afd7d531d97b45b3a2c1105f7529a337b (diff)
downloadbin-f116bd94122b2e37e935aea6bdc5475aa4ca4a3b.tar.gz
bin-f116bd94122b2e37e935aea6bdc5475aa4ca4a3b.tar.xz
just 4 spaces -> 2 spaces
Diffstat (limited to 'a')
-rwxr-xr-xa82
1 files changed, 41 insertions, 41 deletions
diff --git a/a b/a
index 8c139cc..d77d68e 100755
--- a/a
+++ b/a
@@ -1,12 +1,12 @@
#!/usr/bin/python
#----------------------------------------------------
-# Version: 0.2.0
-# Author: Florian "Bluewind" Pritz <f-p@gmx.at>
+# Version: 0.2.0
+# Author: Florian "Bluewind" Pritz <f-p@gmx.at>
#
# Copyright (C) 2009 Florian Pritz
#
# Licensed under GNU General Public License v3
-# (see COPYING for full license text)
+# (see COPYING for full license text)
#----------------------------------------------------
# got bored and a.sh has some problems with spaces
#----------------------------------------------------
@@ -16,43 +16,43 @@ import tarfile
from optparse import OptionParser
def main():
- usage = "usage: %prog [options] <files>"
- p = OptionParser(usage)
- p.add_option("-f", "--file", dest="tarname", default=False,
- help="use <file>.tar.gz instead of $1.tar.gz", metavar="<file>")
- p.add_option("-b", "--bzip2", action="store_true", dest="bz2", default=False,
- help="use bzip2 compression")
- p.add_option("-u", "--uncompressed", action="store_true", dest="uncompressed", default=False,
- help="don't use compression at all")
-
- (options, args) = p.parse_args()
-
-
- if len(sys.argv) == 1:
- p.print_help()
- sys.exit()
-
- if options.tarname:
- tarname = options.tarname
- else:
- tarname = args[0]
-
- if options.bz2:
- tarname += ".tar.bz2"
- tar = tarfile.open(tarname, "w|bz2")
- elif options.uncompressed:
- tarname += ".tar"
- tar = tarfile.open(tarname, "w")
- else:
- tarname += ".tar.gz"
- tar = tarfile.open(tarname, "w|gz")
-
- for name in args:
- try:
- tar.add(name)
- except OSError:
- sys.stderr.write("No such file or directory: '%s'\n" % name)
- tar.close()
+ usage = "usage: %prog [options] <files>"
+ p = OptionParser(usage)
+ p.add_option("-f", "--file", dest="tarname", default=False,
+ help="use <file>.tar.gz instead of $1.tar.gz", metavar="<file>")
+ p.add_option("-b", "--bzip2", action="store_true", dest="bz2", default=False,
+ help="use bzip2 compression")
+ p.add_option("-u", "--uncompressed", action="store_true", dest="uncompressed", default=False,
+ help="don't use compression at all")
+
+ (options, args) = p.parse_args()
+
+
+ if len(sys.argv) == 1:
+ p.print_help()
+ sys.exit()
+
+ if options.tarname:
+ tarname = options.tarname
+ else:
+ tarname = args[0]
+
+ if options.bz2:
+ tarname += ".tar.bz2"
+ tar = tarfile.open(tarname, "w|bz2")
+ elif options.uncompressed:
+ tarname += ".tar"
+ tar = tarfile.open(tarname, "w")
+ else:
+ tarname += ".tar.gz"
+ tar = tarfile.open(tarname, "w|gz")
+
+ for name in args:
+ try:
+ tar.add(name)
+ except OSError:
+ sys.stderr.write("No such file or directory: '%s'\n" % name)
+ tar.close()
if __name__ == '__main__':
- main()
+ main()