##// END OF EJS Templates
ui: add the possiblity to get a date config field...
Boris Feld -
r32408:420e93b0 default
parent child Browse files
Show More
@@ -598,6 +598,19 b' class ui(object):'
598 return self.configwith(config.parselist, section, name, default or [],
598 return self.configwith(config.parselist, section, name, default or [],
599 'list', untrusted)
599 'list', untrusted)
600
600
601 def configdate(self, section, name, default=None, untrusted=False):
602 """parse a configuration element as a tuple of ints
603
604 >>> u = ui(); s = 'foo'
605 >>> u.setconfig(s, 'date', '0 0')
606 >>> u.configdate(s, 'date')
607 (0, 0)
608 """
609 if self.config(section, name, default, untrusted):
610 return self.configwith(util.parsedate, section, name, default,
611 'date', untrusted)
612 return default
613
601 def hasconfig(self, section, name, untrusted=False):
614 def hasconfig(self, section, name, untrusted=False):
602 return self._data(untrusted).hasitem(section, name)
615 return self._data(untrusted).hasitem(section, name)
603
616
General Comments 0
You need to be logged in to leave comments. Login now