changeset 944:23052bf8a62b

sources: Change argument name in default source's `createContent`. This is so it's compatible with the interactive fields' argument names.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 05 Oct 2017 00:23:56 -0700
parents b61dd60aff36
children b7418025797f
files piecrust/sources/default.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/sources/default.py	Thu Oct 05 00:22:53 2017 -0700
+++ b/piecrust/sources/default.py	Thu Oct 05 00:23:56 2017 -0700
@@ -93,13 +93,13 @@
         return ContentItem(path, metadata)
 
     def setupPrepareParser(self, parser, app):
-        parser.add_argument('uri', help='The URI for the new page.')
+        parser.add_argument('slug', help='The slug for the new page.')
 
     def createContent(self, args):
-        uri = args.get('uri')
-        if not uri:
-            uri = '_index'
-        path = os.path.join(self.fs_endpoint_path, uri)
+        slug = args.get('slug')
+        if not slug:
+            slug = '_index'
+        path = os.path.join(self.fs_endpoint_path, slug)
         _, ext = os.path.splitext(path)
         if ext == '':
             path = '%s.%s' % (path, self.default_auto_format)