Mercurial > p > roundup > code
comparison roundup/admin.py @ 7178:db06d4aeb978
unshadow stdlib token from roundup's token.
This bites me every now and again when running pytest and pdb. Some
submodules want to load the stdlib python and end up getting roundup's
python and thing break with N_TOKENS not defined etc.
So rename token.py to token_r.py (token_r(oundup)... hey naming things
is hard) an change code as needed.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 26 Feb 2023 12:00:35 -0500 |
| parents | f72ce883e677 |
| children | 0c6617db0b97 |
comparison
equal
deleted
inserted
replaced
| 7177:d787f7282ea3 | 7178:db06d4aeb978 |
|---|---|
| 30 import os | 30 import os |
| 31 import re | 31 import re |
| 32 import shutil | 32 import shutil |
| 33 import sys | 33 import sys |
| 34 | 34 |
| 35 from roundup import date, hyperdb, init, password, token | 35 from roundup import date, hyperdb, init, password, token_r |
| 36 from roundup import __version__ as roundup_version | 36 from roundup import __version__ as roundup_version |
| 37 import roundup.instance | 37 import roundup.instance |
| 38 from roundup.configuration import (CoreConfig, NoConfigError, OptionUnsetError, | 38 from roundup.configuration import (CoreConfig, NoConfigError, OptionUnsetError, |
| 39 ParsingOptionError, UserConfig) | 39 ParsingOptionError, UserConfig) |
| 40 from roundup.i18n import _, get_translation | 40 from roundup.i18n import _, get_translation |
| 1829 except EOFError: | 1829 except EOFError: |
| 1830 print(_('exit...')) | 1830 print(_('exit...')) |
| 1831 break | 1831 break |
| 1832 if not command: continue # noqa: E701 | 1832 if not command: continue # noqa: E701 |
| 1833 try: | 1833 try: |
| 1834 args = token.token_split(command) | 1834 args = token_r.token_split(command) |
| 1835 except ValueError: | 1835 except ValueError: |
| 1836 continue # Ignore invalid quoted token | 1836 continue # Ignore invalid quoted token |
| 1837 if not args: continue # noqa: E701 | 1837 if not args: continue # noqa: E701 |
| 1838 if args[0] in ('quit', 'exit'): break # noqa: E701 | 1838 if args[0] in ('quit', 'exit'): break # noqa: E701 |
| 1839 self.run_command(args) | 1839 self.run_command(args) |
