~ubuntu-branches/ubuntu/precise/gedit/precise

« back to all changes in this revision

Viewing changes to plugins/externaltools/tools/library.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-04-14 16:41:13 UTC
  • mfrom: (1.1.78 upstream)
  • Revision ID: james.westby@ubuntu.com-20100414164113-0xgl3u73pcs0ngbc
Tags: 2.30.0git20100413-0ubuntu1
* Updating to git snaptshot since 2.30.1 will be after lucid
* debian/patches/90_autoconf.patch:
  - new version update

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
        # self.locations[0] is where we save the custom scripts
49
49
        if platform.platform() == 'Windows':
50
 
            self.locations.insert(0, os.path.expanduser('~/gedit/tools'))
 
50
            toolsdir = os.path.expanduser('~/gedit/tools')
51
51
        else:
52
 
            self.locations.insert(0, os.path.expanduser('~/.gnome2/gedit/tools'))
 
52
            userdir = os.getenv('GNOME22_USER_DIR')
 
53
            if userdir:
 
54
                toolsdir = os.path.join(userdir, 'gedit/tools')
 
55
            else:
 
56
                toolsdir = os.path.expanduser('~/.gnome2/gedit/tools')
 
57
 
 
58
        self.locations.insert(0, toolsdir);
53
59
 
54
60
        if not os.path.isdir(self.locations[0]):
55
61
            os.makedirs(self.locations[0])
72
78
    # storage file.
73
79
    def import_old_xml_store(self):
74
80
        import xml.etree.ElementTree as et
75
 
        filename = os.path.expanduser('~/.gnome2/gedit/gedit-tools.xml')
 
81
        userdir = os.getenv('GNOME22_USER_DIR')
 
82
        if userdir:
 
83
            filename = os.path.join(userdir, 'gedit/gedit-tools.xml')
 
84
        else:
 
85
            filename = os.path.expanduser('~/.gnome2/gedit/gedit-tools.xml')
 
86
 
76
87
        if not os.path.isfile(filename):
77
88
            return
78
89