chiark
/
gitweb
/
~ianmdlvl
/
fdroidserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
905e58f
)
Use counters in lint
author
Daniel Martí
<mvdan@mvdan.cc>
Sat, 5 Jul 2014 12:04:51 +0000
(14:04 +0200)
committer
Daniel Martí
<mvdan@mvdan.cc>
Sat, 5 Jul 2014 12:04:51 +0000
(14:04 +0200)
fdroidserver/lint.py
patch
|
blob
|
history
diff --git
a/fdroidserver/lint.py
b/fdroidserver/lint.py
index 123a6441edba45f0b8a45e01531aa987b638b425..d265bfb5b47ed176af9aa4a3bbc90bd016d451a1 100644
(file)
--- a/
fdroidserver/lint.py
+++ b/
fdroidserver/lint.py
@@
-22,6
+22,7
@@
import re
import logging
import common
import metadata
import logging
import common
import metadata
+from collections import Counter
config = None
options = None
config = None
options = None
@@
-129,20
+130,19
@@
regex_pedantic = {
def main():
def main():
- global config, options, appid,
app_count, warn_
count
+ global config, options, appid, count
appid = None
appid = None
- app_count = 0
- warn_count = 0
+ count = Counter()
def warn(message):
def warn(message):
- global appid,
app_count, warn_
count
+ global appid, count
if appid:
print "%s:" % appid
appid = None
if appid:
print "%s:" % appid
appid = None
-
app_count
+= 1
+
count['app']
+= 1
print ' %s' % message
print ' %s' % message
-
warn_count
+= 1
+
count['warn']
+= 1
def pwarn(message):
if options.pedantic:
def pwarn(message):
if options.pedantic:
@@
-246,7
+246,7
@@
def main():
if not appid:
print
if not appid:
print
- logging.info("Found a total of %i warnings in %i apps." % (
warn_count, app_count
))
+ logging.info("Found a total of %i warnings in %i apps." % (
count['warn'], count['app']
))
if __name__ == "__main__":
main()
if __name__ == "__main__":
main()