lanscape 1.2.7a3__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.

Files changed (78) hide show
  1. {lanscape-1.2.7a3/src/lanscape.egg-info → lanscape-1.2.8a1}/PKG-INFO +1 -2
  2. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/pyproject.toml +1 -2
  3. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/runtime_args.py +8 -5
  4. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/tests/__init__.py +0 -2
  5. lanscape-1.2.8a1/src/lanscape/tests/_helpers.py +15 -0
  6. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/app.py +9 -6
  7. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/main.py +9 -13
  8. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/base.html +0 -2
  9. {lanscape-1.2.7a3 → lanscape-1.2.8a1/src/lanscape.egg-info}/PKG-INFO +1 -2
  10. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape.egg-info/SOURCES.txt +0 -3
  11. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape.egg-info/requires.txt +0 -1
  12. lanscape-1.2.7a3/src/lanscape/tests/_helpers.py +0 -60
  13. lanscape-1.2.7a3/src/lanscape/tests/test_webview.py +0 -16
  14. lanscape-1.2.7a3/src/lanscape/ui/static/img/readme1.png +0 -0
  15. lanscape-1.2.7a3/src/lanscape/ui/webviewer.py +0 -20
  16. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/LICENSE +0 -0
  17. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/MANIFEST.in +0 -0
  18. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/README.md +0 -0
  19. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/setup.cfg +0 -0
  20. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/__init__.py +0 -0
  21. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/__main__.py +0 -0
  22. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/app_scope.py +0 -0
  23. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/decorators.py +0 -0
  24. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/errors.py +0 -0
  25. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/ip_parser.py +0 -0
  26. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/logger.py +0 -0
  27. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/mac_lookup.py +0 -0
  28. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/net_tools.py +0 -0
  29. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/port_manager.py +0 -0
  30. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/subnet_scan.py +0 -0
  31. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/libraries/version_manager.py +0 -0
  32. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/resources/mac_addresses/convert_csv.py +0 -0
  33. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/resources/mac_addresses/mac_db.json +0 -0
  34. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/resources/ports/convert_csv.py +0 -0
  35. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/resources/ports/full.json +0 -0
  36. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/resources/ports/large.json +0 -0
  37. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/resources/ports/medium.json +0 -0
  38. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/resources/ports/small.json +0 -0
  39. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/tests/test_api.py +0 -0
  40. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/tests/test_env.py +0 -0
  41. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/tests/test_library.py +0 -0
  42. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/__init__.py +0 -0
  43. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/api/__init__.py +0 -0
  44. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/api/port.py +0 -0
  45. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/api/scan.py +0 -0
  46. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/api/tools.py +0 -0
  47. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/web/__init__.py +0 -0
  48. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/blueprints/web/routes.py +0 -0
  49. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/css/style.css +0 -0
  50. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/android-chrome-192x192.png +0 -0
  51. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/android-chrome-512x512.png +0 -0
  52. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/apple-touch-icon.png +0 -0
  53. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/favicon-16x16.png +0 -0
  54. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/favicon-32x32.png +0 -0
  55. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/favicon.ico +0 -0
  56. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/img/ico/site.webmanifest +0 -0
  57. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/core.js +0 -0
  58. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/layout-sizing.js +0 -0
  59. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/main.js +0 -0
  60. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/quietReload.js +0 -0
  61. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/shutdown-server.js +0 -0
  62. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/subnet-info.js +0 -0
  63. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/js/subnet-selector.js +0 -0
  64. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/static/lanscape.webmanifest +0 -0
  65. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/core/head.html +0 -0
  66. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/core/scripts.html +0 -0
  67. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/error.html +0 -0
  68. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/info.html +0 -0
  69. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/main.html +0 -0
  70. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/export.html +0 -0
  71. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/ip-table-row.html +0 -0
  72. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/ip-table.html +0 -0
  73. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/overview.html +0 -0
  74. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan/scan-error.html +0 -0
  75. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/scan.html +0 -0
  76. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape/ui/templates/shutdown.html +0 -0
  77. {lanscape-1.2.7a3 → lanscape-1.2.8a1}/src/lanscape.egg-info/dependency_links.txt +0 -0
  78. {lanscape-1.2.7a3 → 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.7a3
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lanscape"
3
- version = "1.2.7a3"
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"
@@ -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', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help='Set the log level')
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)
@@ -1,5 +1,3 @@
1
1
  from .test_api import ApiTestCase
2
2
  from .test_env import EnvTestCase
3
3
  from .test_library import LibraryTestCase
4
- from .test_webview import WebViewTestCase
5
-
@@ -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
@@ -97,13 +97,16 @@ def start_webserver_dameon(args: RuntimeArgs) -> multiprocessing.Process:
97
97
  sleep(2)
98
98
 
99
99
  def start_webserver(args: RuntimeArgs) -> int:
100
- app.run(
101
- host='0.0.0.0',
102
- port=args.port,
103
- debug=args.reloader,
104
- use_reloader=args.reloader
105
- )
100
+ run_args = {
101
+ 'host':'0.0.0.0',
102
+ 'port':args.port,
103
+ 'debug':args.reloader,
104
+ 'use_reloader':args.reloader
105
+ }
106
106
 
107
+ app.run(**run_args)
108
+
109
+
107
110
 
108
111
  if __name__ == "__main__":
109
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,19 +32,15 @@ def main():
33
32
 
34
33
 
35
34
  try:
36
- if args.nogui or args.headless:
37
- no_gui(args)
38
- else:
39
- start_webview(
40
- args
41
- )
35
+
36
+ no_gui(args)
37
+
42
38
  log.info('Exiting...')
43
39
  except Exception:
44
40
  # showing error in debug only because this is handled gracefully
45
- log.debug('Failed to start webview client. Traceback below')
41
+ log.debug('Failed to start. Traceback below')
46
42
  log.debug(traceback.format_exc())
47
- if not args.nogui:
48
- log.error('Unable to start webview client. Try running with flag --nogui')
43
+
49
44
 
50
45
 
51
46
  def try_check_update():
@@ -77,10 +72,11 @@ def open_browser(url: str,wait=2):
77
72
  def no_gui(args: RuntimeArgs):
78
73
  # determine if it was reloaded by flask debug reloader
79
74
  # if it was, dont open the browser again
80
- if not IS_FLASK_RELOAD and not args.headless:
75
+ if not IS_FLASK_RELOAD:
81
76
  open_browser(f'http://127.0.0.1:{args.port}')
82
- if args.headless:
83
- log.info(f'Started in headless mode on: http://127.0.0.1:{args.port}')
77
+
78
+ log.info(f'Server started: http://127.0.0.1:{args.port}')
79
+
84
80
  start_webserver(
85
81
  args
86
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.7a3
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
@@ -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
@@ -2,7 +2,6 @@ Flask<5.0,>=3.0
2
2
  psutil<7.0,>=6.0
3
3
  requests<3.0,>=2.32
4
4
  setuptools
5
- pywebview<6.0,>=4.2
6
5
  scapy<3.0,>=2.3.2
7
6
  tabulate==0.9.0
8
7
  pytest
@@ -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')
@@ -1,20 +0,0 @@
1
- import webview
2
- from .app import start_webserver_dameon
3
- from ..libraries.runtime_args import RuntimeArgs
4
-
5
-
6
-
7
- def start_webview(args: RuntimeArgs) -> None:
8
- # Start Flask server in a separate thread
9
- start_webserver_dameon(args)
10
-
11
- # Start the Pywebview window
12
- webview.create_window('LANscape', f'http://127.0.0.1:{args.port}')
13
- webview.start()
14
-
15
-
16
-
17
- if __name__ == "__main__":
18
- # Start Flask server in a separate thread
19
- start_webview(True)
20
-
File without changes
File without changes
File without changes
File without changes