diff options
author | monsta <[email protected]> | 2016-12-19 15:09:27 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-12-19 16:36:16 +0300 |
commit | 63e33e0047a77a37cfcfa2a66dfcdfc5f38c534c (patch) | |
tree | 9574965f22b898c2cd49aeb2356ad7fe7435fb06 | |
parent | 6cb4912d8ca947bb0c99a3a6ed495cd40ff1662d (diff) | |
download | pluma-63e33e0047a77a37cfcfa2a66dfcdfc5f38c534c.tar.bz2 pluma-63e33e0047a77a37cfcfa2a66dfcdfc5f38c534c.tar.xz |
snippets plugin: kill useless code
-rwxr-xr-x | plugins/snippets/snippets/__init__.py | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/plugins/snippets/snippets/__init__.py b/plugins/snippets/snippets/__init__.py index e74ecd28..4b8db4b9 100755 --- a/plugins/snippets/snippets/__init__.py +++ b/plugins/snippets/snippets/__init__.py @@ -22,7 +22,6 @@ import shutil import gtk from gtk import gdk import pluma -import platform from WindowHelper import WindowHelper from Library import Library @@ -38,31 +37,22 @@ class SnippetsPlugin(pluma.Plugin): library = Library() library.set_accelerator_callback(self.accelerator_activated) - if platform.platform() == 'Windows': - snippetsdir = os.path.expanduser('~/pluma/snippets') - else: - userdir = os.getenv('MATE22_USER_DIR') - if userdir: - snippetsdir = os.path.join(userdir, 'pluma/snippets') - else: - snippetsdir = os.path.expanduser('~/.config/pluma/snippets') - + snippetsdir = os.path.expanduser('~/.config/pluma/snippets') library.set_dirs(snippetsdir, self.system_dirs()) def system_dirs(self): - if platform.platform() != 'Windows': - if 'XDG_DATA_DIRS' in os.environ: - datadirs = os.environ['XDG_DATA_DIRS'] - else: - datadirs = '/usr/local/share' + os.pathsep + '/usr/share' + if 'XDG_DATA_DIRS' in os.environ: + datadirs = os.environ['XDG_DATA_DIRS'] + else: + datadirs = '/usr/local/share' + os.pathsep + '/usr/share' - dirs = [] + dirs = [] - for d in datadirs.split(os.pathsep): - d = os.path.join(d, 'pluma', 'plugins', 'snippets') + for d in datadirs.split(os.pathsep): + d = os.path.join(d, 'pluma', 'plugins', 'snippets') - if os.path.isdir(d): - dirs.append(d) + if os.path.isdir(d): + dirs.append(d) dirs.append(self.get_data_dir()) return dirs |