atomicshop 2.12.18__py3-none-any.whl → 2.12.20__py3-none-any.whl
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 atomicshop might be problematic. Click here for more details.
- atomicshop/__init__.py +1 -1
- atomicshop/file_io/file_io.py +4 -2
- atomicshop/monitor/change_monitor.py +17 -24
- atomicshop/monitor/checks/dns.py +125 -116
- atomicshop/monitor/checks/file.py +77 -0
- atomicshop/monitor/checks/hash.py +6 -7
- atomicshop/monitor/checks/network.py +81 -81
- atomicshop/monitor/checks/process_running.py +33 -34
- atomicshop/monitor/checks/url.py +94 -0
- atomicshop/startup/win/__init__.py +0 -0
- atomicshop/startup/win/startup_folder.py +53 -0
- atomicshop/startup/win/task_scheduler.py +119 -0
- atomicshop/wrappers/loggingw/loggingw.py +82 -4
- atomicshop/wrappers/pywin32w/winshell.py +19 -0
- {atomicshop-2.12.18.dist-info → atomicshop-2.12.20.dist-info}/METADATA +1 -1
- {atomicshop-2.12.18.dist-info → atomicshop-2.12.20.dist-info}/RECORD +20 -16
- atomicshop/monitor/checks/hash_checks/file.py +0 -54
- atomicshop/monitor/checks/hash_checks/url.py +0 -64
- /atomicshop/{monitor/checks/hash_checks → startup}/__init__.py +0 -0
- {atomicshop-2.12.18.dist-info → atomicshop-2.12.20.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.12.18.dist-info → atomicshop-2.12.20.dist-info}/WHEEL +0 -0
- {atomicshop-2.12.18.dist-info → atomicshop-2.12.20.dist-info}/top_level.txt +0 -0
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
from .... import filesystem, hashing, urls
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def setup_check(change_monitor_instance, check_object: str):
|
|
5
|
-
# Extract the method name from the object type.
|
|
6
|
-
get_method = change_monitor_instance.object_type.split('_', 1)[1]
|
|
7
|
-
|
|
8
|
-
original_name: str = str()
|
|
9
|
-
|
|
10
|
-
# If 'generate_input_file_name' is True, or 'store_original_object' is True, we need to create a
|
|
11
|
-
# filename without extension.
|
|
12
|
-
if change_monitor_instance.store_original_object or change_monitor_instance.generate_input_file_name:
|
|
13
|
-
# Get the last directory from the url.
|
|
14
|
-
original_name = urls.url_parser(check_object)['directories'][-1]
|
|
15
|
-
# Make characters lower case.
|
|
16
|
-
original_name = original_name.lower()
|
|
17
|
-
|
|
18
|
-
# If 'store_original_object' is True, then we need to create a filepath to store.
|
|
19
|
-
extension = None
|
|
20
|
-
if change_monitor_instance.original_object_directory:
|
|
21
|
-
# Add extension to the file name.
|
|
22
|
-
if 'playwright' in get_method:
|
|
23
|
-
extension = get_method.split('_')[1]
|
|
24
|
-
elif get_method == 'urllib':
|
|
25
|
-
extension = 'html'
|
|
26
|
-
original_file_name = f'{original_name}.{extension}'
|
|
27
|
-
|
|
28
|
-
# Make path for original object.
|
|
29
|
-
change_monitor_instance.original_object_file_path = filesystem.add_object_to_path(
|
|
30
|
-
change_monitor_instance.original_object_directory, original_file_name)
|
|
31
|
-
|
|
32
|
-
if change_monitor_instance.generate_input_file_name:
|
|
33
|
-
# Make path for 'input_file_name'.
|
|
34
|
-
change_monitor_instance.input_file_name = f'{original_name}.txt'
|
|
35
|
-
|
|
36
|
-
# Change settings for the DiffChecker object.
|
|
37
|
-
change_monitor_instance.diff_checker.return_first_cycle = False
|
|
38
|
-
|
|
39
|
-
change_monitor_instance.diff_checker.check_object_display_name = \
|
|
40
|
-
f'{original_name}|{change_monitor_instance.object_type}'
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def get_hash(change_monitor_instance, check_object: str, print_kwargs: dict = None):
|
|
44
|
-
"""
|
|
45
|
-
The function will get the hash of the URL content.
|
|
46
|
-
|
|
47
|
-
:param change_monitor_instance: Instance of the ChangeMonitor class.
|
|
48
|
-
:param check_object: string, full URL to a web page.
|
|
49
|
-
:param print_kwargs: dict, that contains all the arguments for 'print_api' function.
|
|
50
|
-
"""
|
|
51
|
-
# Extract the method name from the object type.
|
|
52
|
-
get_method = change_monitor_instance.object_type.split('_', 1)[1]
|
|
53
|
-
|
|
54
|
-
# Get hash of the url. The hash will be different between direct hash of the URL content and the
|
|
55
|
-
# hash of the file that was downloaded from the URL. Since the file has headers and other information
|
|
56
|
-
# that is not part of the URL content. The Original downloaded file is for reference only to see
|
|
57
|
-
# what was the content of the URL at the time of the download.
|
|
58
|
-
hash_string = hashing.hash_url(
|
|
59
|
-
check_object, get_method=get_method, path=change_monitor_instance.original_object_file_path,
|
|
60
|
-
print_kwargs=print_kwargs
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
# Set the hash string to the 'check_object' variable.
|
|
64
|
-
change_monitor_instance.diff_checker.check_object = hash_string
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|