[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: make lint happy
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: make lint happy |
Date: |
Tue, 26 Feb 2019 18:00:13 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 2f5618398 make lint happy
2f5618398 is described below
commit 2f5618398764eeea0cd84aaa40f4e4dad8b64eff
Author: ng0 <address@hidden>
AuthorDate: Tue Feb 26 17:00:07 2019 +0000
make lint happy
---
src/util/gnunet-qr.py | 156 +++++++++++++++++++++++++-------------------------
1 file changed, 78 insertions(+), 78 deletions(-)
diff --git a/src/util/gnunet-qr.py b/src/util/gnunet-qr.py
index 6cb9633f0..d42160ad8 100755
--- a/src/util/gnunet-qr.py
+++ b/src/util/gnunet-qr.py
@@ -23,90 +23,90 @@ Arguments mandatory for long options are also mandatory for
short options.\n\
-h, --help print this help\n\
-v, --verbose be verbose\n\
Report bugs to address@hidden
-GNUnet home page: http://www.gnu.org/software/gnunet/\n\
-General help using GNU software: http://www.gnu.org/gethelp/')
+GNUnet home page: https://gnunet.org/\n\
+General help using GNU software: https://www.gnu.org/gethelp/')
if __name__ == '__main__':
- configuration = ''
- device = '/dev/video0'
- url = ''
- verbose = False
- silent = False
- # Parse arguments
- try:
- opts, args = getopt.gnu_getopt(sys.argv[1:], "c:hd:sv",
["config", "help", "device", "silent", "verbose"])
- except getopt.GetoptError as e:
- help()
- print(str(e))
- exit(1)
- for o, a in opts:
- if o in ("-h", "--help"):
- help()
- sys.exit(0)
- elif o in ("-c", "--config"):
- configuration = a
- elif o in ("-d", "--device"):
- device = a
- elif o in ("-s", "--silent"):
- silent = True
- elif o in ("-v", "--verbose"):
- verbose = True
- if (True == verbose):
- print('Initializing')
- # create a Processor
- proc = zbar.Processor()
+ configuration = ''
+ device = '/dev/video0'
+ url = ''
+ verbose = False
+ silent = False
+ # Parse arguments
+ try:
+ opts, args = getopt.gnu_getopt(sys.argv[1:], "c:hd:sv", ["config",
"help", "device", "silent", "verbose"])
+ except getopt.GetoptError as e:
+ help()
+ print(str(e))
+ exit(1)
+ for o, a in opts:
+ if o in ("-h", "--help"):
+ help()
+ sys.exit(0)
+ elif o in ("-c", "--config"):
+ configuration = a
+ elif o in ("-d", "--device"):
+ device = a
+ elif o in ("-s", "--silent"):
+ silent = True
+ elif o in ("-v", "--verbose"):
+ verbose = True
+ if (True == verbose):
+ print('Initializing')
+ # create a Processor
+ proc = zbar.Processor()
- # configure the Processor
- proc.parse_config('enable')
+ # configure the Processor
+ proc.parse_config('enable')
- # initialize the Processor
- try:
- if (True == verbose):
- print('Opening video device ' + device)
- proc.init(device)
- except Exception as e:
- print('Failed to open device ' + device)
- exit(1)
+ # initialize the Processor
+ try:
+ if (True == verbose):
+ print('Opening video device ' + device)
+ proc.init(device)
+ except Exception as e:
+ print('Failed to open device ' + device)
+ exit(1)
- # enable the preview window
- # if (True == silent):
- # proc.visible = True
- # else:
- # proc.visible = False
+ # enable the preview window
+ # if (True == silent):
+ # proc.visible = True
+ # else:
+ # proc.visible = False
- proc.visible = True
- # read at least one barcode (or until window closed)
- try:
- if (True == verbose):
- print('Capturing')
- proc.process_one()
- except Exception as e:
- # Window was closed without finding code
- exit(1)
+ proc.visible = True
+ # read at least one barcode (or until window closed)
+ try:
+ if (True == verbose):
+ print('Capturing')
+ proc.process_one()
+ except Exception as e:
+ # Window was closed without finding code
+ exit(1)
- # hide the preview window
- proc.visible = False
+ # hide the preview window
+ proc.visible = False
- # extract results
- for symbol in proc.results:
- # do something useful with results
- if (True == verbose):
- print('Found ', symbol.type, ' symbol ', '"%s"' %
symbol.data)
- args = list()
- args.append("gnunet-uri")
- if (configuration != ''):
- args.append(str("-c " + str(configuration)))
- args.append(str(symbol.data))
- cmd = ''
- for a in args:
- cmd += " " + str(a)
- if (verbose):
- print('Running `' + cmd +'`')
- res = subprocess.call(args)
- if (0 != res):
- print('Failed to add URI ' + str(symbol.data))
- else:
- print('Added URI ' + str(symbol.data))
- exit(res)
- exit(1)
+ # extract results
+ for symbol in proc.results:
+ # do something useful with results
+ if (True == verbose):
+ print('Found ', symbol.type, ' symbol ', '"%s"' % symbol.data)
+ args = list()
+ args.append("gnunet-uri")
+ if (configuration != ''):
+ args.append(str("-c " + str(configuration)))
+ args.append(str(symbol.data))
+ cmd = ''
+ for a in args:
+ cmd += " " + str(a)
+ if (verbose):
+ print('Running `' + cmd +'`')
+ res = subprocess.call(args)
+ if (0 != res):
+ print('Failed to add URI ' + str(symbol.data))
+ else:
+ print('Added URI ' + str(symbol.data))
+ exit(res)
+ exit(1)
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: make lint happy,
gnunet <=