From f61dfee87419b56fe9adb16d740d631064177f7d Mon Sep 17 00:00:00 2001 From: Joseph Yu Date: Tue, 7 Jan 2020 17:30:46 +0000 Subject: [PATCH] Added Notes to Sidebar, more tidy --- src/rez/cli/_main.py | 8 ++++---- wiki/pages/__Sidebar.md | 1 + wiki/update-wiki.py | 18 ++++++++++-------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/rez/cli/_main.py b/src/rez/cli/_main.py index 1e46da0c9..c5b0351c4 100644 --- a/src/rez/cli/_main.py +++ b/src/rez/cli/_main.py @@ -71,8 +71,7 @@ def __call__(self, parser, args, values, option_string=None): def setup_parser(): - """Create and setup parser for given rez (sub) command. - + """Create and setup parser for given rez command line interface. Returns: LazyArgumentParser: Argument parser for rez command. @@ -106,6 +105,9 @@ def setup_parser(): def run(command=None): + + sys.dont_write_bytecode = True + # construct args list. Note that commands like 'rez-env foo' and # 'rez env foo' are equivalent if command: @@ -122,8 +124,6 @@ def run(command=None): else: arg_mode = None - sys.dont_write_bytecode = True - parser = setup_parser() if arg_mode == "grouped": # args split into groups by '--' diff --git a/wiki/pages/__Sidebar.md b/wiki/pages/__Sidebar.md index 00045f4bc..a02400609 100644 --- a/wiki/pages/__Sidebar.md +++ b/wiki/pages/__Sidebar.md @@ -31,6 +31,7 @@ - [[Glossary]] - [[FAQ]] +- [[Notes]] - [[Credits]]
:construction: Unwritten pages: diff --git a/wiki/update-wiki.py b/wiki/update-wiki.py index ce5682c5c..1ec6eae3c 100644 --- a/wiki/update-wiki.py +++ b/wiki/update-wiki.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- """Python implementation of old ``update-wiki.sh`` merged with ``process.py``. +*From ``update-wiki.sh``* + This script calls git heavily to: 1. Takes the content from this repo; 2. Then writes it into a local clone of https://github.com/nerdvegas/rez.wiki.git; @@ -13,8 +15,8 @@ Original wiki update script files: - ``wiki/update-wiki.sh`` at rez 2.50.0, which calls - - ``utils/process.py`` at rez.wiki d632328, and - - ``utils/update.sh`` at rez.wiki d632328 + - ``utils/process.py`` from nerdvegas/rez.wiki at d632328, and + - ``utils/update.sh`` from nerdvegas/rez.wiki at d632328 """ from __future__ import absolute_import from __future__ import division @@ -706,11 +708,11 @@ def _format_action(self, action): class UpdateWikiParser(argparse.ArgumentParser): """Parser flags, using global variables as defaults.""" - INIT_DEFAULTS = ( - ("prog", "update-wiki"), - ("description", "Update GitHub Wiki"), - ("formatter_class", argparse.ArgumentDefaultsHelpFormatter), - ) + INIT_DEFAULTS = { + "prog": "update-wiki", + "description": "Update GitHub Wiki", + "formatter_class": argparse.ArgumentDefaultsHelpFormatter, + } def __init__(self, **kwargs): """Setup default arguments and parser description/program name. @@ -723,7 +725,7 @@ def __init__(self, **kwargs): Same key word arguments taken by ``argparse.ArgumentParser.__init__()`` """ - for key, value in self.INIT_DEFAULTS: + for key, value in self.INIT_DEFAULTS.items(): kwargs.setdefault(key, value) super(UpdateWikiParser, self).__init__(**kwargs)