当前位置: 首页>>代码示例>>Python>>正文


Python funcions.get_rec_attr函数代码示例

本文整理汇总了Python中switching.helpers.funcions.get_rec_attr函数的典型用法代码示例。如果您正苦于以下问题:Python get_rec_attr函数的具体用法?Python get_rec_attr怎么用?Python get_rec_attr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_rec_attr函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: sollicitud

 def sollicitud(self):
     """Retorna l'objecte Sollicitud"""
     tree = 'PasoMRAMLConCambiosRestoTarifa.DatosSolicitud'
     sol = get_rec_attr(self.obj, tree, False)
     if sol:
         return C1.Sollicitud(sol)
     else:
         return False
开发者ID:gisce,项目名称:switching,代码行数:8,代码来源:A3.py

示例2: client

 def client(self):
     """Retorna l'objecte Client"""
     tree = 'PasoMRAMLConCambiosRestoTarifa.Cliente'
     cli = get_rec_attr(self.obj, tree, False)
     if cli:
         return C1.Client(cli)
     else:
         return False
开发者ID:gisce,项目名称:switching,代码行数:8,代码来源:A3.py

示例3: contracte

 def contracte(self):
     """Retorna l'objecte Contracte"""
     tree = '{0}.Contrato'.format(self.header)
     cont = get_rec_attr(self.obj, tree, False)
     if cont:
         return C1.Contracte(cont)
     else:
         return False
开发者ID:gisce,项目名称:switching,代码行数:8,代码来源:C2.py

示例4: gir_comptador

 def gir_comptador(self):
     num_ruedas = int(get_rec_attr(
         self.factura,
         'Medidas.Aparato.Integrador.NumeroRuedasEnteras.text',
         0
     ))
     if num_ruedas > 0:
         num_ruedas = 10 ** num_ruedas
     return num_ruedas
开发者ID:kailIII,项目名称:switching,代码行数:9,代码来源:F1.py

示例5: contracted_powers

 def contracted_powers(self):
     """Returns the contracted powers"""
     try:
         termino_potencia = get_rec_attr(
             self.factura.Potencia, 'TerminoPotencia'
         )
         return [
             int(aux.PotenciaContratada) for aux in termino_potencia.Periodo
         ]
     except AttributeError:
         return []
开发者ID:gisce,项目名称:switching,代码行数:11,代码来源:F1.py

示例6: _get_comptadors

 def _get_comptadors(self, obj=None):
     """Retorna totes les lectures en una llista de comptadors"""
     if obj is None:
         obj = self.obj
     comptadors = []
     for mesura in get_rec_attr(obj, 'Medidas', []):
         if mesura.CodUnificadoPuntoSuministro.text[:20] == \
                                                 self.get_codi[:20]:
             for aparell in mesura.Aparato:
                 compt = Comptador(aparell)
                 di, df = compt.dates_inici_i_final
                 comptadors.append((di, df, compt))
     return [a[2] for a in sorted(comptadors, lambda x,y: cmp(x[0], y[0]))]
开发者ID:kailIII,项目名称:switching,代码行数:13,代码来源:Q1.py

示例7: has_quantity

 def has_quantity(self):
     # If the quantity is 0 we will assume it's incorrect
     return bool(get_rec_attr(self.concepte, 'UnidadesConcepto.text', 0))
开发者ID:gisce,项目名称:switching,代码行数:3,代码来源:F1.py

示例8: codi

 def codi(self):
     return get_rec_attr(self.concepte_iva, 'Concepto.text')
开发者ID:kailIII,项目名称:switching,代码行数:2,代码来源:F1.py

示例9: has_price

 def has_price(self):
     # If the price is 0 we will assume it's incorrect
     return bool(
         get_rec_attr(self.concepte, 'ImporteUnidadConcepto.text', 0)
     )
开发者ID:gisce,项目名称:switching,代码行数:5,代码来源:F1.py

示例10: base

 def base(self):
     return float(
         get_rec_attr(self.iva, 'BaseImponible.text', 0)
     )
开发者ID:gisce,项目名称:switching,代码行数:4,代码来源:F1.py

示例11: percentage

 def percentage(self):
     return float(
         get_rec_attr(self.iva, 'Porcentaje.text', 0)
     )
开发者ID:gisce,项目名称:switching,代码行数:4,代码来源:F1.py

示例12: te_ajust

 def te_ajust(self):
     res = get_rec_attr(self.lectura, 'Ajuste', default={})
     return len(res) > 0
开发者ID:gisce,项目名称:switching,代码行数:3,代码来源:Q1.py

示例13: importe

 def importe(self):
     return float(
         get_rec_attr(self.iva, 'Importe.text', 0)
     )
开发者ID:gisce,项目名称:switching,代码行数:4,代码来源:F1.py


注:本文中的switching.helpers.funcions.get_rec_attr函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。