1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-22 02:06:18 +02:00
Commit Graph

40 Commits

Author SHA1 Message Date
lethliel
69b1233316 add regex for python3 missing arguments err
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.
2020-05-18 19:46:22 +02:00
lethliel
67560887db [python3] enable full python3 support for man 2018-12-13 13:33:51 +01:00
Bernhard M. Wiedemann
a472fcb522 Allow to override man-page date
to enable reproducible builds of osc packages
2017-06-17 17:40:42 +02:00
Florian Bergmann
8a70a0f285 Added readline support to cmdln-module.
This was already fixed in the original module:
https://github.com/trentm/cmdln/issues/1

Signed-off-by: Florian Bergmann <fbergmann@suse.de>
2015-01-09 13:33:31 +01:00
Marcus Huewe
b07a4d0b37 Merge branch 'w291' of https://github.com/berendt/osc
Conflicts:
	osc/build.py

Resolved merge conflict.
2014-08-14 17:24:28 +02:00
Christian Berendt
1751bdc47f Resolve PEP8 issue E231
* E231 missing whitespace after ':'
2014-08-13 17:30:12 +02:00
Christian Berendt
d35983d5b8 Resolve PEP8 issue W291
* W291 trailing whitespace
2014-08-12 15:01:16 +02:00
Danny Al-Gaaf
e1ea202802 cmdln.py: fix reimport of 're'
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-27 14:13:19 +02:00
Danny Al-Gaaf
b99a05e167 cmdln.py: remove some reimports of sys
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-27 14:07:04 +02:00
Danny Al-Gaaf
e6f8a1a7b3 cmdln.py: fix "More than one statement on a single line"
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-26 15:27:05 +02:00
Danny Al-Gaaf
f0a92430e8 cmdln.py: fix bad indentation
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-26 11:24:17 +02:00
Michal Vyskocil
1cd12ac566 python3 compatibility: fix a man page generation
Fixes a fail on a building of a documentation
http://lists.opensuse.org/opensuse-buildservice/2013-04/msg00099.html
2013-04-16 15:51:14 +02:00
Michal Vyskocil
b787ca2b39 python3 compatibility: make all unit test pass
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
2013-04-16 10:51:42 +02:00
Michal Vyskocil
5cc72902e0 python3 compatibility: raw_input
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.
2013-04-16 10:51:41 +02:00
Michal Vyskocil
7f2031558c python3 compatibility: print function
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
2013-04-16 10:51:41 +02:00
Michal Vyskocil
f814fe4af4 python3 compatibility: idioms
more idiomatic code - changes

  * type(foo) == bar to isinstance(foo, bar)
  * changes the uneeded .sort calls by sorted()
2013-04-16 10:51:18 +02:00
Michal Vyskocil
a134074417 python3 compatibility: funcattrs, methodattrs
the introspection names changed a lot in python3, so lets have two
implementations used by respective runtime
2013-04-16 10:51:17 +02:00
Michal Vyskocil
3a93ac6d10 python3 compatibility: except
changes 'except FooError, fe' to 'except FooError as fe'

available in python 2.6
2013-04-16 10:51:17 +02:00
Michal Vyskocil
d3648be24b python3 compatibility: dict
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)
2013-04-16 10:51:17 +02:00
Petr Uzel
197c10f661 Return argument to do_man back
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>
2010-12-22 13:29:52 +01:00
Michal Čihař
fa19a2436e One more case for dash escaping in man page. 2010-12-09 10:32:31 +01:00
Danny Kukawka
5a49daa69a fix warnings from pychecker
Fixed several warnings from pychecker as e.g.:
- (XY): shadows builtin
- Local variable (XY) not used
2010-08-20 14:34:41 +02:00
Danny Kukawka
b3c5204b59 fixed serveral warnings from pychecker.py
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()
2010-07-26 16:46:21 +02:00
Michal Čihař
70b3d34798 Another case of dash escaping. 2010-07-19 11:13:08 +02:00
Ludwig Nussel
32e99306b4 add vim mode lines to avoid evil tab characters :-) 2010-02-25 09:53:45 +01:00
Ludwig Nussel
c9e9730226 most help topics are capitalized 2010-01-12 15:11:42 +01:00
Michal Čihař
3492712952 Fix escaping of parameters separated by | in man page. 2009-12-10 13:55:27 +01:00
Pavol Rusnak
661d927d38 code cleanup 2009-10-20 14:30:15 +00:00
Michal Cihar
c40738b2ea Use non consuming expressions to allow escape more strings in one row. 2009-09-25 12:50:42 +00:00
Michal Cihar
eda5e9c38c Escape ' at the begining of the line as it is command marker for roff. 2009-09-25 11:19:02 +00:00
Michal Cihar
d6a8ac3fbb Better escaping regexps. 2009-06-23 10:09:48 +00:00
Michal Cihar
a574dbb3aa Add proper escaping of - in man page. 2009-06-17 09:28:10 +00:00
Michal Cihar
e5563bcaa4 Move osc specific bits to commandline module. 2009-05-06 13:20:15 +00:00
Michal Cihar
a30a1d595b Add support for generating a man page. 2009-05-06 11:46:17 +00:00
Michal Cihar
aedeea317c Drop shebang line from modules (bnc#500971).
(Some did have it and some did not, this way it is consistent and they
are anyway not supposed to be executed directly.)
2009-05-05 14:11:25 +00:00
3df88ab765 Consolidating delete commands:
* 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 :)
2009-05-04 19:07:05 +00:00
Marcus Hüwe
6ddace8c97 - fixed #426612
- other fixes for python26
2008-09-21 14:44:20 +00:00
Dr. Peter Poeml
fc6eaf68da - update cmdln.py to planned 1.0 version. The main changes are
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.
2007-05-16 10:55:05 +00:00
Dr. Peter Poeml
1c6f303c70 add debugging hint to cmdln.py 2007-05-04 21:51:15 +00:00
Dr. Peter Poeml
2f5b52e92c Complete rewrite of the internal commandline handling, using cmdln.py.
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
2007-04-24 23:00:12 +00:00