~ubuntu-branches/ubuntu/jaunty/gdesklets/jaunty-proposed

« back to all changes in this revision

Viewing changes to scripting/ControlWrapper.py

  • Committer: Bazaar Package Importer
  • Author(s): Loic Minier
  • Date: 2006-06-14 19:19:07 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20060614191907-yktrjkep30abmrfn
Tags: 0.35.3-4
Don't ship /usr/share/mime/mime.cache. (Closes: #373600)

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
class ControlWrapper(object):
10
10
 
11
11
    def __init__(self, control):
12
 
        
 
12
 
13
13
        self.__dict__["_ControlWrapper__control"] = Vault(control)
14
 
        self.__dict__["_ControlWrapper__properties"] = Vault(control.get_properties())
 
14
        self.__dict__["_ControlWrapper__properties"] = \
 
15
                     Vault( dict(Interface.get_properties(control.__class__)) )
15
16
 
16
 
        ids =  [ i.get_id()
 
17
        ids =  [ Interface.get_id(i)
17
18
                 for i in Interface.get_interfaces( control.__class__ ) ]
18
 
        
19
 
        self.__dict__["_ControlWrapper__ifaces_id"] = Vault( tuple(ids) )
 
19
        taz_ids = [ Interface.get_taz_style_id(i)
 
20
                    for i in Interface.get_interfaces( control.__class__ ) ]
 
21
 
 
22
        self.__dict__["_ControlWrapper__ifaces_id"] = \
 
23
                                                  Vault( tuple(ids + taz_ids) )
20
24
 
21
25
 
22
26
 
24
28
 
25
29
        try:
26
30
            prop = self.__properties(open)[name]
27
 
            prop.fset(self.__control(open), value)
28
 
        except:
29
 
            import traceback; traceback.print_exc()
 
31
        except KeyError:
 
32
            log("Warning: Property \"%s\" isn't available." % (name,))
 
33
            return
 
34
 
 
35
        prop.fset(self.__control(open), value)
 
36
 
30
37
 
31
38
 
32
39
    def __getattr__(self, name):
36
43
 
37
44
        try:
38
45
            prop = self.__properties(open)[name]
39
 
            return prop.fget(self.__control(open))
40
 
        except:
41
 
            import traceback; traceback.print_exc()
42
 
            return Null
 
46
        except KeyError:
 
47
            log("Warning: Property \"%s\" isn't available." % (name,))
 
48
            return None
 
49
 
 
50
        return prop.fget(self.__control(open))
 
51
 
43
52
 
44
53
 
45
54
    def get_interfaces_id(self):
48
57
        @return : implemented interfaces' id
49
58
        @rtype : list of str
50
59
        """
51
 
        
 
60
 
52
61
        return self.__ifaces_id(open)
53
62