Mercurial > p > roundup > code
view scripts/README.txt @ 7752:b2dbab2b34bc
fix(refactor): multiple fixups using ruff linter; more testing.
Converting to using the ruff linter and its rulesets. Fixed a number
of issues.
admin.py:
sort imports
use immutable tuples as default value markers for parameters where a
None value is valid.
reduced some loops to list comprehensions for performance
used ternary to simplify some if statements
named some variables to make them less magic
(e.g. _default_savepoint_setting = 1000)
fixed some tests for argument counts < 2 becomes != 2 so 3 is an
error.
moved exception handlers outside of loops for performance where
exception handler will abort loop anyway.
renamed variables called 'id' or 'dir' as they shadow builtin
commands.
fix translations of form _("string %s" % value) -> _("string %s") %
value so translation will be looked up with the key before
substitution.
end dicts, tuples with a trailing comma to reduce missing comma
errors if modified
simplified sorted(list(self.setting.keys())) to
sorted(self.setting.keys()) as sorted consumes whole list.
in if conditions put compared variable on left and threshold condition
on right. (no yoda conditions)
multiple noqa: suppression
removed unneeded noqa as lint rulesets are a bit different
do_get - refactor output printing logic: Use fast return if not
special formatting is requested; use isinstance with a tuple
rather than two isinstance calls; cleaned up flow and removed
comments on algorithm as it can be easily read from the code.
do_filter, do_find - refactor output printing logic. Reduce
duplicate code.
do_find - renamed variable 'value' that was set inside a loop. The
loop index variable was also named 'value'.
do_pragma - added hint to use list subcommand if setting was not
found. Replaced condition 'type(x) is bool' with 'isinstance(x,
bool)' for various types.
test_admin.py
added testing for do_list
better test coverage for do_get includes: -S and -d for multilinks,
error case for -d with non-link.
better testing for do_find including all output modes
better testing for do_filter including all output modes
fixed expected output for do_pragma that now includes hint to use
pragma list if setting not found.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 01 Mar 2024 14:53:18 -0500 |
| parents | 8d9a6063cb22 |
| children |
line wrap: on
line source
Scripts in this directory: add-issue Add a single issue, as specified on the command line, to your tracker. The initial message for the issue is taken from standard input. copy-user.py Copy one or more Roundup users from one tracker instance to another. dump_dbm_sessions_db.py Simple script to dump a session style dbm database e.g. db/otks or db/sessions in readable form. imapServer.py This IMAP server script that runs in the background and checks for new email from a variety of mailboxes. import_sf.py Import tracker data from Sourceforge.NET into a new roundup instance. roundup-reminder Generate an email that lists outstanding issues. Send in both plain text and HTML formats. schema_diagram.py Generate a schema diagram for a roundup tracker. It generates a 'dot file' that is then fed into the 'dot' tool (http://www.graphviz.org) to generate a graph. schema-dump.py Use recently documented XML-RPC API to dump Roundup data schema in human readable form. spam-remover Remove file attachment spam from a tracker. (Warning destructive, read script well.) stats.xmlrpc.py Script using the xmlrpc interface to retrieve info. Generates report on what values are used by the various issues on bugs.python.org. weekly-report Generate a simple report outlining the activity in one tracker for the most recent week. ---- server-ctl Control the roundup-server daemon from the command line with start, stop, restart, condstart (conditional start - only if server is stopped) and status commands. roundup.rc-debian An control script that may be installed in /etc/init.d on Debian systems. Offers start, stop and restart commands and integrates with the Debian init process. systemd.gunicorn A systemd unit file for running roundup under gnuicorn WSGI server. ---- contributors.py Analyzes Mercurial log, filters and compiles list of committers with years of contribution. Can be useful for updating COPYING.txt ---- Docker Directory for docker setup. More info on how to use it is in doc/installation.txt. Docker/Dockerfile - Create roundup docker. Docker/requirements.txt - Python requirements built into docker. Docker/roundup-start - Startup script for roundup in docker. Docker/docker-compose.yml - Manage two docker containers for roundup and mysql. ---- oauth-get-token.py Retrieve necessary credentials from MS cloud for OAuth authentication with IMAP. This has an extensive help text so you want to call this script with --help first.
