add new regex and check for missing arguments.
The error message in python3 differs from the one in python2.
python3:
do_api() missing 1 required positional argument: 'url'
python2:
do_api() takes exactly 4 arguments (3 given)
To be compatible with python2 two checks are needed.
There are many places can't be covered by 2to3, especially the
str/unicode -> str/bytes change done in python3. This is a big patch
incorporating all changes made in order to make python3 suite.py run
without any single failure.
It
* adapt the introspect_handler_3 for case there are no __defaults__
* adds the ET_ENCODING variable for ET.fromstring ("unicode" in py3,
"utf-8" in py2)
* (re)adds various builtins to both python versions
- memoryview to python 2.6
- bytes compatible with py3 to 2.6 and 2.7
and it changes few parts of tests/common.py in order to be compatible
with python3
* new urlcompare method compares all components or url + parsed query
string in a dictionary, so the ordering, neither quoting does not matter
* bytes builtin has been added to 2.x and used in assertEqualMultiline
raw_input has been removed and equals to input in py3. Unfortunatelly no
__future__ statement exists for that. Ensure all modules uses
osc.core.raw_input except osc.cmdln, where there is NameError way
implemented.
The most visible change in python3 - removal of print statement and all
the crufty
print >> sys.stderr, foo,
The from __future__ import print_function makes it available in python
2.6
this patch
1.) removes the iteritems/itervalues, which were dropped in py3
items/values are used instead
2.) add an extra list() in a cases the list-based access is needed
(included appending, indexing and so)
3.) changes a sorting idiom in few places
instead of
foo = dict.keys()
foo.sort()
for i in foo:
there is a recommended
for i in sorted(dict.keys()):
4.) in one occassion it removes a if dict.has_key() by simpler
dict.get(key, default)
Revert a part of b3c5204, the do_main has to have at least one
argument, unless following exception will appear
osc.cmdln.CmdlnError: incorrect argcount for do_man(): takes 1, must
take 2 for 'argv' signature or 3+ for 'opts' signature
Signed-off-by: Petr Uzel <puzel@suse.cz>
Signed-off-by: Michal Vyskocil <mvyskocil@suse.cz>
Fixed serveral warnings from pychecker.py like such:
- Parameter ($) not used
- Local variable ($) not used
Including fixes like:
- remove not needed imports
- don't read apiurl in core.py from config if already available via
function parameter
- delPerson(): check for user as e.g. in addPerson()
* obsolete deletepac and deleteprj to delete and rdelete commands.
- enable package tracking by default
* add support to hide commands in help list (so we can show propper
help when people still try to use it).
seife: this is for you, drop your own scripts emulating it :)
related to points that were raised during employment in osc:
# v0.8.3
- Fix a bug where errors with passing an incorrect number of args to
functions in do_foo() implementations would be masked.
# v1.0.0
- [backward incompat] `Cmdln.main()` no longer takes an `optparser`
argument. Top-level option parsing has been changed so that top-level
options for a `Cmdln` subclass can more naturally be defined and
handled on the class definition. Changes:
- `Cmdln.main()` calls `self.get_optparser` to get an option handler.
Subclasses should overload this method for custom top-level options.
- After option parsing, but before sub-command handling, the
`self.postoptparse()` hook is called.
- Add a `version` attribute on `Cmdln` subclasses. If set, the default
top-level option parser will have a `--version` attribute.
- [backward incompat] Simplify the StopProcessing/opts.stop handling for
option handling in subcommands. The "opts" argument to "do_*"
sub-command functions will no longer have a "stop" value.
StopProcessing is now called StopOptionProcessing. This shouldn't
affect simple usage of cmdln.py.
- adjust osc.commandline for these changes.
Bump version to 0.95.
New features:
- implement "rebuild all failed packages", via --failed option in rebuildpac
subcommand (new api route)
- status -v shows all files, including unmodified ones
- suppress the legend in prjresults by default (show with -l)
- add global options to override config
- can use arbitrary api server via global -A option
- -H enables HTTP traffic debugging
- --version
Bugfixes:
- fix typo in delete_project() (the line building up the URL got lost)
- fix the commit subcommand's arguments. This works correctly now:
osc ci ../test/onlyinwc `pwd` fstab ../test/f2
- fix buildinfo subcommand, if no specfile is posted. Broke with the recent URL
handling rewrite, but didn't seem to bother because the build subcommand
always sends the specfile.
- try to fix buildhistory route, but it might be gone actually (need to pursue)
- add --clean/--noinit to osc build help output