104 |
or self.checked is not None |
or self.checked is not None |
105 |
or self.dyntext is not None) |
or self.dyntext is not None) |
106 |
|
|
107 |
|
def IsTool(self): |
108 |
|
"""Return whether the command represents a tool. |
109 |
|
|
110 |
|
This default implementation always returns 0. |
111 |
|
""" |
112 |
|
return 0 |
113 |
|
|
114 |
def Execute(self, context, args = ()): |
def Execute(self, context, args = ()): |
115 |
kw = self.kwargs |
kw = self.kwargs |
116 |
if kw is None: |
if kw is None: |
120 |
#print self.name, self.args, args |
#print self.name, self.args, args |
121 |
apply(self.function, (context,) + self.args + args, kw) |
apply(self.function, (context,) + self.args + args, kw) |
122 |
|
|
123 |
|
class ToolCommand(Command): |
124 |
|
|
125 |
|
"""A command tool activating a tool""" |
126 |
|
|
127 |
|
def IsTool(self): |
128 |
|
"""Return whether the command represents a tool, i.e. always 1""" |
129 |
|
return 1 |
130 |
|
|
131 |
|
|
132 |
class CommandRegistry: |
class CommandRegistry: |
133 |
|
|