##// END OF EJS Templates
namespaces: add logname member to namespace object...
Sean Farley -
r23874:fef1146b default
parent child Browse files
Show More
@@ -120,12 +120,14 b' class namespace(object):'
120
120
121 """
121 """
122
122
123 def __init__(self, name, templatename=None, listnames=None, namemap=None,
123 def __init__(self, name, templatename=None, logname=None, listnames=None,
124 nodemap=None):
124 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
130 is used
129 listnames: function to list all names
131 listnames: function to list all names
130 namemap: function that inputs a node, output name(s)
132 namemap: function that inputs a node, output name(s)
131 nodemap: function that inputs a name, output node(s)
133 nodemap: function that inputs a name, output node(s)
@@ -133,10 +135,15 b' class namespace(object):'
133 """
135 """
134 self.name = name
136 self.name = name
135 self.templatename = templatename
137 self.templatename = templatename
138 self.logname = logname
136 self.listnames = listnames
139 self.listnames = listnames
137 self.namemap = namemap
140 self.namemap = namemap
138 self.nodemap = nodemap
141 self.nodemap = nodemap
139
142
143 # if logname is not specified, use the template name as backup
144 if self.logname is None:
145 self.logname = self.templatename
146
140 def names(self, repo, node):
147 def names(self, repo, node):
141 """method that returns a (sorted) list of names in a namespace that
148 """method that returns a (sorted) list of names in a namespace that
142 match a given node"""
149 match a given node"""
General Comments 0
You need to be logged in to leave comments. Login now