Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyongju committed Apr 28, 2023
1 parent 4578775 commit f53cfe1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Binary file modified dist/run.exe
Binary file not shown.
18 changes: 16 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def main(argv):
# df.to_csv('parsed_game_list.csv',index=False)
cnt = 0
for count, filename in enumerate(os.listdir(game_folder_name)):
print(count)
src = f"{game_folder_name}/{filename}" # foldername/filename, if .py file is outside folder
# print(filename)
if '.' not in filename:
Expand All @@ -64,8 +65,21 @@ def main(argv):
# print(game_name)
exclusions = ['/', ':', '-', '?', '*','\'']
new_game_name = ''.join(ch for ch in game_name if ch not in exclusions)
dst_name = new_game_name[:25]

new_game_name_splited = new_game_name.split('(')[0].strip()
if len(new_game_name_splited) > 25:
new_game_words = new_game_name_splited.split()
num_words = len(new_game_words)
cur_words = new_game_name_splited
while len(cur_words) > 25:
cur_words = ' '.join(word for word in new_game_words[:num_words])
num_words = num_words-1
new_game_name_splited = cur_words
#
#
#
# adjust_num_words = min(3,len(new_game_words))
# dst_name = new_game_name[:25]
dst_name = new_game_name_splited

try:
os.mkdir(f'{game_folder_name}/{dst_name}')
Expand Down

0 comments on commit f53cfe1

Please sign in to comment.