Skip to content

Instantly share code, notes, and snippets.

@drojf
Created January 16, 2018 06:05
Show Gist options
  • Save drojf/0104b6b23c5ec503dfd6e77b6a1df250 to your computer and use it in GitHub Desktop.
Save drojf/0104b6b23c5ec503dfd6e77b6a1df250 to your computer and use it in GitHub Desktop.
import re
import conf
findVoiceRegex = re.compile(r'"voice\\(\d\d)\\(.*?)\.ogg"')
umitweak_script = r'c:\temp\umitweak_original.utf'
current_script = r'C:\drojf\large_projects\umineko\git_repository\0.utf'
git_text = None
with open(current_script, encoding=conf.encoding) as script_in:
git_text = script_in.read()
git_id_set = set()
for match in re.finditer(findVoiceRegex, git_text):
character_no = match[1]
ogg_number = match[2]
git_id_set.add(ogg_number)
with open(umitweak_script, encoding=conf.encoding) as script_in:
for i, line in enumerate(script_in):
for match in re.finditer(findVoiceRegex, line):
full_match = match[0]
ogg_number = match[2]
if ogg_number not in git_id_set:
print('ut_line:{:6d} path:[{:26}] full_line:[{}]'.format(i, full_match, line.strip()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment