Merge pull request #974 from MikeTheWatchGuy/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2018-12-25 15:32:16 -05:00 committed by GitHub
commit 578833569d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 15 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__':