Permalink
Browse files

fixed andy's bug

  • Loading branch information...
1 parent a3725b9 commit a05e48c4d0782ebb413d19e660c2e8067b8aa7e6 @tyler-dodge committed Apr 19, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −7 hashcal.py
View
13 hashcal.py
@@ -15,20 +15,19 @@
import pickle
import os
-def file_check(fn, *args):
- file_name = *args[0]
- def wrap():
+def file_check(fn):
+ def wrap(self, file_name, *args):
if not os.path.exists(file_name):
os.makedirs(options.file[:file_name.rfind("/")]) #create directory
file(file_name, "w").close() # create file and close it
- fn(*args)
+ fn(self, file_name, *args)
return wrap
class HashCal(object):
- def __init__(self, sourceFile=None):
+ def __init__(self, source_file=None):
"""Create HashCal. If file is given, load events from it"""
- if sourceFile is not None:
- self.load_from_file(sourceFile)
+ if source_file is not None:
+ self.load_from_file(source_file)
else:
self.events = []
def split_hashtags(self, args):

0 comments on commit a05e48c

Please sign in to comment.