MCPcopy Index your code
hub / github.com/tinode/chat / Resolve

Class Resolve

tn-cli/macros.py:109–130  ·  view source on GitHub ↗

Looks up user id by login name and prints it.

Source from the content-addressed store, hash-verified

107
108
109class Resolve(Macro):
110 """Looks up user id by login name and prints it."""
111
112 def name(self):
113 return "resolve"
114
115 def description(self):
116 return "Resolve login and print the corresponding user id"
117
118 def add_parser_args(self):
119 self.parser.add_argument('login', help='login to resolve')
120
121 def expand(self, id, cmd, args):
122 if not cmd.login:
123 return None
124
125 varname = cmd.varname if hasattr(cmd, 'varname') and cmd.varname else '$temp'
126 return ['.must sub fnd',
127 '.must set fnd --public=basic:%s' % cmd.login,
128 '.must %s get fnd --sub' % varname,
129 '.must leave fnd',
130 '.log %s.sub[0].topic' % varname]
131
132
133class Passwd(Macro):

Callers 1

macros.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…