run.py 574 B

123456789101112131415161718192021
  1. from .gui_parser import gui_parser
  2. from ..cookies import read_cookie_files
  3. import g4f.cookies
  4. import g4f.debug
  5. def run_gui_args(args):
  6. if args.debug:
  7. g4f.debug.logging = True
  8. if not args.ignore_cookie_files:
  9. read_cookie_files()
  10. from g4f.gui import run_gui
  11. host = args.host
  12. port = args.port
  13. debug = args.debug
  14. g4f.cookies.browsers = [g4f.cookies[browser] for browser in args.cookie_browsers]
  15. run_gui(host, port, debug)
  16. if __name__ == "__main__":
  17. parser = gui_parser()
  18. args = parser.parse_args()
  19. run_gui_args(args)