lanscape 1.2.8a2__py3-none-any.whl → 1.2.8a3__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/app.py +0 -2
- lanscape/ui/main.py +16 -5
- lanscape/ui/templates/base.html +1 -1
- {lanscape-1.2.8a2.dist-info → lanscape-1.2.8a3.dist-info}/METADATA +2 -4
- {lanscape-1.2.8a2.dist-info → lanscape-1.2.8a3.dist-info}/RECORD +8 -8
- {lanscape-1.2.8a2.dist-info → lanscape-1.2.8a3.dist-info}/LICENSE +0 -0
- {lanscape-1.2.8a2.dist-info → lanscape-1.2.8a3.dist-info}/WHEEL +0 -0
- {lanscape-1.2.8a2.dist-info → lanscape-1.2.8a3.dist-info}/top_level.txt +0 -0
lanscape/ui/app.py
CHANGED
lanscape/ui/main.py
CHANGED
|
@@ -13,6 +13,7 @@ configure_logging(args.loglevel, args.logfile)
|
|
|
13
13
|
|
|
14
14
|
from ..libraries.version_manager import get_installed_version, is_update_available
|
|
15
15
|
from .app import start_webserver
|
|
16
|
+
import socket
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
log = logging.getLogger('core')
|
|
@@ -27,9 +28,12 @@ def main():
|
|
|
27
28
|
if not IS_FLASK_RELOAD:
|
|
28
29
|
log.info(f'LANscape v{get_installed_version()}')
|
|
29
30
|
try_check_update()
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
else:
|
|
31
33
|
log.info('Flask reloaded app.')
|
|
32
34
|
|
|
35
|
+
args.port = get_valid_port(args.port)
|
|
36
|
+
|
|
33
37
|
|
|
34
38
|
try:
|
|
35
39
|
|
|
@@ -63,9 +67,8 @@ def open_browser(url: str,wait=2):
|
|
|
63
67
|
time.sleep(wait)
|
|
64
68
|
webbrowser.open(url, new=2)
|
|
65
69
|
except:
|
|
66
|
-
srv_url = f"0.0.0.0:{url.split(':')[1]}"
|
|
67
70
|
log.debug(traceback.format_exc())
|
|
68
|
-
log.info(f'
|
|
71
|
+
log.info(f'Unable to open web browser, server running on {url}')
|
|
69
72
|
|
|
70
73
|
threading.Thread(target=do_open).start()
|
|
71
74
|
|
|
@@ -74,13 +77,21 @@ def no_gui(args: RuntimeArgs):
|
|
|
74
77
|
# if it was, dont open the browser again
|
|
75
78
|
if not IS_FLASK_RELOAD:
|
|
76
79
|
open_browser(f'http://127.0.0.1:{args.port}')
|
|
77
|
-
|
|
78
|
-
log.info(f'Server started: http://127.0.0.1:{args.port}')
|
|
80
|
+
log.info(f'Flask started: http://127.0.0.1:{args.port}')
|
|
79
81
|
|
|
80
82
|
start_webserver(
|
|
81
83
|
args
|
|
82
84
|
)
|
|
83
85
|
|
|
86
|
+
def get_valid_port(port: int):
|
|
87
|
+
"""
|
|
88
|
+
Get the first available port starting from the specified port
|
|
89
|
+
"""
|
|
90
|
+
while True:
|
|
91
|
+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
92
|
+
if s.connect_ex(('localhost', port)) != 0:
|
|
93
|
+
return port
|
|
94
|
+
port += 1
|
|
84
95
|
|
|
85
96
|
if __name__ == "__main__":
|
|
86
97
|
main()
|
lanscape/ui/templates/base.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lanscape
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.8a3
|
|
4
4
|
Summary: A python based local network scanner
|
|
5
5
|
Author-email: Michael Dennis <michael@dipduo.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/mdennis281/py-lanscape
|
|
@@ -32,17 +32,15 @@ python -m lanscape
|
|
|
32
32
|
|
|
33
33
|
## Flags
|
|
34
34
|
- `--port <port number>` port of the flask app (default: 5001)
|
|
35
|
-
- `--nogui` run in web mode (default: false)
|
|
36
35
|
- `--reloader` essentially flask debug mode- good for local development (default: false)
|
|
37
36
|
- `--logfile` save log output to lanscape.log
|
|
38
37
|
- `--loglevel <level>` set the logger's log level (default: INFO)
|
|
39
|
-
- `--headless` similar to nogui but doesnt try to open a browser (default: false)
|
|
40
38
|
|
|
41
39
|
|
|
42
40
|
Examples:
|
|
43
41
|
```shell
|
|
44
42
|
python -m lanscape --reloader
|
|
45
|
-
python -m lanscape --
|
|
43
|
+
python -m lanscape --port 5002
|
|
46
44
|
python -m lanscape --logfile --loglevel DEBUG
|
|
47
45
|
```
|
|
48
46
|
|
|
@@ -23,8 +23,8 @@ lanscape/tests/_helpers.py,sha256=wXJfUwzL3Fq4XBsC3dValCbXsf0U8FisuM_yo1de4QQ,37
|
|
|
23
23
|
lanscape/tests/test_api.py,sha256=fIVIA6O9ssPRjofTHLS6z7XPNTkvv2rl2jDaxVCjFGU,5669
|
|
24
24
|
lanscape/tests/test_env.py,sha256=ivFhCcemJ9vbe0_KtUkbqDY4r9nsDB8rVLUVjV-sNj8,673
|
|
25
25
|
lanscape/tests/test_library.py,sha256=u-UBx76Dyh2xLhiCNxnzv7lIsWoUGKUtbPqkVUg7xwE,1552
|
|
26
|
-
lanscape/ui/app.py,sha256=
|
|
27
|
-
lanscape/ui/main.py,sha256=
|
|
26
|
+
lanscape/ui/app.py,sha256=hGmzoyH4YW2WmQsqZ6v-9r5DYzWi2KYP6_toZSxQqFg,3186
|
|
27
|
+
lanscape/ui/main.py,sha256=HMQythH0fijX1Mt9fGQBcqmY37dQQ19ROC99JbCNAvs,2701
|
|
28
28
|
lanscape/ui/blueprints/__init__.py,sha256=agvgPOSVbrxddaw6EY64ZZr1CQi1Qzwcs1t0lZMv5oY,206
|
|
29
29
|
lanscape/ui/blueprints/api/__init__.py,sha256=t0QOq3vHFWmlZm_3YFPQbQzCn1a_a5cmRchtIxwy4eY,103
|
|
30
30
|
lanscape/ui/blueprints/api/port.py,sha256=2UA38umzXE8pMitx1E-_wJHyL1dYYbtM6Kg5zVtfj6A,1019
|
|
@@ -48,7 +48,7 @@ lanscape/ui/static/js/quietReload.js,sha256=_mHzpUsGL4Lm1hNsr3VYSOGVcgGA2y1-eZHa
|
|
|
48
48
|
lanscape/ui/static/js/shutdown-server.js,sha256=WkO7_SNSHM_6kReUoCoExIdCf7Sl7IPiSiNxpbI-r0s,469
|
|
49
49
|
lanscape/ui/static/js/subnet-info.js,sha256=aytt0LkBx4FVq36TxiMEw3aM7XQLHg_ng1U2WDwZVF4,577
|
|
50
50
|
lanscape/ui/static/js/subnet-selector.js,sha256=OG01pDaSOPLq3Ial0aO0CqPcob9tPZA1MZKGmQG0W7Q,366
|
|
51
|
-
lanscape/ui/templates/base.html,sha256=
|
|
51
|
+
lanscape/ui/templates/base.html,sha256=P5xnMlvDXYkYSXdSZUWaRfhsszNuZPP7A56hemBrAFs,1498
|
|
52
52
|
lanscape/ui/templates/error.html,sha256=zXFO0zPIfQORWq1ZMiSZ8G7FjfhVVr-aaYC0HeBl4Rs,1068
|
|
53
53
|
lanscape/ui/templates/info.html,sha256=oCC59keGEfgUB4WaCozaeZEfNb8Nr7y61DmkRBMqs18,2461
|
|
54
54
|
lanscape/ui/templates/main.html,sha256=M12xJSN6Ga565vIPhdCiqcr1tYgDrqzuQTeuXtk-8yo,3759
|
|
@@ -61,8 +61,8 @@ lanscape/ui/templates/scan/ip-table-row.html,sha256=ptY24rxJRaA4PEEQRDncaq6Q0ql5
|
|
|
61
61
|
lanscape/ui/templates/scan/ip-table.html,sha256=ds__UP9JiTKf5IxCmTMzw--eN_yg1Pvn3Nj1KvQxeZg,940
|
|
62
62
|
lanscape/ui/templates/scan/overview.html,sha256=Q0gmkVI-xNLZ-zWA9qm4H14cv_eF_bQs1KYPyAaoHLY,1141
|
|
63
63
|
lanscape/ui/templates/scan/scan-error.html,sha256=Q4eZM5ThrxnFaWOSTUpK8hA2ksHwhxOBTaVUCLALhyA,1032
|
|
64
|
-
lanscape-1.2.
|
|
65
|
-
lanscape-1.2.
|
|
66
|
-
lanscape-1.2.
|
|
67
|
-
lanscape-1.2.
|
|
68
|
-
lanscape-1.2.
|
|
64
|
+
lanscape-1.2.8a3.dist-info/LICENSE,sha256=cCO-NbS01Ilwc6djHjZ7LIgPFRkRmWdr0fH2ysXKioA,1090
|
|
65
|
+
lanscape-1.2.8a3.dist-info/METADATA,sha256=-Zu4Dm6pAjzV5VAZhdQvOSBVUBUzXu2vOZj5-w5TlLQ,2444
|
|
66
|
+
lanscape-1.2.8a3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
67
|
+
lanscape-1.2.8a3.dist-info/top_level.txt,sha256=E9D4sjPz_6H7c85Ycy_pOS2xuv1Wm-ilKhxEprln2ps,9
|
|
68
|
+
lanscape-1.2.8a3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|