kisssadam / Static-HTML-file-browser-for-Dropbox

GNU General Public License v3.0
11 stars 8 forks source link

Replace get_icon_name() method. #1

Closed kisssadam closed 9 years ago

kisssadam commented 9 years ago

This method should determine the filetype as "file" program does.

jabbalaci commented 9 years ago

This would slow down your program considerably. I think it's enough to check just the extension.

kisssadam commented 9 years ago

And what do you think about the current solution? Which one is better?

Find the extension only at the end of the filename: match = re.search(key + "$", filename)

or in the entire string: match = re.search(key, filename)

I used the last one, beacuse you have python files ending with .txt here: https://dl.dropboxusercontent.com/u/144888/tanitas/python/02_listak/index.html If the first solution is used then list1.py.txt will be treated as a single text file and icon on the left will be different than the current one.

jabbalaci commented 9 years ago

I would treat list1.py.txt as a normal TXT file. Its extension is .txt so it's a text file for me.

kisssadam commented 9 years ago

Function is updated.