diff options
author | Jonas Smedegaard <dr@jones.dk> | 2008-10-19 19:35:33 (GMT) |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2008-10-19 19:35:33 (GMT) |
commit | ea33b62a5af02efb21f07ea3cf30ecc460e6ac82 (patch) | |
tree | 4688f03aedd1a2165c4bf464c9912ccedfc61a58 | |
parent | 76a8fd7a789bab34eef7ab0de1eaa13ad7570cb9 (diff) | |
parent | e50692d4e77e6ece151e6090f5c527ae6936291c (diff) |
Merge commit 'v0.4.5'
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | data/prefs.js | 3 | ||||
-rw-r--r-- | python/__init__.py | 39 |
3 files changed, 40 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 1efd856..6d81b09 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ m4_define([hulahop_build_id],[2008072400]) # FIXME: when should we update this? -m4_define([hulahop_version],[0.4.3]) +m4_define([hulahop_version],[0.4.5]) AC_INIT([hulahop],[hulahop_version],[],[hulahop]) diff --git a/data/prefs.js b/data/prefs.js index a20d414..93f203e 100644 --- a/data/prefs.js +++ b/data/prefs.js @@ -97,7 +97,4 @@ pref("browser.sessionhistory.max_entries", 50); // Add vendor useragent string pref("general.useragent.locale", "en-US"); -pref("general.useragent.vendor", "OLPC"); -pref("general.useragent.vendorSub", "Update.1"); -pref("general.useragent.vendorComment", "XO"); pref("general.useragent.extra.firefox", "Firefox/3.0"); diff --git a/python/__init__.py b/python/__init__.py index 49ce42a..6065ebe 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -17,6 +17,7 @@ import os import sys +import ConfigParser import gtk @@ -29,6 +30,12 @@ from hulahop import _hulahop _XO_DPI = 200 +_app_version = '' + +def set_app_version(version): + global _app_version + _app_version = version + def startup(profile_path, components_dirs=[]): _hulahop.set_profile_path(profile_path) if not os.path.isdir(profile_path): @@ -37,6 +44,8 @@ def startup(profile_path, components_dirs=[]): except OSError, exc: raise RuntimeError('Could not create user directory.') + _check_compreg(profile_path) + for path in components_dirs: _hulahop.add_components_path(path) @@ -49,6 +58,36 @@ def startup(profile_path, components_dirs=[]): branch = prefService.getBranch('') branch.setIntPref('layout.css.dpi', _get_layout_dpi()) +def _check_compreg(profile_path): + comp_path = os.path.join(profile_path, 'compatibility.ini') + existant = True + valid = True + + try: + cp = ConfigParser.ConfigParser(defaults={'app_version' : ''}) + if not cp.read(comp_path): + existant = False + else: + valid = cp.get('main', 'app_version') == _app_version and \ + cp.get('main', 'libxul_dir') == config.libxul_dir + except ConfigParser.Error: + valid = False + + if not valid and existant: + compreg = os.path.join(profile_path, 'compreg.dat') + + os.unlink(comp_path) + os.unlink(compreg) + + cp = ConfigParser.ConfigParser() + cp.add_section('main') + cp.set('main', 'app_version', _app_version) + cp.set('main', 'libxul_dir', config.libxul_dir) + + f = open(comp_path, 'w') + cp.write(f) + f.close() + def _get_layout_dpi(): gtk_xft_dpi = gtk.settings_get_default().get_property('gtk-xft-dpi') screen_dpi = gtk_xft_dpi / 1024 |