Permalink
Browse files

Merge branch 'master' of github.com:midgetspy/Lift-Cup

Conflicts:
	lc.py
  • Loading branch information...
midgetspy committed May 12, 2011
2 parents a51f75e + 17e1ebb commit 11c83af8a0ab1cf316f7085850d74aebf101f3d6
Showing with 10 additions and 3 deletions.
  1. +2 −0 .gitignore
  2. +1 −1 lc.py
  3. +7 −2 lift_cup.py
View
@@ -0,0 +1,2 @@
+*.pyc
+conf.py
View
2 lc.py
@@ -42,7 +42,7 @@ def usage():
# parse out the options from the command line, GNU style
try:
- opts, args = getopt.gnu_getopt(sys.argv[1:], "dtq::", ['debug', 'test', 'nolog', 'quality=', 'skipquality'])
+ opts, args = getopt.gnu_getopt(sys.argv[1:], "dtq::", ['debug', 'test', 'nolog', 'nocleanup', 'noupload', 'quality=', 'skipquality'])
except getopt.GetoptError:
usage()
View
@@ -23,6 +23,7 @@
import shlex
import shutil
import sys
+import datetime
from quality import Quality
@@ -59,7 +60,11 @@ def __init__(self, full_file_path, quality=None, log=True, test=False, debug=Fal
# primitive logging
if self.log:
if not os.path.isdir(LOG_DIR):
- os.makedirs(LOG_DIR)
+ try:
+ os.makedirs(LOG_DIR)
+ except OSError:
+ print "Error:", "No permissions to create ", LOG_DIR
+ sys.exit(1)
self.log_file = open(os.path.join(LOG_DIR, 'lc_log.'+self.file+'.txt'), 'w')
# if we don't have a valid quality from the config then try to convert the string
@@ -80,7 +85,7 @@ def __init__(self, full_file_path, quality=None, log=True, test=False, debug=Fal
def logger(self, *args, **kwargs):
- message = ' '.join([str(x) for x in args])
+ message = str(datetime.datetime.today()) + ' ' + ' '.join([str(x) for x in args])
if ('debug' not in kwargs or not kwargs['debug']):
print message
elif self.debug:

0 comments on commit 11c83af

Please sign in to comment.