changeset 990:22cf13b86cc3

cm: Upgrade Garcon tasks to the latest PyInvoke version.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 19 Nov 2017 14:29:52 -0800
parents 8adc27285d93
children 1857dbd4580f
files garcon/benchsite.py garcon/changelog.py garcon/documentation.py garcon/messages.py garcon/pypi.py
diffstat 5 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/garcon/benchsite.py	Sun Nov 19 14:29:17 2017 -0800
+++ b/garcon/benchsite.py	Sun Nov 19 14:29:52 2017 -0800
@@ -73,6 +73,11 @@
         if not os.path.isdir(posts_dir):
             os.makedirs(posts_dir)
 
+        config_path = os.path.join(self.out_dir, 'config.yml')
+        if not os.path.exists(config_path):
+            with open(config_path, 'w') as fp:
+                fp.write('\n')
+
     def writePost(self, post_info):
         out_dir = os.path.join(self.out_dir, 'posts')
         slug = post_info['slug']
@@ -220,7 +225,7 @@
     from invoke import task
 
     @task
-    def genbenchsite(engine, out_dir, post_count=100, tag_count=10):
+    def genbenchsite(ctx, engine, out_dir, post_count=100, tag_count=10):
         generate(engine, out_dir,
                  post_count=post_count,
                  tag_count=tag_count)
--- a/garcon/changelog.py	Sun Nov 19 14:29:17 2017 -0800
+++ b/garcon/changelog.py	Sun Nov 19 14:29:52 2017 -0800
@@ -195,6 +195,6 @@
     from invoke import task
 
     @task
-    def genchangelog(out_file='CHANGELOG.rst', last=None):
+    def genchangelog(ctx, out_file='CHANGELOG.rst', last=None):
         generate(out_file, last)
 
--- a/garcon/documentation.py	Sun Nov 19 14:29:17 2017 -0800
+++ b/garcon/documentation.py	Sun Nov 19 14:29:52 2017 -0800
@@ -16,7 +16,7 @@
     'venv_dir': "The directory of the virtual environment to use to run "
                 "PieCrust."
     })
-def gendocs(tmp_dir=None, out_dir=None, root_url=None, venv_dir=None):
+def gendocs(ctx, tmp_dir=None, out_dir=None, root_url=None, venv_dir=None):
     base_dir = os.path.abspath(
             os.path.join(os.path.dirname(__file__), '..'))
     os.chdir(base_dir)
--- a/garcon/messages.py	Sun Nov 19 14:29:17 2017 -0800
+++ b/garcon/messages.py	Sun Nov 19 14:29:52 2017 -0800
@@ -3,7 +3,7 @@
 
 
 @task
-def genmessages():
+def genmessages(ctx):
     root_dir = 'garcon/messages'
     out_dir = 'piecrust/resources/messages'
     run('python chef.py --root %s bake -o %s' % (root_dir, out_dir))
--- a/garcon/pypi.py	Sun Nov 19 14:29:17 2017 -0800
+++ b/garcon/pypi.py	Sun Nov 19 14:29:52 2017 -0800
@@ -2,7 +2,7 @@
 
 
 @task
-def makerelease(version, local_only=False):
+def makerelease(ctx, version, local_only=False):
     if not version:
         raise Exception("You must specify a version!")