~francesco-marella/specto/blacklist-plugins

« back to all changes in this revision

Viewing changes to spectlib/main.py

Merge the full fix for issue 267: Specto should provide its name in user agent

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
        self.logger = Logger(self)
82
82
 
83
83
        self.check_instance() #see if specto is already running
 
84
        self.VERSION = self.get_version_number()  # The Specto version number
84
85
        self.specto_gconf = specto_gconf
85
86
        self.check_default_settings()
86
87
        self.GTK = GTK
184
185
                self.specto_gconf.set_entry(default_setting[0], \
185
186
                                                    default_setting[1])
186
187
 
 
188
    def get_version_number(self):
 
189
        """Return the Specto version number"""
 
190
        version_file_path = (os.path.join(self.util.get_path(category="doc"), "VERSION"))
 
191
        version_file = open(version_file_path, 'r')
 
192
        version = str(version_file.readline()[:-1])
 
193
        version_file.close
 
194
        return version
 
195
 
187
196
    def check_instance(self):
188
197
        """ Check if specto is already running. """
189
198
        pidfile = self.SPECTO_DIR + "/" + "specto.pid"