~tualatrix/ubuntu-tweak/trunk

« back to all changes in this revision

Viewing changes to ubuntutweak/settings/common.py

  • Committer: Tualatrix Chou
  • Date: 2012-05-12 15:24:42 UTC
  • mfrom: (1842.1.3 ubuntu-tweak-0.7.x)
  • Revision ID: tualatrix@gmail.com-20120512152442-3dfde9gh5mqc8jv4
Fix Invalid values for resetting fonts and all other tests (Bug: #998411)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
from lxml import etree
6
6
 
7
 
 
8
7
log = logging.getLogger('CommonSetting')
9
8
 
10
9
class RawConfigSetting(object):
36
35
            value = True
37
36
 
38
37
        # This is a hard code str type, so return '"xxx"' instead of 'xxx'
39
 
        if self._type == str:
 
38
        if self._type == str or type(value) == str:
40
39
            if (value.startswith('"') and value.endswith('"')) or \
41
40
               (value.startswith("'") and value.endswith("'")):
42
41
                value = eval(value)
92
91
 
93
92
    @classmethod
94
93
    def load_override(cls):
 
94
        log.debug("\tLoading override")
95
95
        for override in glob.glob('/usr/share/glib-2.0/schemas/*.gschema.override'):
96
96
            try:
97
97
                cs = RawConfigSetting(override)
104
104
 
105
105
    @classmethod
106
106
    def load_schema(cls, schema_id, key):
 
107
        log.debug("Loading schema value for: %s/%s" % (schema_id, key))
107
108
        if not cls.cached_override:
108
109
            cls.load_override()
109
110