Skip to content

Commit

Permalink
better support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Apr 18, 2016
1 parent 33f6265 commit 783f1ad
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/story/scripts/creator.py
Expand Up @@ -37,6 +37,9 @@
__license__ = "Apache License, Version 2.0"
""" The license for the module """

import os
import pprint

import appier
import story

Expand All @@ -46,13 +49,13 @@ def create(*args, **kwargs):

if __name__ == "__main__":
name = appier.conf("NAME", "untitled")
path = appier.conf("PATH", None)
file_path = appier.conf("FILE_PATH", None)

if not path:
raise appier.OperationalError(message = "No path defined")
if not file_path or not os.path.exists(file_path):
raise appier.OperationalError(message = "No path defined or path invalid")

file = open(path, "rb")
file = open(file_path, "rb")
kwargs = dict(name = name, file = file)

result = create(**kwargs)
print(result)
pprint.pprint(result)

0 comments on commit 783f1ad

Please sign in to comment.