MCPcopy Create free account
hub / github.com/cztomczak/cefpython / command_line_arguments

Function command_line_arguments

examples/screenshot.py:105–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103
104
105def command_line_arguments():
106 if len(sys.argv) == 4:
107 url = sys.argv[1]
108 width = int(sys.argv[2])
109 height = int(sys.argv[3])
110 if url.startswith("http://") or url.startswith("https://"):
111 global URL
112 URL = url
113 else:
114 print("[screenshot.py] Error: Invalid url argument")
115 sys.exit(1)
116 if width > 0 and height > 0:
117 global VIEWPORT_SIZE
118 VIEWPORT_SIZE = (width, height)
119 else:
120 print("[screenshot.py] Error: Invalid width and height")
121 sys.exit(1)
122
123 elif len(sys.argv) > 1:
124 print("[screenshot.py] Error: Expected arguments: url width height")
125 sys.exit(1)
126
127
128def create_browser(settings):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected