pingwizard 1.0.0a2__tar.gz → 1.0.0a4__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.
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/PKG-INFO +1 -1
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/pingwizard/__main__.py +7 -1
- pingwizard-1.0.0a4/pingwizard/assets/PINGMapper_Logo_small.png +0 -0
- pingwizard-1.0.0a4/pingwizard/create_shortcut.py +69 -0
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/pingwizard/gui_wizard.py +6 -1
- pingwizard-1.0.0a4/pingwizard/version.py +1 -0
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/pingwizard.egg-info/PKG-INFO +1 -1
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/pingwizard.egg-info/SOURCES.txt +3 -1
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/setup.py +1 -0
- pingwizard-1.0.0a2/pingwizard/version.py +0 -1
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/LICENSE +0 -0
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/README.md +0 -0
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/pingwizard/__init__.py +0 -0
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/pingwizard.egg-info/dependency_links.txt +0 -0
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/pingwizard.egg-info/top_level.txt +0 -0
- {pingwizard-1.0.0a2 → pingwizard-1.0.0a4}/setup.cfg +0 -0
|
Binary file
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
import os, sys
|
|
3
|
+
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
home_path = os.path.join(Path.home())
|
|
6
|
+
|
|
7
|
+
def windows_shortcut(conda_env, conda_key, bat_file):
|
|
8
|
+
|
|
9
|
+
to_write = "@echo off\n"+\
|
|
10
|
+
"set conda_base={}\n".format(conda_env)+\
|
|
11
|
+
"set conda_key={}\n".format(conda_key)+\
|
|
12
|
+
"\n\n"+\
|
|
13
|
+
"call conda activate %conda_base%\n"+\
|
|
14
|
+
"if ERRORLEVEL 1 (echo Error! Cannot load Conda environment.)\n"+\
|
|
15
|
+
"goto run_script\n\n"+\
|
|
16
|
+
":run_script\n"+\
|
|
17
|
+
"echo Launching PINGWizard\n"+\
|
|
18
|
+
"python -m pingwizard\n"
|
|
19
|
+
|
|
20
|
+
print('\n\n', to_write)
|
|
21
|
+
|
|
22
|
+
with open(bat_file, 'w') as f:
|
|
23
|
+
f.write(to_write)
|
|
24
|
+
|
|
25
|
+
return
|
|
26
|
+
|
|
27
|
+
def linux_shortcut(conda_env, conda_key):
|
|
28
|
+
|
|
29
|
+
# Need to update, skipping for now
|
|
30
|
+
|
|
31
|
+
to_write = "#!/bin/bash\n"+\
|
|
32
|
+
"""set conda_base="{}"\n""".format(conda_env)+\
|
|
33
|
+
"set conda_key={}\n".format(conda_key)+\
|
|
34
|
+
"\n\n"+\
|
|
35
|
+
"call conda activate %conda_base%\n"+\
|
|
36
|
+
"if ERRORLEVEL 1 (echo Error! Cannot load Conda environment.)\n"+\
|
|
37
|
+
"goto run_script\n\n"+\
|
|
38
|
+
":run_script\n"+\
|
|
39
|
+
"echo Launching PINGWizard\n"+\
|
|
40
|
+
"python -m pingwizard\n"
|
|
41
|
+
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
def create_shortcut():
|
|
45
|
+
|
|
46
|
+
# Get Conda Info
|
|
47
|
+
conda_env = os.environ['CONDA_PREFIX']
|
|
48
|
+
print("\n\nConda Env:\t\t", conda_env)
|
|
49
|
+
|
|
50
|
+
if 'miniforge' in conda_env:
|
|
51
|
+
conda_key = 'mamba'
|
|
52
|
+
else:
|
|
53
|
+
conda_key = 'conda'
|
|
54
|
+
print("Conda Key:\t\t", conda_key)
|
|
55
|
+
|
|
56
|
+
bat_file_path = os.path.join(home_path, "Desktop", "Launch PINGWizard.bat")
|
|
57
|
+
|
|
58
|
+
if "Windows" in os.environ['OS']:
|
|
59
|
+
print("Creating Windows Shortcut")
|
|
60
|
+
windows_shortcut(conda_env, conda_key, bat_file_path)
|
|
61
|
+
|
|
62
|
+
else:
|
|
63
|
+
print("Creating Linux Shortcut")
|
|
64
|
+
linux_shortcut(conda_env, conda_key)
|
|
65
|
+
|
|
66
|
+
pass
|
|
67
|
+
|
|
68
|
+
if __name__ == "__main__":
|
|
69
|
+
create_shortcut()
|
|
@@ -11,7 +11,11 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
11
11
|
PACKAGE_DIR = os.path.dirname(SCRIPT_DIR)
|
|
12
12
|
|
|
13
13
|
# Logo's
|
|
14
|
-
|
|
14
|
+
env_dir = os.environ['CONDA_PREFIX']
|
|
15
|
+
pingmapper_logo_name = "pingmapper_logo_small.png"
|
|
16
|
+
pingmapper_logo = os.path.join(env_dir, 'pingmapper_config', pingmapper_logo_name)
|
|
17
|
+
if not os.path.exists(pingmapper_logo):
|
|
18
|
+
pingmapper_logo = os.path.join(SCRIPT_DIR, "assets", pingmapper_logo_name)
|
|
15
19
|
|
|
16
20
|
def wizard():
|
|
17
21
|
|
|
@@ -113,4 +117,5 @@ def wizard():
|
|
|
113
117
|
sys.exit()
|
|
114
118
|
|
|
115
119
|
if __name__ == "__main__":
|
|
120
|
+
|
|
116
121
|
wizard()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.0.0-alpha.4'
|
|
@@ -3,9 +3,11 @@ README.md
|
|
|
3
3
|
setup.py
|
|
4
4
|
pingwizard/__init__.py
|
|
5
5
|
pingwizard/__main__.py
|
|
6
|
+
pingwizard/create_shortcut.py
|
|
6
7
|
pingwizard/gui_wizard.py
|
|
7
8
|
pingwizard/version.py
|
|
8
9
|
pingwizard.egg-info/PKG-INFO
|
|
9
10
|
pingwizard.egg-info/SOURCES.txt
|
|
10
11
|
pingwizard.egg-info/dependency_links.txt
|
|
11
|
-
pingwizard.egg-info/top_level.txt
|
|
12
|
+
pingwizard.egg-info/top_level.txt
|
|
13
|
+
pingwizard/assets/PINGMapper_Logo_small.png
|
|
@@ -16,6 +16,7 @@ setup(
|
|
|
16
16
|
long_description=LONG_DESCRIPTION,
|
|
17
17
|
long_description_content_type='text/markdown',
|
|
18
18
|
packages=find_packages(),
|
|
19
|
+
data_files=[("pingmapper_config", ["pingwizard/assets/PINGMapper_Logo_small.png"])],
|
|
19
20
|
classifiers=[
|
|
20
21
|
"Development Status :: 3 - Alpha",
|
|
21
22
|
"Programming Language :: Python :: 3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.0.0-alpha.2'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|