diff --git a/editor.py b/editor.py index 5a0412a..3ca9705 100644 --- a/editor.py +++ b/editor.py @@ -77,7 +77,14 @@ def getansidata(filename): def getamigadata(filename): """try to get some form of info from file (:""" - return 'todo.txt' + with open(filename, encoding='latin1') as f: + ascii = f.readlines() + width = 0 + for i in ascii: + if len(i) > width: + width = len(i) + return {'height': len(ascii), + 'width': width} def main(args): @@ -126,6 +133,12 @@ def main(args): elif suf in ['TXT', 'ASC', 'txt', 'asc', 'NFO', 'nfo', 'diz', 'DIZ']: stuff = getamigadata(dirfile) + entry = mysahli.blank_amiga_ascii() + entry['name'] = i +# entry['title'] = i +# entry['height'] = stuff['height'] + entry['file'] = i + newdata.append(entry) else: print("dunno what type of file this is...") mysahli.sahli['filedata'] = newdata