Browse Source

file-browser: identify Python scripts

K. Lange 2 years ago
parent
commit
3077e0d2b8
2 changed files with 9 additions and 0 deletions
  1. 9 0
      apps/file-browser.c
  2. BIN
      base/usr/share/icons/48/py.bmp

+ 9 - 0
apps/file-browser.c

@@ -636,6 +636,15 @@ static void load_directory(const char * path, int modifies_history) {
 						} else {
 							sprintf(f->filetype, "Shell Script");
 						}
+					} else if (has_extension(f, ".py")) {
+						sprintf(f->icon, "py");
+						if (statbuf.st_mode & 0111) {
+							/* Make executable */
+							sprintf(f->launcher, "SELF");
+							sprintf(f->filetype, "Executable Python Script");
+						} else {
+							sprintf(f->filetype, "Python Script");
+						}
 					} else if (has_extension(f, ".ko")) {
 						sprintf(f->icon, "file");
 						sprintf(f->filetype, "Kernel Module");

BIN
base/usr/share/icons/48/py.bmp