import argparse
from pprint import pprint
-class Anarchronofile:
+class AnarChronofile:
def __init__(self, args):
if not os.path.exists(args.file[0]):
raise FileNotFoundError('File not found: ' + args.file[0])
- self.args = args
- self.file = open(args.file[0], '+r')
- self.yaml = yaml.load(self.file)
+ if os.path.isfile(args.file[0]):
+ self.args = args
+ self.file = open(args.file[0], '+r')
+ self.yaml = yaml.load(self.file)
def run(self):
+ if getattr(self, 'args', None) is None:
+ return
+
print(self.args)
print("---")
print("")
args = cmdline()
try:
- parser = Anarchronofile(args)
+ parser = AnarChronofile(args)
parser.run()
except (FileNotFoundError, KeyboardInterrupt) as e:
print(e)