Open-AutoTools 0.0.3rc1__tar.gz → 0.0.3rc2__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.
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2/Open_AutoTools.egg-info}/PKG-INFO +1 -1
- {open_autotools-0.0.3rc1/Open_AutoTools.egg-info → open_autotools-0.0.3rc2}/PKG-INFO +1 -1
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autodownload/core.py +11 -6
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/cli.py +53 -62
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/setup.py +1 -1
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/LICENSE +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/Open_AutoTools.egg-info/SOURCES.txt +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/Open_AutoTools.egg-info/dependency_links.txt +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/Open_AutoTools.egg-info/entry_points.txt +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/Open_AutoTools.egg-info/requires.txt +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/Open_AutoTools.egg-info/top_level.txt +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/README.md +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autocaps/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autocaps/core.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autocaps/tests/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autocaps/tests/test_autocaps_core.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autocaps/tests/test_autocaps_integration.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autodownload/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autoip/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autoip/core.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autoip/tests/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autoip/tests/test_autoip_core.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autoip/tests/test_autoip_integration.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autolower/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autolower/core.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autolower/tests/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autolower/tests/test_autolower_core.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autolower/tests/test_autolower_integration.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autopassword/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autopassword/core.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autospell/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autospell/core.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autotranslate/__init__.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autotranslate/core.py +0 -0
- {open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/setup.cfg +0 -0
|
@@ -26,15 +26,20 @@ def get_filename_from_url(url):
|
|
|
26
26
|
|
|
27
27
|
# FUNCTION TO OPEN DOWNLOAD DIRECTORY AFTER DOWNLOAD IS COMPLETE
|
|
28
28
|
def open_download_folder(path):
|
|
29
|
+
"""OPEN THE DOWNLOAD FOLDER IN THE DEFAULT FILE MANAGER"""
|
|
30
|
+
# SKIP IN CI ENVIRONMENT
|
|
31
|
+
if os.environ.get('CI'):
|
|
32
|
+
return
|
|
33
|
+
|
|
29
34
|
try:
|
|
30
|
-
if platform.system() == 'Darwin': #
|
|
31
|
-
subprocess.run(['open',
|
|
32
|
-
elif platform.system() == 'Windows': #
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
if platform.system() == 'Darwin': # MACOS
|
|
36
|
+
subprocess.run(['open', str(path)], check=True)
|
|
37
|
+
elif platform.system() == 'Windows': # WINDOWS
|
|
38
|
+
os.startfile(str(path))
|
|
39
|
+
else: # LINUX
|
|
35
40
|
subprocess.run(['xdg-open', str(path)], check=True)
|
|
36
41
|
except Exception as e:
|
|
37
|
-
print(f"
|
|
42
|
+
print(f"Failed to open download folder: {e}")
|
|
38
43
|
|
|
39
44
|
|
|
40
45
|
# FUNCTION TO VALIDATE YOUTUBE URL FORMAT
|
|
@@ -41,61 +41,61 @@ def print_version(ctx, param, value):
|
|
|
41
41
|
if not value or ctx.resilient_parsing:
|
|
42
42
|
return
|
|
43
43
|
|
|
44
|
-
# GET CURRENT VERSION
|
|
45
44
|
try:
|
|
45
|
+
# GET CURRENT VERSION
|
|
46
46
|
pkg_version = get_version('Open-AutoTools')
|
|
47
47
|
click.echo(f"Open-AutoTools version {pkg_version}")
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
import pkg_resources
|
|
54
|
-
dist = pkg_resources.get_distribution('Open-AutoTools')
|
|
55
|
-
is_testpypi = 'test.pypi.org' in dist.location
|
|
56
|
-
except:
|
|
57
|
-
pass
|
|
49
|
+
# GET DISTRIBUTION INFO
|
|
50
|
+
import pkg_resources
|
|
51
|
+
dist = pkg_resources.get_distribution("Open-AutoTools")
|
|
52
|
+
current_version = parse_version(dist.version)
|
|
58
53
|
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
# GET LATEST VERSION FROM PYPI
|
|
55
|
+
pypi_url = "https://pypi.org/pypi/Open-AutoTools/json"
|
|
56
|
+
response = requests.get(pypi_url)
|
|
57
|
+
|
|
58
|
+
# CHECK IF RESPONSE IS SUCCESSFUL
|
|
59
|
+
if response.status_code == 200:
|
|
60
|
+
data = response.json()
|
|
61
|
+
latest_version = data["info"]["version"]
|
|
62
|
+
releases = data["releases"]
|
|
61
63
|
|
|
62
|
-
#
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
upload_time = releases[latest_version][0]["upload_time"]
|
|
72
|
-
# TRY DIFFERENT DATE FORMATS
|
|
64
|
+
# GET RELEASE DATE
|
|
65
|
+
if latest_version in releases and releases[latest_version]:
|
|
66
|
+
try:
|
|
67
|
+
upload_time = releases[latest_version][0]["upload_time"]
|
|
68
|
+
for date_format in [
|
|
69
|
+
"%Y-%m-%dT%H:%M:%S",
|
|
70
|
+
"%Y-%m-%dT%H:%M:%S.%fZ",
|
|
71
|
+
"%Y-%m-%d %H:%M:%S"
|
|
72
|
+
]:
|
|
73
73
|
try:
|
|
74
|
-
published_date = datetime.strptime(upload_time,
|
|
74
|
+
published_date = datetime.strptime(upload_time, date_format)
|
|
75
|
+
formatted_date = published_date.strftime("%d %B %Y at %H:%M:%S")
|
|
76
|
+
click.echo(f"Released: {formatted_date}")
|
|
77
|
+
break
|
|
75
78
|
except ValueError:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if latest_parsed > current_parsed:
|
|
92
|
-
update_cmd = "pip install --upgrade -i https://test.pypi.org/simple/ Open-AutoTools" if is_testpypi else "pip install --upgrade Open-AutoTools"
|
|
93
|
-
click.echo(click.style(f"\nUpdate available: v{latest_version}", fg='red', bold=True))
|
|
94
|
-
click.echo(click.style(f"Run '{update_cmd}' to update", fg='red'))
|
|
95
|
-
except Exception as e:
|
|
96
|
-
click.echo(f"Error checking updates: {str(e)}")
|
|
79
|
+
continue
|
|
80
|
+
except Exception:
|
|
81
|
+
pass # SKIP DATE IF PARSING FAILS
|
|
82
|
+
|
|
83
|
+
# CHECK FOR UPDATES
|
|
84
|
+
latest_parsed = parse_version(latest_version)
|
|
85
|
+
|
|
86
|
+
# COMPARE VERSIONS AND PRINT UPDATE MESSAGE IF NEEDED
|
|
87
|
+
if latest_parsed > current_version:
|
|
88
|
+
update_cmd = "pip install --upgrade Open-AutoTools"
|
|
89
|
+
click.echo(click.style(f"\nUpdate available: v{latest_version}", fg='red', bold=True))
|
|
90
|
+
click.echo(click.style(f"Run '{update_cmd}' to update", fg='red'))
|
|
91
|
+
|
|
92
|
+
except pkg_resources.DistributionNotFound:
|
|
93
|
+
click.echo("Package distribution not found")
|
|
97
94
|
except PackageNotFoundError:
|
|
98
95
|
click.echo("Open-AutoTools version information not available")
|
|
96
|
+
except Exception as e:
|
|
97
|
+
click.echo(f"Error checking updates: {str(e)}")
|
|
98
|
+
|
|
99
99
|
ctx.exit()
|
|
100
100
|
|
|
101
101
|
# CLI FUNCTION DEFINITION
|
|
@@ -156,20 +156,12 @@ def check_for_updates():
|
|
|
156
156
|
|
|
157
157
|
# GET CURRENT VERSION
|
|
158
158
|
try:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
is_testpypi = False
|
|
163
|
-
try:
|
|
164
|
-
# ATTEMPT TO GET PACKAGE METADATA
|
|
165
|
-
import pkg_resources
|
|
166
|
-
dist = pkg_resources.get_distribution('Open-AutoTools')
|
|
167
|
-
is_testpypi = 'test.pypi.org' in dist.location
|
|
168
|
-
except:
|
|
169
|
-
pass
|
|
159
|
+
import pkg_resources
|
|
160
|
+
dist = pkg_resources.get_distribution("Open-AutoTools")
|
|
161
|
+
current_version = parse_version(dist.version)
|
|
170
162
|
|
|
171
|
-
#
|
|
172
|
-
pypi_url = "https://
|
|
163
|
+
# GET LATEST VERSION FROM PYPI
|
|
164
|
+
pypi_url = "https://pypi.org/pypi/Open-AutoTools/json"
|
|
173
165
|
|
|
174
166
|
# CHECK FOR UPDATES FROM PYPI
|
|
175
167
|
response = requests.get(pypi_url)
|
|
@@ -180,12 +172,11 @@ def check_for_updates():
|
|
|
180
172
|
latest_version = data["info"]["version"]
|
|
181
173
|
|
|
182
174
|
# PARSE VERSIONS FOR COMPARISON
|
|
183
|
-
current_parsed = parse_version(current_version)
|
|
184
175
|
latest_parsed = parse_version(latest_version)
|
|
185
176
|
|
|
186
177
|
# PRINT UPDATE MESSAGE IF NEEDED
|
|
187
|
-
if latest_parsed >
|
|
188
|
-
update_cmd = "pip install --upgrade
|
|
178
|
+
if latest_parsed > current_version:
|
|
179
|
+
update_cmd = "pip install --upgrade Open-AutoTools"
|
|
189
180
|
return (
|
|
190
181
|
click.style(f"\nUpdate available: v{latest_version}", fg='red', bold=True) + "\n" +
|
|
191
182
|
click.style(f"Run '{update_cmd}' to update", fg='red')
|
|
@@ -193,7 +184,7 @@ def check_for_updates():
|
|
|
193
184
|
except Exception as e:
|
|
194
185
|
# FOR DEBUGGING, LOG ERROR
|
|
195
186
|
print(f"Error checking updates: {str(e)}")
|
|
196
|
-
|
|
187
|
+
|
|
197
188
|
return None
|
|
198
189
|
|
|
199
190
|
# AUTOCAPS COMMAND LINE INTERFACE FUNCTION DEFINITION
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/Open_AutoTools.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/Open_AutoTools.egg-info/entry_points.txt
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
|
{open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autocaps/tests/test_autocaps_core.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autoip/tests/test_autoip_core.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_autotools-0.0.3rc1 → open_autotools-0.0.3rc2}/autotools/autolower/tests/test_autolower_core.py
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
|