Commit Graph

21 Commits

Author SHA1 Message Date
Hans-Christoph Steiner b92e280eab fix code format for new black rule 2023-03-20 14:47:48 +01:00
Hans-Christoph Steiner 828d6015ef purge code that modifies the app description, including linkifying
closes #845
2020-12-08 09:37:49 +01:00
Hans-Christoph Steiner fede58a710 use ArgumentParser's own "usage" line in help output 2020-10-01 23:01:55 +02:00
Daniel Martí 82b1d7ad14 all: make newer pycodestyle happy
Apparently the "two empty lines" rule is now stricter.
2016-11-15 20:55:06 +00:00
Hans-Christoph Steiner d522988d8c make metadata exceptions optional based on CLI flag
In many cases, there are times where metadata errors need to be ignored, or
at least not stop the command from running.  For example, there will
inevitably be new metadata fields added, in which case a packaged version
of fdroidserver will throw errors on each one.  This adds a standard -W
flag to customize the response: ignore, default, or error.

* by default, the errors are still errors
* `fdroid readmeta -W` will just print errors
* `fdroid readmeta -Wignore` will not even print errors

https://gitlab.com/fdroid/fdroidserver/issues/150
2016-09-12 12:55:48 +02:00
Daniel Martí 920ae4692f Port all imports to python3 2016-03-10 16:43:37 +00:00
Daniel Martí e829b0f9e7 Get readmeta and rewritemeta running under python3 2016-03-10 16:43:37 +00:00
Daniel Martí 99edd64372 Switch all headers to python3 2016-03-10 16:43:36 +00:00
Daniel Martí 576da1d048 all: deduplicate -v/-q setup 2015-09-11 23:42:50 -07:00
nero-tux d23ecf1b35 replace deprecated optparse with argparse
following guidelines from:
https://docs.python.org/2/library/argparse.html#upgrading-optparse-code
except, still using option = parse.parse_args() instead of args = ...

- using the following script in folder fdroidserver:
	for i in *.py; do
		sed -i -e 's/optparse/argparse/' \
			-e 's/OptionParser/ArgumentParser/' \
			-e 's/OptionError/ArgumentError/' \
			-e 's/add_option/add_argument/' \
			-e 's/(options, args) = parser/options = parser/' \
			-e 's/options, args = parser/options = parser/' \
			-e 's/Usage: %prog/%(prog)s/' $i;
	done
- use ArgumentParser argument to replace (option, args) = parser.parse()
  call
- use parser.error(msg) instead of raise ArgumentException as suggested
  in https://docs.python.org/2/library/argparse.html#exiting-methods
- in fdroid catch ArgumentError instead of OptionError
2015-09-06 10:34:50 +02:00
Daniel Martí bace7e912f Add missing -v and -q to readmeta 2015-08-28 15:53:59 -07:00
Daniel Martí bc5d5cbd83 Also use OptionParser in readmeta to add -h/--help 2015-07-30 11:35:25 -07:00
Daniel Martí 49208b257d Always run read_srclibs as part of read_metadata 2014-06-30 14:39:52 +02:00
Daniel Martí 0f0ccdb1e1 Fix some more pep8 warnings 2014-05-28 09:33:14 +02:00
Daniel Martí 1d5280d528 Fix pyflakes errors in readmeta 2014-05-27 15:56:57 +02:00
Daniel Martí ecb2a2a969 Make readmeta use srclibs and check for config.py too 2014-05-27 15:17:37 +02:00
Ciaran Gultnieks 277d95f57d Fix several read_metadata-related issues
Various calls with the wrong parameters, and also an unused parameter on
the function itself.
2014-05-20 17:48:45 +01:00
Hans-Christoph Steiner aa5f317c26 fix PEP8 "W391 blank line at end of file" 2014-05-06 11:45:03 -04:00
Hans-Christoph Steiner 3f4f7a544b fix PEP8 "E302 expected 2 blank lines, found 1" 2014-05-06 11:45:03 -04:00
Hans-Christoph Steiner 2f2618e06c fix PEP8 "E401 multiple imports on one line" 2014-05-06 11:45:03 -04:00
Daniel Martí 96c5afa03f New command: readmeta, like lint but without warnings 2014-02-02 15:11:26 +01:00