summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xplanner/planner_generator.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/planner/planner_generator.py b/planner/planner_generator.py
index 2da3133..3da58ce 100755
--- a/planner/planner_generator.py
+++ b/planner/planner_generator.py
@@ -47,6 +47,7 @@ class Generator:
latitude: Optional[float] = None,
longitude: Optional[float] = None,
timezone: Optional[str] = None,
+ outdir: Optional[str] = ".",
):
self.year = year or (
datetime.date.today() + datetime.timedelta(days=334)
@@ -60,6 +61,7 @@ class Generator:
self.out_file = out_file or (
template or self.default_template
) + "-" + lang_name + ".pdf"
+ self.out_file = os.path.join(outdir, self.out_file)
if not template:
template = self.default_template
@@ -484,6 +486,11 @@ class Command:
help="Timezone for ephemeris calculation (e.g. Europe/Rome)",
)
parser.add_argument(
+ "--outdir",
+ default='.',
+ help="Directory to write the generated file to",
+ )
+ parser.add_argument(
"command",
)
return parser
@@ -507,6 +514,7 @@ class Command:
latitude=self.args.latitude,
longitude=self.args.longitude,
timezone=self.args.timezone,
+ outdir=self.args.outdir,
).run()
else:
print("command not supported: {}".format(self.args.command))