forked from merlinthered/sublime-rainmeter
-
Notifications
You must be signed in to change notification settings - Fork 3
/
openskinsfolder.py
28 lines (20 loc) · 921 Bytes
/
openskinsfolder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""This module provides a command to open the Rainmeter Skin folder."""
import os.path
import sublime
import sublime_plugin
from .path.skin_path_provider import get_cached_skin_path
class RainmeterOpenSkinsFolderCommand(sublime_plugin.WindowCommand): #pylint: disable=R0903; sublime text API, methods are overriden
"""
WindowCommands are instantiated once per window.
The Window object may be retrieved via self.window.
"""
def run(self):
"""Called when the command is run."""
skinspath = get_cached_skin_path()
if not skinspath or not os.path.exists(skinspath):
sublime.error_message(
"Error while trying to open Rainmeter" +
" skins folder: Directory not found. Please check the" +
" value of your \"skins_path\" setting.")
return
self.window.run_command("open_dir", {"dir": skinspath})