removing reference to cmdqueue in case we want to migrate to cmd2
This commit is contained in:
parent
6f36970b34
commit
d1ce7bd662
21
offpunk.py
21
offpunk.py
|
@ -16,6 +16,7 @@ _VERSION = "0.3"
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import cmd
|
import cmd
|
||||||
|
#import cmd2 as cmd
|
||||||
import cgi
|
import cgi
|
||||||
import codecs
|
import codecs
|
||||||
import collections
|
import collections
|
||||||
|
@ -3323,7 +3324,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
print("Skipping rc command \"%s\" due to provided URLs." % line)
|
print("Skipping rc command \"%s\" due to provided URLs." % line)
|
||||||
continue
|
continue
|
||||||
gc.cmdqueue.append(line)
|
gc.onecmd(line)
|
||||||
print("Welcome to Offpunk!")
|
print("Welcome to Offpunk!")
|
||||||
if args.restricted:
|
if args.restricted:
|
||||||
print("Restricted mode engaged!")
|
print("Restricted mode engaged!")
|
||||||
|
@ -3334,21 +3335,19 @@ def main():
|
||||||
# If tls_key is None, python will attempt to load the key from tls_cert.
|
# If tls_key is None, python will attempt to load the key from tls_cert.
|
||||||
gc._activate_client_cert(args.tls_cert, args.tls_key)
|
gc._activate_client_cert(args.tls_cert, args.tls_key)
|
||||||
if args.bookmarks:
|
if args.bookmarks:
|
||||||
gc.cmdqueue.append("bookmarks")
|
gc.onecmd("bookmarks")
|
||||||
elif args.url:
|
elif args.url:
|
||||||
if len(args.url) == 1:
|
if len(args.url) == 1:
|
||||||
gc.cmdqueue.append("go %s" % args.url[0])
|
gc.onecmd("go %s" % args.url[0])
|
||||||
else:
|
else:
|
||||||
for url in args.url:
|
for url in args.url:
|
||||||
if not url.startswith("gemini://"):
|
gc.onecmd("tour %s" % url)
|
||||||
url = "gemini://" + url
|
gc.onecmd("tour")
|
||||||
gc.cmdqueue.append("tour %s" % url)
|
|
||||||
gc.cmdqueue.append("tour")
|
|
||||||
|
|
||||||
if args.disable_http:
|
if args.disable_http:
|
||||||
gc.support_http = False
|
gc.support_http = False
|
||||||
|
|
||||||
# Endless interpret loop
|
# Endless interpret loop (except while --sync or --fetch-later)
|
||||||
if args.fetch_later:
|
if args.fetch_later:
|
||||||
if args.url:
|
if args.url:
|
||||||
gc.sync_only = True
|
gc.sync_only = True
|
||||||
|
@ -3462,11 +3461,7 @@ def main():
|
||||||
|
|
||||||
gc.onecmd("blackbox")
|
gc.onecmd("blackbox")
|
||||||
else:
|
else:
|
||||||
while True:
|
gc.cmdloop()
|
||||||
try:
|
|
||||||
gc.cmdloop()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
print("")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue