removed f-strings, included .ico files

This commit is contained in:
MikeTheWatchGuy 2018-12-25 15:31:44 -05:00
parent b4608f8449
commit cc2d7afc1b
1 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ def main():
sg.PopupCancel('Cancelled - No valid folder entered')
return
try:
namesonly = [f for f in os.listdir(folder) if f.endswith('.png')]
namesonly = [f for f in os.listdir(folder) if f.endswith('.png') or f.endswith('.ico')]
except:
sg.PopupCancel('Cancelled - No valid folder entered')
return
@ -29,11 +29,11 @@ def main():
for i, file in enumerate(namesonly):
contents = open(os.path.join(folder, file), 'rb').read()
encoded = base64.b64encode(contents)
outfile.write(f'{file[:file.index(".")]} = {encoded}\n')
outfile.write('\n{} = {}\n\n'.format(file[:file.index(".")], encoded))
sg.OneLineProgressMeter('Base64 Encoding', i+1, len(namesonly),key='_METER_')
outfile.close()
sg.Popup('Completed!', 'Encoded %s files'% i)
sg.Popup('Completed!', 'Encoded %s files'%(i+1))
if __name__ == '__main__':