本文整理汇总了Python中pyrser.fmt.sep函数的典型用法代码示例。如果您正苦于以下问题:Python sep函数的具体用法?Python sep怎么用?Python sep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sep函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: to_c
def to_c(self):
lsparams = []
for p in self.params:
lsparams.append(p.to_c())
if type(self.call_expr) is nodes.Raw and self.call_expr.value == ",":
return fmt.sep(str(self.call_expr.to_c()) + ' ', lsparams)
return fmt.sep(' ' + str(self.call_expr.to_c()) + ' ', lsparams)
开发者ID:Py0s,项目名称:KooC,代码行数:7,代码来源:to_c.py
示例2: to_fmt
def to_fmt(self, with_from=False) -> fmt.indentable:
txt = fmt.block("{\n", "\n}", [])
items = fmt.sep("\n---\n", [])
for k in sorted(self._internal.keys()):
items.lsdata.append(fmt.sep(": ", [k, fmt.tab([self._internal[k].to_fmt(with_from)])]))
txt.lsdata.append(fmt.tab([items]))
return txt
开发者ID:vhb,项目名称:pyrser,代码行数:7,代码来源:to_fmt.py
示例3: to_tl4t
def to_tl4t(self):
params = []
for p in self.p:
params.append(p.to_tl4t())
parenth = fmt.block('(', ')', fmt.sep(', ', params))
lsblock = fmt.sep('', [
self.call_expr.to_tl4t(),
parenth
])
return lsblock
开发者ID:Atch0um,项目名称:pyrser,代码行数:10,代码来源:tl4t.py
示例4: to_fmt
def to_fmt(self) -> fmt.indentable:
txt = fmt.sep("", [self.name])
if len(self.attributes) > 0:
lsattr = fmt.sep(", ", [])
lkey = sorted(self.attributes.keys())
for k in lkey:
t = k
if self.attributes[k] is not None:
t += '=' + str(self.attributes[k])
lsattr.lsdata.append(t)
txt.lsdata.append(fmt.block("[", "]", lsattr))
return txt
开发者ID:Atch0um,项目名称:pyrser,代码行数:12,代码来源:type_expr.py
示例5: to_fmt
def to_fmt(self) -> fmt.indentable:
"""
Return an Fmt representation for pretty-printing
"""
lsb = []
if len(self._lsig) > 0:
for s in self._lsig:
lsb.append(s.to_fmt())
block = fmt.block("(", ")", fmt.sep(', ', lsb))
qual = "tuple"
txt = fmt.sep("", [qual, block])
return txt
开发者ID:Atch0um,项目名称:pyrser,代码行数:12,代码来源:tuple.py
示例6: to_fmt
def to_fmt(self) -> fmt.indentable:
res = fmt.sep('', [])
if self.v is None:
res.lsdata.append('*')
else:
res.lsdata.append(repr(self.v))
return res
开发者ID:Atch0um,项目名称:pyrser,代码行数:7,代码来源:match.py
示例7: to_fmt
def to_fmt(self) -> fmt.indentable:
res = fmt.sep('\n', [])
res.lsdata.append("kind: %s" % self.kind)
if self.parent is not None:
res.lsdata.append("parent: %d" % id(self.parent))
res.lsdata.append("node: %d" % id(self.node))
return res
开发者ID:vhb,项目名称:pyrser,代码行数:7,代码来源:state.py
示例8: to_fmt
def to_fmt(self) -> fmt.indentable:
res = fmt.sep('', [])
if self.t is not object:
res.lsdata.append(self.t.__name__)
else:
res.lsdata.append('*')
iparen = []
if self.attrs is not None:
# TODO: render unknown attr (.?) at the end after ..., also unknown attr implie 'unstrict' mode
iparen = fmt.sep(', ', [])
for a in self.attrs:
iparen.lsdata.append(a.to_fmt())
if not self.strict:
iparen.lsdata.append('...')
if self.iskindof:
paren = fmt.block('^(', ')', iparen)
else:
paren = fmt.block('(', ')', iparen)
res.lsdata.append(paren)
return res
开发者ID:vhb,项目名称:pyrser,代码行数:20,代码来源:match.py
示例9: to_fmt
def to_fmt(self):
"""
Return an Fmt representation for pretty-printing
"""
params = ""
txt = fmt.sep(" ", ['val'])
name = self.show_name()
if name != "":
txt.lsdata.append(name)
txt.lsdata.append('(%s)' % self.value)
txt.lsdata.append(': ' + self.tret)
return txt
开发者ID:Py0s,项目名称:KooC,代码行数:12,代码来源:val.py
注:本文中的pyrser.fmt.sep函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论