lanscape 1.2.7a2__tar.gz → 1.2.8a1__tar.gz
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.
Potentially problematic release.
This version of lanscape might be problematic. Click here for more details.
- {lanscape-1.2.7a2/src/lanscape.egg-info → lanscape-1.2.8a1}/PKG-INFO +2 -3
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/README.md +1 -1
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/pyproject.toml +1 -2
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/net_tools.py +8 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/runtime_args.py +8 -5
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/tests/__init__.py +0 -2
- lanscape-1.2.8a1/src/lanscape/tests/_helpers.py +15 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/app.py +12 -6
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/main.py +10 -13
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/base.html +0 -2
- {lanscape-1.2.7a2 → lanscape-1.2.8a1/src/lanscape.egg-info}/PKG-INFO +2 -3
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape.egg-info/SOURCES.txt +0 -3
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape.egg-info/requires.txt +0 -1
- lanscape-1.2.7a2/src/lanscape/tests/_helpers.py +0 -60
- lanscape-1.2.7a2/src/lanscape/tests/test_webview.py +0 -16
- lanscape-1.2.7a2/src/lanscape/ui/static/img/readme1.png +0 -0
- lanscape-1.2.7a2/src/lanscape/ui/webviewer.py +0 -22
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/LICENSE +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/MANIFEST.in +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/setup.cfg +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/__init__.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/__main__.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/app_scope.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/decorators.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/errors.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/ip_parser.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/logger.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/mac_lookup.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/port_manager.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/subnet_scan.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/libraries/version_manager.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/resources/mac_addresses/convert_csv.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/resources/mac_addresses/mac_db.json +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/resources/ports/convert_csv.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/resources/ports/full.json +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/resources/ports/large.json +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/resources/ports/medium.json +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/resources/ports/small.json +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/tests/test_api.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/tests/test_env.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/tests/test_library.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/__init__.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/api/__init__.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/api/port.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/api/scan.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/api/tools.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/web/__init__.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/web/routes.py +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/css/style.css +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/android-chrome-192x192.png +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/android-chrome-512x512.png +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/apple-touch-icon.png +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/favicon-16x16.png +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/favicon-32x32.png +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/favicon.ico +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/site.webmanifest +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/core.js +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/layout-sizing.js +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/main.js +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/quietReload.js +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/shutdown-server.js +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/subnet-info.js +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/subnet-selector.js +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/lanscape.webmanifest +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/core/head.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/core/scripts.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/error.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/info.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/main.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/export.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/ip-table-row.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/ip-table.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/overview.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/scan-error.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/templates/shutdown.html +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape.egg-info/dependency_links.txt +0 -0
- {lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lanscape
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.8a1
|
|
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
|
|
@@ -15,7 +15,6 @@ Requires-Dist: Flask<5.0,>=3.0
|
|
|
15
15
|
Requires-Dist: psutil<7.0,>=6.0
|
|
16
16
|
Requires-Dist: requests<3.0,>=2.32
|
|
17
17
|
Requires-Dist: setuptools
|
|
18
|
-
Requires-Dist: pywebview<6.0,>=4.2
|
|
19
18
|
Requires-Dist: scapy<3.0,>=2.3.2
|
|
20
19
|
Requires-Dist: tabulate==0.9.0
|
|
21
20
|
Requires-Dist: pytest
|
|
@@ -23,7 +22,7 @@ Requires-Dist: pytest
|
|
|
23
22
|
# LANscape
|
|
24
23
|
A python based local network scanner.
|
|
25
24
|
|
|
26
|
-

|
|
27
26
|
|
|
28
27
|
## Local Run
|
|
29
28
|
```sh
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# LANscape
|
|
2
2
|
A python based local network scanner.
|
|
3
3
|
|
|
4
|
-

|
|
5
5
|
|
|
6
6
|
## Local Run
|
|
7
7
|
```sh
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "lanscape"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.8a1"
|
|
4
4
|
authors = [
|
|
5
5
|
{ name="Michael Dennis", email="michael@dipduo.com" },
|
|
6
6
|
]
|
|
@@ -17,7 +17,6 @@ dependencies = [
|
|
|
17
17
|
"psutil>=6.0,<7.0",
|
|
18
18
|
"requests>=2.32,<3.0",
|
|
19
19
|
"setuptools",
|
|
20
|
-
"pywebview>=4.2,<6.0",
|
|
21
20
|
"scapy>=2.3.2,<3.0",
|
|
22
21
|
"tabulate==0.9.0",
|
|
23
22
|
"pytest"
|
|
@@ -131,6 +131,14 @@ class Device(IPAlive):
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
class MacSelector:
|
|
134
|
+
"""
|
|
135
|
+
Essentially filters out bad mac addresses
|
|
136
|
+
you send in a list of macs,
|
|
137
|
+
it will return the one that has been seen the least
|
|
138
|
+
(ideally meaning it is the most likely to be the correct one)
|
|
139
|
+
this was added because some lookups return multiple macs,
|
|
140
|
+
usually the hwid of a vpn tunnel etc
|
|
141
|
+
"""
|
|
134
142
|
def __init__(self):
|
|
135
143
|
self.macs = {}
|
|
136
144
|
|
|
@@ -7,20 +7,16 @@ from typing import Any, Dict
|
|
|
7
7
|
class RuntimeArgs:
|
|
8
8
|
reloader: bool = False
|
|
9
9
|
port: int = 5001
|
|
10
|
-
nogui: bool = False
|
|
11
10
|
logfile: bool = False
|
|
12
11
|
loglevel: str = 'INFO'
|
|
13
|
-
headless: bool = False
|
|
14
12
|
|
|
15
13
|
def parse_args() -> RuntimeArgs:
|
|
16
14
|
parser = argparse.ArgumentParser(description='LANscape')
|
|
17
15
|
|
|
18
16
|
parser.add_argument('--reloader', action='store_true', help='Use flask\'s reloader (helpful for local development)')
|
|
19
17
|
parser.add_argument('--port', type=int, default=5001, help='Port to run the webserver on')
|
|
20
|
-
parser.add_argument('--nogui', action='store_true', help='Run in standalone mode')
|
|
21
18
|
parser.add_argument('--logfile', action='store_true', help='Log output to lanscape.log')
|
|
22
|
-
parser.add_argument('--loglevel', default='INFO',
|
|
23
|
-
parser.add_argument('--headless', action="store_true",help="Similar to nogui, but doesnt try to open a browser. Good for running in a container.")
|
|
19
|
+
parser.add_argument('--loglevel', default='INFO', help='Set the log level')
|
|
24
20
|
|
|
25
21
|
# Parse the arguments
|
|
26
22
|
args = parser.parse_args()
|
|
@@ -33,5 +29,12 @@ def parse_args() -> RuntimeArgs:
|
|
|
33
29
|
# Only pass arguments that exist in the Args dataclass
|
|
34
30
|
filtered_args = {name: args_dict[name] for name in field_names if name in args_dict}
|
|
35
31
|
|
|
32
|
+
# Deal with loglevel formatting
|
|
33
|
+
filtered_args['loglevel'] = filtered_args['loglevel'].upper()
|
|
34
|
+
|
|
35
|
+
valid_levels = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
|
|
36
|
+
if filtered_args['loglevel'] not in valid_levels:
|
|
37
|
+
raise ValueError(f"Invalid log level: {filtered_args['loglevel']}. Must be one of: {valid_levels}")
|
|
38
|
+
|
|
36
39
|
# Return the dataclass instance with the dynamically assigned values
|
|
37
40
|
return RuntimeArgs(**filtered_args)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
from ..libraries.ip_parser import get_address_count
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def right_size_subnet(subnet: str):
|
|
6
|
+
"""
|
|
7
|
+
Used to improve speed of test time
|
|
8
|
+
"""
|
|
9
|
+
if get_address_count(subnet) > 500:
|
|
10
|
+
parts = subnet.split('/')
|
|
11
|
+
ip = parts[0]
|
|
12
|
+
mask = int(parts[1])
|
|
13
|
+
mask += 1
|
|
14
|
+
return right_size_subnet(f"{ip}/{mask}")
|
|
15
|
+
return subnet
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from flask import Flask, render_template
|
|
2
|
+
from time import sleep
|
|
2
3
|
import multiprocessing
|
|
3
4
|
import traceback
|
|
4
5
|
import threading
|
|
@@ -92,15 +93,20 @@ def start_webserver_dameon(args: RuntimeArgs) -> multiprocessing.Process:
|
|
|
92
93
|
proc = threading.Thread(target=start_webserver, args=(args,))
|
|
93
94
|
proc.daemon = True # Kill thread when main thread exits
|
|
94
95
|
proc.start()
|
|
96
|
+
log.info('Flask server initializing as dameon')
|
|
97
|
+
sleep(2)
|
|
95
98
|
|
|
96
99
|
def start_webserver(args: RuntimeArgs) -> int:
|
|
97
|
-
|
|
98
|
-
host
|
|
99
|
-
port
|
|
100
|
-
debug
|
|
101
|
-
use_reloader
|
|
102
|
-
|
|
100
|
+
run_args = {
|
|
101
|
+
'host':'0.0.0.0',
|
|
102
|
+
'port':args.port,
|
|
103
|
+
'debug':args.reloader,
|
|
104
|
+
'use_reloader':args.reloader
|
|
105
|
+
}
|
|
103
106
|
|
|
107
|
+
app.run(**run_args)
|
|
108
|
+
|
|
109
|
+
|
|
104
110
|
|
|
105
111
|
if __name__ == "__main__":
|
|
106
112
|
start_webserver(True)
|
|
@@ -12,7 +12,6 @@ args = parse_args()
|
|
|
12
12
|
configure_logging(args.loglevel, args.logfile)
|
|
13
13
|
|
|
14
14
|
from ..libraries.version_manager import get_installed_version, is_update_available
|
|
15
|
-
from .webviewer import start_webview
|
|
16
15
|
from .app import start_webserver
|
|
17
16
|
|
|
18
17
|
|
|
@@ -33,18 +32,15 @@ def main():
|
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
try:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
args
|
|
41
|
-
)
|
|
35
|
+
|
|
36
|
+
no_gui(args)
|
|
37
|
+
|
|
38
|
+
log.info('Exiting...')
|
|
42
39
|
except Exception:
|
|
43
40
|
# showing error in debug only because this is handled gracefully
|
|
44
|
-
log.debug('Failed to start
|
|
41
|
+
log.debug('Failed to start. Traceback below')
|
|
45
42
|
log.debug(traceback.format_exc())
|
|
46
|
-
|
|
47
|
-
log.error('Unable to start webview client. Try running with flag --nogui')
|
|
43
|
+
|
|
48
44
|
|
|
49
45
|
|
|
50
46
|
def try_check_update():
|
|
@@ -76,10 +72,11 @@ def open_browser(url: str,wait=2):
|
|
|
76
72
|
def no_gui(args: RuntimeArgs):
|
|
77
73
|
# determine if it was reloaded by flask debug reloader
|
|
78
74
|
# if it was, dont open the browser again
|
|
79
|
-
if not IS_FLASK_RELOAD
|
|
75
|
+
if not IS_FLASK_RELOAD:
|
|
80
76
|
open_browser(f'http://127.0.0.1:{args.port}')
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
|
|
78
|
+
log.info(f'Server started: http://127.0.0.1:{args.port}')
|
|
79
|
+
|
|
83
80
|
start_webserver(
|
|
84
81
|
args
|
|
85
82
|
)
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
</span>
|
|
29
29
|
</a>
|
|
30
30
|
|
|
31
|
-
{% if runtime_args.get('nogui') or runtime_args.get('headless') %}
|
|
32
31
|
<a href="/shutdown-ui">
|
|
33
32
|
<span
|
|
34
33
|
id="power-button"
|
|
@@ -39,7 +38,6 @@
|
|
|
39
38
|
power_settings_new
|
|
40
39
|
</span>
|
|
41
40
|
</a>
|
|
42
|
-
{% endif %}
|
|
43
41
|
</div>
|
|
44
42
|
|
|
45
43
|
</footer>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lanscape
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.8a1
|
|
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
|
|
@@ -15,7 +15,6 @@ Requires-Dist: Flask<5.0,>=3.0
|
|
|
15
15
|
Requires-Dist: psutil<7.0,>=6.0
|
|
16
16
|
Requires-Dist: requests<3.0,>=2.32
|
|
17
17
|
Requires-Dist: setuptools
|
|
18
|
-
Requires-Dist: pywebview<6.0,>=4.2
|
|
19
18
|
Requires-Dist: scapy<3.0,>=2.3.2
|
|
20
19
|
Requires-Dist: tabulate==0.9.0
|
|
21
20
|
Requires-Dist: pytest
|
|
@@ -23,7 +22,7 @@ Requires-Dist: pytest
|
|
|
23
22
|
# LANscape
|
|
24
23
|
A python based local network scanner.
|
|
25
24
|
|
|
26
|
-

|
|
27
26
|
|
|
28
27
|
## Local Run
|
|
29
28
|
```sh
|
|
@@ -32,10 +32,8 @@ src/lanscape/tests/_helpers.py
|
|
|
32
32
|
src/lanscape/tests/test_api.py
|
|
33
33
|
src/lanscape/tests/test_env.py
|
|
34
34
|
src/lanscape/tests/test_library.py
|
|
35
|
-
src/lanscape/tests/test_webview.py
|
|
36
35
|
src/lanscape/ui/app.py
|
|
37
36
|
src/lanscape/ui/main.py
|
|
38
|
-
src/lanscape/ui/webviewer.py
|
|
39
37
|
src/lanscape/ui/blueprints/__init__.py
|
|
40
38
|
src/lanscape/ui/blueprints/api/__init__.py
|
|
41
39
|
src/lanscape/ui/blueprints/api/port.py
|
|
@@ -45,7 +43,6 @@ src/lanscape/ui/blueprints/web/__init__.py
|
|
|
45
43
|
src/lanscape/ui/blueprints/web/routes.py
|
|
46
44
|
src/lanscape/ui/static/lanscape.webmanifest
|
|
47
45
|
src/lanscape/ui/static/css/style.css
|
|
48
|
-
src/lanscape/ui/static/img/readme1.png
|
|
49
46
|
src/lanscape/ui/static/img/ico/android-chrome-192x192.png
|
|
50
47
|
src/lanscape/ui/static/img/ico/android-chrome-512x512.png
|
|
51
48
|
src/lanscape/ui/static/img/ico/apple-touch-icon.png
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from ..libraries.ip_parser import get_address_count
|
|
3
|
-
import webview, time
|
|
4
|
-
|
|
5
|
-
import warnings
|
|
6
|
-
|
|
7
|
-
from concurrent.futures import ThreadPoolExecutor, Future
|
|
8
|
-
def right_size_subnet(subnet: str):
|
|
9
|
-
"""
|
|
10
|
-
Used to improve speed of test time
|
|
11
|
-
"""
|
|
12
|
-
if get_address_count(subnet) > 500:
|
|
13
|
-
parts = subnet.split('/')
|
|
14
|
-
ip = parts[0]
|
|
15
|
-
mask = int(parts[1])
|
|
16
|
-
mask += 1
|
|
17
|
-
return right_size_subnet(f"{ip}/{mask}")
|
|
18
|
-
return subnet
|
|
19
|
-
|
|
20
|
-
def webview_client(title, url):
|
|
21
|
-
def decorator(func):
|
|
22
|
-
def wrapper(*args, **kwargs):
|
|
23
|
-
baseclass = args[0]
|
|
24
|
-
|
|
25
|
-
window = webview.create_window(title, url)
|
|
26
|
-
|
|
27
|
-
# Create a Future object to communicate results/exceptions
|
|
28
|
-
future = Future()
|
|
29
|
-
|
|
30
|
-
# Define the function to run in the secondary thread
|
|
31
|
-
def test_function():
|
|
32
|
-
# disable resource warning occuring in py >=3.13
|
|
33
|
-
warnings.filterwarnings("ignore", category=ResourceWarning)
|
|
34
|
-
|
|
35
|
-
try:
|
|
36
|
-
# Call the decorated function
|
|
37
|
-
func(baseclass, window, **kwargs)
|
|
38
|
-
future.set_result("Completed Successfully")
|
|
39
|
-
except Exception as e:
|
|
40
|
-
# Set the exception in the Future
|
|
41
|
-
future.set_exception(e)
|
|
42
|
-
finally:
|
|
43
|
-
# Close the WebView window
|
|
44
|
-
if window is not None:
|
|
45
|
-
window.destroy()
|
|
46
|
-
|
|
47
|
-
# Define a function to start the thread
|
|
48
|
-
def start_test_function():
|
|
49
|
-
# Run the function in a secondary thread
|
|
50
|
-
with ThreadPoolExecutor() as executor:
|
|
51
|
-
executor.submit(test_function)
|
|
52
|
-
|
|
53
|
-
# Start the WebView and execute the thread alongside it
|
|
54
|
-
webview.start(start_test_function)
|
|
55
|
-
|
|
56
|
-
# Retrieve the result or exception from the Future
|
|
57
|
-
future.result()
|
|
58
|
-
|
|
59
|
-
return wrapper
|
|
60
|
-
return decorator
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import webview
|
|
2
|
-
from ._helpers import webview_client
|
|
3
|
-
import unittest
|
|
4
|
-
from time import sleep
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class WebViewTestCase(unittest.TestCase):
|
|
9
|
-
|
|
10
|
-
@webview_client('Test Window','https://google.com')
|
|
11
|
-
def test_webview_launch(self, client: webview.Window):
|
|
12
|
-
# This test checks that the window has been created successfully
|
|
13
|
-
sleep(2)
|
|
14
|
-
self.assertIsNotNone(client,msg="WebView window failed to create.")
|
|
15
|
-
self.assertEqual(client.title,'Test Window',msg='WebView window title did not match.')
|
|
16
|
-
self.assertIn('google.com',client.real_url,msg=f'URL mismatch')
|
|
Binary file
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import webview
|
|
2
|
-
from .app import start_webserver_dameon
|
|
3
|
-
from ..libraries.runtime_args import RuntimeArgs
|
|
4
|
-
from time import sleep
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def start_webview(args: RuntimeArgs) -> None:
|
|
9
|
-
# Start Flask server in a separate thread
|
|
10
|
-
start_webserver_dameon(args)
|
|
11
|
-
|
|
12
|
-
# Start the Pywebview window
|
|
13
|
-
webview.create_window('LANscape', f'http://127.0.0.1:{args.port}')
|
|
14
|
-
sleep(1)
|
|
15
|
-
webview.start()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if __name__ == "__main__":
|
|
20
|
-
# Start Flask server in a separate thread
|
|
21
|
-
start_webview(True)
|
|
22
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/android-chrome-192x192.png
RENAMED
|
File without changes
|
{lanscape-1.2.7a2 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/android-chrome-512x512.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|