Skip to content

Commit f9d2f59

Browse files
authored
Remove upload artifact and revert python script
1 parent 83a237b commit f9d2f59

2 files changed

Lines changed: 2 additions & 20 deletions

File tree

.github/workflows/test_generate_mads.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,3 @@ jobs:
2727
run: |
2828
mkdir -p mad
2929
python3 csv2mad.py ArcadeDatabase_CSV/ArcadeDatabase.csv
30-
31-
- name: Upload generated MAD files
32-
uses: actions/upload-artifact@v4
33-
with:
34-
name: mad-files
35-
path: mad/

csv2mad.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@
44
import sys
55
import csv
66
import tqdm
7-
import re
87

9-
# Function to clean up filenames
10-
def sanitize_filename(name):
11-
name = name.replace("&", "&") # Convert HTML entity
12-
name = name.replace(":", " -") # Replace colon with dash/space
13-
name = re.sub(r'[<>:"/\\|?*\n\r]', '', name) # Remove invalid characters
14-
return name.strip()
15-
16-
# Check script usage
178
if len(sys.argv) != 2:
189
print("Please call the script as follows")
1910
print("python3 csv2mad.py ARCADE_METADATA_FILE(.csv)")
@@ -32,12 +23,9 @@ def sanitize_filename(name):
3223
next(csv_reader) # Skip header row
3324

3425
for game in tqdm.tqdm(csv_reader, desc="Generating mads", total=total_rows):
35-
mad_filename = os.path.join(
36-
OUTPUT_DIR,
37-
sanitize_filename(game[MAD_NAME_COLUMN]).lower() + ".mad"
38-
)
26+
mad_filename = os.path.join(OUTPUT_DIR, game[MAD_NAME_COLUMN] + ".mad")
3927

40-
with open(mad_filename, 'w') as f:
28+
with open(mad_filename.replace("&amp;", "&"), 'w') as f:
4129
f.write("<?xml version=\"1.0\" ?>\n")
4230
f.write("<misterarcadedescription>\n\n")
4331

0 commit comments

Comments
 (0)