Skip to content

Commit

Permalink
Added Notes to Sidebar, more tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Yu authored and j0yu committed Feb 23, 2020
1 parent 347f7c5 commit f61dfee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/rez/cli/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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 '--'
Expand Down
1 change: 1 addition & 0 deletions wiki/pages/__Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

- [[Glossary]]
- [[FAQ]]
- [[Notes]]
- [[Credits]]

<details><summary> :construction: Unwritten pages:</summary>
Expand Down
18 changes: 10 additions & 8 deletions wiki/update-wiki.py
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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)

Expand Down

0 comments on commit f61dfee

Please sign in to comment.