removed f-strings, included .ico files
This commit is contained in:
parent
b4608f8449
commit
cc2d7afc1b
|
@ -19,7 +19,7 @@ def main():
|
||||||
sg.PopupCancel('Cancelled - No valid folder entered')
|
sg.PopupCancel('Cancelled - No valid folder entered')
|
||||||
return
|
return
|
||||||
try:
|
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:
|
except:
|
||||||
sg.PopupCancel('Cancelled - No valid folder entered')
|
sg.PopupCancel('Cancelled - No valid folder entered')
|
||||||
return
|
return
|
||||||
|
@ -29,11 +29,11 @@ def main():
|
||||||
for i, file in enumerate(namesonly):
|
for i, file in enumerate(namesonly):
|
||||||
contents = open(os.path.join(folder, file), 'rb').read()
|
contents = open(os.path.join(folder, file), 'rb').read()
|
||||||
encoded = base64.b64encode(contents)
|
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_')
|
sg.OneLineProgressMeter('Base64 Encoding', i+1, len(namesonly),key='_METER_')
|
||||||
|
|
||||||
outfile.close()
|
outfile.close()
|
||||||
sg.Popup('Completed!', 'Encoded %s files'% i)
|
sg.Popup('Completed!', 'Encoded %s files'%(i+1))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue