Remove global pipeargs.

This commit is contained in:
Arun Prakash Jana 2016-06-30 19:49:57 +05:30
parent a94c416b07
commit dbab849bb1
No known key found for this signature in database
GPG Key ID: C0A712ED95043DCB

7
buku
View File

@ -38,7 +38,6 @@ description = None # Description of the bookmark
tagsearch = False # Search bookmarks by tag tagsearch = False # Search bookmarks by tag
titleData = None # Title fetched from a page titleData = None # Title fetched from a page
debug = False # Enable debug logs debug = False # Enable debug logs
pipeargs = [] # Holds arguments piped to the program
interrupted = False # Received SIGINT interrupted = False # Received SIGINT
DELIMITER = ',' # Delimiter used to store tags in DB DELIMITER = ',' # Delimiter used to store tags in DB
_VERSION_ = '2.3' # Program version _VERSION_ = '2.3' # Program version
@ -1431,15 +1430,17 @@ Webpage: https://github.com/jarun/buku
# Handle piped input # Handle piped input
def main(argv): def main(argv, pipeargs = None):
if not sys.stdin.isatty(): if not sys.stdin.isatty():
pipeargs.extend(argv) pipeargs.extend(argv)
for s in sys.stdin.readlines(): for s in sys.stdin.readlines():
pipeargs.extend(s.split()) pipeargs.extend(s.split())
if __name__ == '__main__': if __name__ == '__main__':
pipeargs = []
try: try:
main(sys.argv) main(sys.argv, pipeargs)
except KeyboardInterrupt: except KeyboardInterrupt:
pass pass