lanscape 2.1.2__py3-none-any.whl → 2.2.0a2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
lanscape/ui/main.py CHANGED
@@ -8,6 +8,9 @@ import logging
8
8
  import traceback
9
9
  import os
10
10
  import requests
11
+ from subprocess import Popen
12
+
13
+ from pwa_launcher import open_pwa
11
14
 
12
15
  from lanscape.core.logger import configure_logging
13
16
  from lanscape.core.runtime_args import parse_args
@@ -70,7 +73,7 @@ def try_check_update():
70
73
  log.warning('Unable to check for updates.')
71
74
 
72
75
 
73
- def open_browser(url: str, wait=2) -> bool:
76
+ def open_browser(url: str, wait=2) -> Popen:
74
77
  """
75
78
  Open a browser window to the specified
76
79
  url after waiting for the server to start
@@ -78,12 +81,12 @@ def open_browser(url: str, wait=2) -> bool:
78
81
  try:
79
82
  time.sleep(wait)
80
83
  log.info(f'Starting UI - http://127.0.0.1:{args.port}')
81
- return open_webapp(url)
84
+ return open_pwa(url)
82
85
 
83
86
  except BaseException:
84
87
  log.debug(traceback.format_exc())
85
88
  log.info(f'Unable to open web browser, server running on {url}')
86
- return False
89
+ return None
87
90
 
88
91
 
89
92
  def start_webserver_ui():
@@ -97,19 +100,17 @@ def start_webserver_ui():
97
100
  # if it was, dont open the browser again
98
101
  log.info('Opening UI as daemon')
99
102
  if not IS_FLASK_RELOAD:
100
- threading.Thread(
101
- target=open_browser,
102
- args=(uri,),
103
- daemon=True
104
- ).start()
103
+ open_browser(uri)
105
104
  start_webserver(args)
106
105
  else:
107
106
  flask_thread = start_webserver_daemon(args)
108
- app_closed = open_browser(uri)
107
+ proc = open_browser(uri)
108
+
109
+ if proc:
110
+ app_closed = proc.wait()
111
+ else:
112
+ app_closed = False
109
113
 
110
- # depending on env, open_browser may or
111
- # may not be coupled with the closure of UI
112
- # (if in browser tab, it's uncoupled)
113
114
  if not app_closed or args.persistent:
114
115
  # not doing a direct join so i can still
115
116
  # terminate the app with ctrl+c
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lanscape
3
- Version: 2.1.2
3
+ Version: 2.2.0a2
4
4
  Summary: A python based local network scanner
5
5
  Author-email: Michael Dennis <michael@dipduo.com>
6
6
  License-Expression: MIT
@@ -25,6 +25,7 @@ Requires-Dist: scapy<3.0,>=2.3.2
25
25
  Requires-Dist: tabulate==0.9.0
26
26
  Requires-Dist: pydantic
27
27
  Requires-Dist: icmplib
28
+ Requires-Dist: pwa-launcher>=0.3.0
28
29
  Provides-Extra: dev
29
30
  Requires-Dist: pytest>=8.0; extra == "dev"
30
31
  Requires-Dist: pytest-cov>=5.0; extra == "dev"
@@ -27,7 +27,7 @@ lanscape/resources/ports/test_port_list_scan.json,sha256=qXuWGQ_sGIRCVrhJxMeWcHK
27
27
  lanscape/resources/services/definitions.jsonc,sha256=M9BDeK-mh25sEVj8xDEYbU2ix7EETVWhbiYmMb14Gjg,20905
28
28
  lanscape/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  lanscape/ui/app.py,sha256=rg4UGHgbVHpU2jdabSwBoSqGna7WGOunPkPc5Tvds9w,4076
30
- lanscape/ui/main.py,sha256=UCrhHnyFBqVmHTMus33CTp3vdNn3miT1xXJatR4N7ho,4176
30
+ lanscape/ui/main.py,sha256=AthtTJDoxWBMxMysdG569E_mIsY5B8KkYy2RlyNdc-4,4077
31
31
  lanscape/ui/shutdown_handler.py,sha256=HrEnWrdYSzLDVsPgD8tf9FgtAwQrZNECDu6wnEs27EY,1704
32
32
  lanscape/ui/blueprints/__init__.py,sha256=EjPtaR5Nh17pGiOVYTJULVNaZntpFZOiYyep8rBWAiE,265
33
33
  lanscape/ui/blueprints/api/__init__.py,sha256=5Z4Y7B36O-bNFenpomfuNhPuJ9dW_MC0TPUU3pCFVfA,103
@@ -69,9 +69,9 @@ lanscape/ui/templates/scan/ip-table-row.html,sha256=iSW3PYev3_k7pxTZUJUboqDUgdhs
69
69
  lanscape/ui/templates/scan/ip-table.html,sha256=AT2ZvCPYdKl-XJiAkEAawPOVuQw-w0MXumGQTr3zyKM,926
70
70
  lanscape/ui/templates/scan/overview.html,sha256=xWj9jWDPg2KcPLvS8fnSins23_UXjKCdb2NJwNG2U2Q,1176
71
71
  lanscape/ui/templates/scan/scan-error.html,sha256=wmAYQ13IJHUoO8fAGNDjMvNml7tu4rsIU3Vav71ETlA,999
72
- lanscape-2.1.2.dist-info/licenses/LICENSE,sha256=VLoE0IrNTIc09dFm7hMN0qzk4T3q8V0NaPcFQqMemDs,1070
73
- lanscape-2.1.2.dist-info/METADATA,sha256=oxHxoHbAYnhTnSIgsMyzzgqevSrWmF5Fzti1bqjLAao,3578
74
- lanscape-2.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
- lanscape-2.1.2.dist-info/entry_points.txt,sha256=evxSxUikFa1OEd4e0Boky9sLH87HdgM0YqB_AbB2HYc,51
76
- lanscape-2.1.2.dist-info/top_level.txt,sha256=E9D4sjPz_6H7c85Ycy_pOS2xuv1Wm-ilKhxEprln2ps,9
77
- lanscape-2.1.2.dist-info/RECORD,,
72
+ lanscape-2.2.0a2.dist-info/licenses/LICENSE,sha256=VLoE0IrNTIc09dFm7hMN0qzk4T3q8V0NaPcFQqMemDs,1070
73
+ lanscape-2.2.0a2.dist-info/METADATA,sha256=uX-ooreN2kgR0A6c9sFb31u1dxYsw7v0SrfjBVs8-To,3615
74
+ lanscape-2.2.0a2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
+ lanscape-2.2.0a2.dist-info/entry_points.txt,sha256=evxSxUikFa1OEd4e0Boky9sLH87HdgM0YqB_AbB2HYc,51
76
+ lanscape-2.2.0a2.dist-info/top_level.txt,sha256=E9D4sjPz_6H7c85Ycy_pOS2xuv1Wm-ilKhxEprln2ps,9
77
+ lanscape-2.2.0a2.dist-info/RECORD,,