Show More
@@ -120,14 +120,16 b' class namespace(object):' | |||||
120 |
|
120 | |||
121 | """ |
|
121 | """ | |
122 |
|
122 | |||
123 |
def __init__(self, name, templatename=None, logname=None, |
|
123 | def __init__(self, name, templatename=None, logname=None, colorname=None, | |
124 | namemap=None, nodemap=None): |
|
124 | listnames=None, namemap=None, nodemap=None): | |
125 | """create a namespace |
|
125 | """create a namespace | |
126 |
|
126 | |||
127 | name: the namespace to be registered (in plural form) |
|
127 | name: the namespace to be registered (in plural form) | |
128 | templatename: the name to use for templating |
|
128 | templatename: the name to use for templating | |
129 | logname: the name to use for log output; if not specified templatename |
|
129 | logname: the name to use for log output; if not specified templatename | |
130 | is used |
|
130 | is used | |
|
131 | colorname: the name to use for colored log output; if not specified | |||
|
132 | logname is used | |||
131 | listnames: function to list all names |
|
133 | listnames: function to list all names | |
132 | namemap: function that inputs a node, output name(s) |
|
134 | namemap: function that inputs a node, output name(s) | |
133 | nodemap: function that inputs a name, output node(s) |
|
135 | nodemap: function that inputs a name, output node(s) | |
@@ -136,6 +138,7 b' class namespace(object):' | |||||
136 | self.name = name |
|
138 | self.name = name | |
137 | self.templatename = templatename |
|
139 | self.templatename = templatename | |
138 | self.logname = logname |
|
140 | self.logname = logname | |
|
141 | self.colorname = colorname | |||
139 | self.listnames = listnames |
|
142 | self.listnames = listnames | |
140 | self.namemap = namemap |
|
143 | self.namemap = namemap | |
141 | self.nodemap = nodemap |
|
144 | self.nodemap = nodemap | |
@@ -144,6 +147,10 b' class namespace(object):' | |||||
144 | if self.logname is None: |
|
147 | if self.logname is None: | |
145 | self.logname = self.templatename |
|
148 | self.logname = self.templatename | |
146 |
|
149 | |||
|
150 | # if colorname is not specified, just use the logname as a backup | |||
|
151 | if self.colorname is None: | |||
|
152 | self.colorname = self.logname | |||
|
153 | ||||
147 | def names(self, repo, node): |
|
154 | def names(self, repo, node): | |
148 | """method that returns a (sorted) list of names in a namespace that |
|
155 | """method that returns a (sorted) list of names in a namespace that | |
149 | match a given node""" |
|
156 | match a given node""" |
General Comments 0
You need to be logged in to leave comments.
Login now