From 63e33e0047a77a37cfcfa2a66dfcdfc5f38c534c Mon Sep 17 00:00:00 2001 From: monsta Date: Mon, 19 Dec 2016 15:09:27 +0300 Subject: snippets plugin: kill useless code --- plugins/snippets/snippets/__init__.py | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'plugins') 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 -- cgit v1.2.1