← back to Hollywood Body Table Migration
chore: py-compile check, VERSION 0.1.0 (session close)
4ec5d56c3d56b6db2f3cd43ff6246d511e99ccf3 · 2026-08-18 13:28:39 -0700 · Steve
Files touched
A VERSIONA __pycache__/migrate.cpython-314.pycM migrate.py
Diff
commit 4ec5d56c3d56b6db2f3cd43ff6246d511e99ccf3
Author: Steve <steve@designerwallcoverings.com>
Date: Tue Aug 18 13:28:39 2026 -0700
chore: py-compile check, VERSION 0.1.0 (session close)
---
VERSION | 1 +
__pycache__/migrate.cpython-314.pyc | Bin 0 -> 7109 bytes
migrate.py | 15 ++++++++++++---
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..6e8bf73
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.1.0
diff --git a/__pycache__/migrate.cpython-314.pyc b/__pycache__/migrate.cpython-314.pyc
new file mode 100644
index 0000000..3e37ea4
Binary files /dev/null and b/__pycache__/migrate.cpython-314.pyc differ
diff --git a/migrate.py b/migrate.py
index 1687a6b..2b6861a 100644
--- a/migrate.py
+++ b/migrate.py
@@ -4,7 +4,16 @@ Lossless: backfills any table label whose metafield is absent/empty BEFORE strip
Reversible: snapshots every original body_html + records created metafields to restore/.
Usage: migrate.py [--apply] (default = DRY RUN)
"""
-import os,json,re,time,sys,urllib.request,urllib.parse,urllib.error,datetime
+import datetime
+import json
+import os
+import re
+import sys
+import time
+import urllib.error
+import urllib.parse
+import urllib.request
+
APPLY='--apply' in sys.argv
STORE=os.environ.get('SHOPIFY_STORE_DOMAIN','designer-laboratory-sandbox.myshopify.com')
TOK=os.environ['SHOPIFY_ADMIN_TOKEN']
@@ -30,7 +39,7 @@ def req(method,url,body=None):
except urllib.error.HTTPError as e:
if e.code==429: time.sleep(2*(attempt+1)); continue
print('HTTP',e.code,url,e.read()[:200]); return None
- except Exception as ex:
+ except Exception:
time.sleep(1); continue
return None
@@ -38,7 +47,7 @@ def parse_rows(body):
return [(l.strip(),v.strip()) for l,v in re.findall(r'<td>\s*([^<]+?)\s*</td>\s*<td>\s*([^<]*?)\s*</td>', body)]
def strip_tables(body):
- b=re.sub(r'<table[\s\S]*?</table>','',body,flags=re.I)
+ b=re.sub(r'<table[\s\S]*?</table>','',body,flags=re.IGNORECASE)
b=re.sub(r'\s+$','',b).strip()
return b
← c57326c Apply migration: 400 bodies stripped, 241 specs backfilled t
·
back to Hollywood Body Table Migration
·
(newest)