From dbab849bb12b5907954a641eb85eaa6de2dd907d Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Thu, 30 Jun 2016 19:49:57 +0530 Subject: [PATCH] Remove global `pipeargs`. --- buku | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buku b/buku index f111b3b..b0e3bf1 100755 --- a/buku +++ b/buku @@ -38,7 +38,6 @@ description = None # Description of the bookmark tagsearch = False # Search bookmarks by tag titleData = None # Title fetched from a page debug = False # Enable debug logs -pipeargs = [] # Holds arguments piped to the program interrupted = False # Received SIGINT DELIMITER = ',' # Delimiter used to store tags in DB _VERSION_ = '2.3' # Program version @@ -1431,15 +1430,17 @@ Webpage: https://github.com/jarun/buku # Handle piped input -def main(argv): +def main(argv, pipeargs = None): if not sys.stdin.isatty(): pipeargs.extend(argv) for s in sys.stdin.readlines(): pipeargs.extend(s.split()) if __name__ == '__main__': + pipeargs = [] + try: - main(sys.argv) + main(sys.argv, pipeargs) except KeyboardInterrupt: pass