Skip to content

Commit

Permalink
Fix generate-json for phatstack, restore phatstack.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Feb 12, 2024
1 parent f0a6965 commit c79a3f9
Show file tree
Hide file tree
Showing 3 changed files with 15,257 additions and 4 deletions.
9 changes: 5 additions & 4 deletions generate-json.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
import pinout


reload(sys)
sys.setdefaultencoding('utf8')
try:
sys.setdefaultencoding('utf8')
except AttributeError: # Does not work in Python 3
unicode = str

lang = "en"

Expand Down Expand Up @@ -40,7 +42,6 @@ def slugify(value):
Normalizes string, converts to lowercase, removes non-alpha characters,
and converts spaces to hyphens.
"""
value = unicode(value)
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
value = re.sub('[^\w\s-]', '', value).strip().lower()
return re.sub('[-\s]+', '_', value)
Expand Down Expand Up @@ -133,7 +134,7 @@ def load_md(filename):
return ''


overlays = map(load_overlay, overlays)
overlays = list(map(load_overlay, overlays))

print(json.dumps(overlays))
#print(json.dumps(product_map))
Loading

0 comments on commit c79a3f9

Please sign in to comment.