Mercurial > piecrust2
diff piecrust/sources/default.py @ 892:c445a3d5d950
internal: Make `createContent` use a dictionary-like object.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 02 Jul 2017 22:20:32 -0700 |
parents | d9059257743c |
children | 86b684cc0551 |
line wrap: on
line diff
--- a/piecrust/sources/default.py Sun Jul 02 22:19:58 2017 -0700 +++ b/piecrust/sources/default.py Sun Jul 02 22:20:32 2017 -0700 @@ -92,10 +92,7 @@ parser.add_argument('uri', help='The URI for the new page.') def createContent(self, args): - if not hasattr(args, 'uri'): - uri = None - else: - uri = args.uri + uri = args.get('uri') if not uri: uri = '_index' path = os.path.join(self.fs_endpoint_path, uri)