summaryrefslogtreecommitdiff
path: root/plugins/externaltools/tools
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-11-07 21:10:16 -0300
committerPerberos <[email protected]>2011-11-07 21:10:16 -0300
commit421415f7cb1ba9c8a97a1837d4f789242c2fb0e6 (patch)
treeff577138b5844466f1a22527c4f92e805a607c7c /plugins/externaltools/tools
parent1d63a49a77ab8f7d01daef6ce18e57100508067b (diff)
downloadpluma-421415f7cb1ba9c8a97a1837d4f789242c2fb0e6.tar.bz2
pluma-421415f7cb1ba9c8a97a1837d4f789242c2fb0e6.tar.xz
using ./config/ instead of ./mate2/
Diffstat (limited to 'plugins/externaltools/tools')
-rwxr-xr-xplugins/externaltools/tools/library.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins/externaltools/tools/library.py b/plugins/externaltools/tools/library.py
index e3dc624c..039e0a50 100755
--- a/plugins/externaltools/tools/library.py
+++ b/plugins/externaltools/tools/library.py
@@ -35,13 +35,13 @@ class Singleton(object):
class ToolLibrary(Singleton):
def __init_once__(self):
self.locations = []
-
+
def set_locations(self, datadir):
self.locations = []
if platform.platform() != 'Windows':
for d in self.get_xdg_data_dirs():
- self.locations.append(os.path.join(d, 'pluma-2', 'plugins', 'externaltools', 'tools'))
+ self.locations.append(os.path.join(d, 'pluma', 'plugins', 'externaltools', 'tools'))
self.locations.append(datadir)
@@ -53,7 +53,7 @@ class ToolLibrary(Singleton):
if userdir:
toolsdir = os.path.join(userdir, 'pluma/tools')
else:
- toolsdir = os.path.expanduser('~/.mate2/pluma/tools')
+ toolsdir = os.path.expanduser('~/.config/pluma/tools')
self.locations.insert(0, toolsdir);
@@ -82,7 +82,7 @@ class ToolLibrary(Singleton):
if userdir:
filename = os.path.join(userdir, 'pluma/pluma-tools.xml')
else:
- filename = os.path.expanduser('~/.mate2/pluma/pluma-tools.xml')
+ filename = os.path.expanduser('~/.config/pluma/pluma-tools.xml')
if not os.path.isfile(filename):
return
@@ -226,7 +226,7 @@ class Tool(object):
return []
else:
return map(lambda x: x.strip(), value.split(','))
-
+
def _from_list(self, value):
return ','.join(value)
@@ -266,7 +266,7 @@ class Tool(object):
break
fp.close()
self.changed = False
-
+
def _set_property_if_changed(self, key, value):
if value != self._properties.get(key):
self._properties[key] = value
@@ -350,7 +350,7 @@ class Tool(object):
def set_save_files(self, value):
self._set_property_if_changed('Save-files', value)
save_files = property(get_save_files, set_save_files)
-
+
def get_languages(self):
languages = self._properties.get('Languages')
if languages: return languages
@@ -371,7 +371,7 @@ class Tool(object):
for line in fp:
if line.strip() == '':
continue
-
+
return line.startswith('#!')
# There is no property for this one because this function is quite
@@ -417,7 +417,7 @@ class Tool(object):
def save_with_script(self, script):
filename = self.library.get_full_path(self.filename, 'w')
-
+
fp = open(filename, 'w', 1)
# Make sure to first print header (shebang, modeline), then
@@ -429,7 +429,7 @@ class Tool(object):
# Parse
for line in script:
line = line.rstrip("\n")
-
+
if not inheader:
content.append(line)
elif line.startswith('#!'):
@@ -444,10 +444,10 @@ class Tool(object):
# Write out header
for line in header:
fp.write(line + "\n")
-
+
fp.write(self._dump_properties())
fp.write("\n")
-
+
for line in content:
fp.write(line + "\n")