Some... strangeness seemed to occur in Amiga ascii with these values
- however this may just be a local thing? I don't know, it seems to be fine when loaded over the net.
This commit is contained in:
parent
ba66b98200
commit
d57b5573c9
1 changed files with 14 additions and 1 deletions
15
editor.py
15
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue