diff --git a/api/commands/plotman_cli.py b/api/commands/plotman_cli.py index 9aa74d95..85196c77 100644 --- a/api/commands/plotman_cli.py +++ b/api/commands/plotman_cli.py @@ -267,7 +267,7 @@ def find_plotting_job_log(plot_id): return None def analyze(plot_file): - groups = re.match("plot(?:-mmx)?-k(\d+)(?:-c\d+)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", plot_file) + groups = re.match(r"plot(?:-mmx)?-k(\d+)(?:-c\d+)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", plot_file) if not groups: return "Invalid plot file name provided: {0}".format(plot_file) plot_log_file = find_plotting_job_log(groups[7]) diff --git a/api/models/chia.py b/api/models/chia.py index 35985070..82051045 100644 --- a/api/models/chia.py +++ b/api/models/chia.py @@ -29,7 +29,7 @@ def __init__(self, cli_stdout, blockchain): self.plots_size = effective.strip().removesuffix('e (effective)') elif "status" in line: self.calc_status(line.split(':')[1].strip()) - elif re.match("Total.*farmed:.*$", line): + elif re.match(r"Total.*farmed:.*$", line): self.total_coins = line.split(':')[1].strip() elif "network space" in line: self.calc_netspace_size(line.split(':')[1].strip()) @@ -142,7 +142,7 @@ def exclude_wallets_from_sum(self, wallet_details): exclude_wallet = False lines = chunk.split('\n') for line in lines: - if re.match('^\s+-Type:\s+CAT$', line) or re.match('^\s+-Type:\s+DISTRIBUTED_ID$', line) or re.match('^\s+-Type:\s+DECENTRALIZED_ID$', line) or re.match('^\s+-Type:\s+NFT$', line): + if re.match(r'^\s+-Type:\s+CAT$', line) or re.match(r'^\s+-Type:\s+DISTRIBUTED_ID$', line) or re.match(r'^\s+-Type:\s+DECENTRALIZED_ID$', line) or re.match(r'^\s+-Type:\s+NFT$', line): exclude_wallet = True if exclude_wallet: app.logger.debug("Ignoring balance of wallet named: {0}".format(lines[0][:-1])) diff --git a/api/models/mmx.py b/api/models/mmx.py index 5410c5d0..1f14c722 100644 --- a/api/models/mmx.py +++ b/api/models/mmx.py @@ -14,7 +14,7 @@ def __init__(self, cli_stdout, blockchain): self.plot_count = 0 self.plots_size = 0 for line in cli_stdout: - m = re.match('^K(\d+): (\d+) plots$', line) + m = re.match(r'^K(\d+): (\d+) plots$', line) if m: self.plot_count += int(m.group(2)) elif line.startswith('Total size'): @@ -82,7 +82,7 @@ def __init__(self, entries): app.logger.info("Skipping non-plot file named: {0}".format(path)) continue dir,file=os.path.split(path) - groups = re.match("plot-mmx-k(\d+)(-c\d)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) + groups = re.match(r"plot-mmx-k(\d+)(-c\d)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) if not groups: app.logger.info("Invalid plot file name provided: {0}".format(file)) continue diff --git a/api/schedules/stats_effort.py b/api/schedules/stats_effort.py index 7c0d597b..679a14b6 100644 --- a/api/schedules/stats_effort.py +++ b/api/schedules/stats_effort.py @@ -41,7 +41,7 @@ def get_oldest_plot_file_time(): for plot_dir in globals.get_disks("plots"): plots = [f for f in os.listdir(plot_dir) if os.path.isfile(os.path.join(plot_dir,f))] for plot in plots: - match = re.match("plot(?:-mmx)?-k(\d+)(?:-c\d+)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", plot) + match = re.match(r"plot(?:-mmx)?-k(\d+)(?:-c\d+)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", plot) if match: created_at_str = "{0}-{1}-{2} {3}:{4}".format( match.group(2),match.group(3),match.group(4),match.group(5),match.group(6)) created_at_secs = time.mktime(datetime.datetime.strptime(created_at_str, "%Y-%m-%d %H:%M").timetuple()) diff --git a/api/schedules/status_plots.py b/api/schedules/status_plots.py index 11a06b0b..64bffaf3 100644 --- a/api/schedules/status_plots.py +++ b/api/schedules/status_plots.py @@ -29,7 +29,7 @@ def get_plot_attrs(plot_id, filename): dir,file = os.path.split(filename) - match = re.match("plot(?:-mmx)?-k(\d+)(?:-c\d+)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) + match = re.match(r"plot(?:-mmx)?-k(\d+)(?:-c\d+)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) if match: short_plot_id = match.group(7)[:16] created_at = "{0}-{1}-{2} {3}:{4}".format( match.group(2),match.group(3),match.group(4),match.group(5),match.group(6)) diff --git a/scripts/plotman_setup.sh b/scripts/plotman_setup.sh index 707b9289..2d3cd2f1 100644 --- a/scripts/plotman_setup.sh +++ b/scripts/plotman_setup.sh @@ -13,8 +13,8 @@ if [[ (${mode} =~ ^fullnode.* || ${mode} =~ "plotter") && (${blockchains} == 'c cd plotman /chia-blockchain/venv/bin/pip install . # Workaround for broken dependency ordering - /chia-blockchain/venv/bin/pip install pendulum~=2.1 - /chia-blockchain/venv/bin/pip install packaging~=21.0 + /chia-blockchain/venv/bin/pip install pendulum~=3.0 + /chia-blockchain/venv/bin/pip install packaging~=24.2 /chia-blockchain/venv/bin/pip install attrs~=21.2 /chia-blockchain/venv/bin/pip install desert~=2020.11.18 /chia-blockchain/venv/bin/pip install appdirs~=1.4 diff --git a/web/actions/warnings.py b/web/actions/warnings.py index 7191c34b..1710493e 100644 --- a/web/actions/warnings.py +++ b/web/actions/warnings.py @@ -84,7 +84,7 @@ def check_warnings(args): def get_plot_attrs(filename): dir,file = os.path.split(filename) - match = re.match("plot(?:-mmx)?-k(\d+)(?:-c\d+)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) + match = re.match(r"plot(?:-mmx)?-k(\d+)(?:-c\d+)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) if match: short_plot_id = match.group(7)[:16] created_at = "{0}-{1}-{2} {3}:{4}".format( match.group(2),match.group(3),match.group(4),match.group(5),match.group(6)) diff --git a/web/models/chia.py b/web/models/chia.py index 07eedc9e..32101c49 100644 --- a/web/models/chia.py +++ b/web/models/chia.py @@ -426,7 +426,7 @@ def exclude_wallets_from_sum(self, wallet_details): def extract_wallet_id(self, lines): for line in lines: - wallet_match = re.match("^\s+-Wallet ID:\s+(\d)+$", line) + wallet_match = re.match(r"^\s+-Wallet ID:\s+(\d)+$", line) if wallet_match: return wallet_match.group(1) return None @@ -796,7 +796,7 @@ def parse_mmx(self, connection, blockchain, geoip_cache, lang): for line in connection.details.split('\n'): try: #app.logger.info(line) - m = re.match("\[(.+)\]\s+height\s+=\s+(\!?\d+), (\w+) \(\d+\.\d+\), (\d+\.?\d*) (\w)B recv, (\d*\.?\d*) (\w)B sent,.* since (\d+) min, .* (\d+\.?\d?) sec timeout", line.strip(), re.IGNORECASE) + m = re.match(r"\[(.+)\]\s+height\s+=\s+(\!?\d+), (\w+) \(\d+\.\d+\), (\d+\.?\d*) (\w)B recv, (\d*\.?\d*) (\w)B sent,.* since (\d+) min, .* (\d+\.?\d?) sec timeout", line.strip(), re.IGNORECASE) if m: connection = { 'type': m.group(3),