def testExpandPlacementVars(self): """tests lyntin.utils.expand_placement_vars""" from lyntin.utils import expand_placement_vars for i in range(0, len(self.t)): c, s = self.t[i] self.assertEquals(expand_placement_vars(self.c, c), s, "test %d" % i)
def userfilter(self, args): """ user_filter_hook. """ # we check for aliases here--and if we find some, we # do the variable expansion and then recurse over the result ses = args["session"] internal = args["internal"] verbatim = args["verbatim"] text = args["dataadj"] if ses not in self._aliasdata or verbatim == 1: return text aliasexpansion = self._aliasdata[ses].expand(text) if not aliasexpansion: return text else: aliasexpansion = utils.expand_placement_vars(text, aliasexpansion) exported.lyntin_command(aliasexpansion, 1, ses) return None
def userfilter(self, args): """ user_filter_hook. """ # we check for aliases here--and if we find some, we # do the variable expansion and then recurse over the result ses = args["session"] internal = args["internal"] verbatim = args["verbatim"] text = args["dataadj"] if not self._aliasdata.has_key(ses) or verbatim == 1: return text aliasexpansion = self._aliasdata[ses].expand(text) if not aliasexpansion: return text else: aliasexpansion = utils.expand_placement_vars(text, aliasexpansion) exported.lyntin_command(aliasexpansion, 1, ses) return None