| Total Complexity | 2 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import os |
||
| 10 | class RainmeterOpenSkinAsProjectCommand(sublime_plugin.ApplicationCommand): |
||
| 11 | |||
| 12 | def run(self): |
||
| 13 | skins_path = get_cached_skin_path() |
||
| 14 | skins = os.listdir(skins_path) |
||
| 15 | |||
| 16 | sublime.active_window().show_quick_panel(skins, self.on_skin_selected, 0, 0, None) |
||
| 17 | |||
| 18 | def on_skin_selected(self, selected_skin_id): |
||
| 19 | skins_path = get_cached_skin_path() |
||
| 20 | skins = os.listdir(skins_path) |
||
| 21 | selected_skin = skins[selected_skin_id] |
||
| 22 | selected_skin_path = os.path.join(skins_path, selected_skin) |
||
| 23 | |||
| 24 | # to open a folder in new window, just create a new process with the folder as argument |
||
| 25 | st_path = sublime.executable_path() |
||
| 26 | subprocess.Popen([ |
||
| 27 | st_path, |
||
| 28 | selected_skin_path |
||
| 29 | ]) |
||
| 30 |