se usa __eq__ en vez de same
FossilOrigin-Name: 96875a241ba61f2072f531e8845ae7dd981c9739c5d322555035243214204e4f
This commit is contained in:
parent
2a1f3b6b43
commit
c50f1df1e7
@ -144,7 +144,7 @@ class Proveedor:
|
|||||||
ambiente = fexml.get_element_attribute(scopexml.xpath_from_root('/InformacionGeneral'), 'Ambiente')
|
ambiente = fexml.get_element_attribute(scopexml.xpath_from_root('/InformacionGeneral'), 'Ambiente')
|
||||||
codigo_qr = f"https://catalogo-vpfe.dian.gov.co/document/searchqr?documentkey={cune}"
|
codigo_qr = f"https://catalogo-vpfe.dian.gov.co/document/searchqr?documentkey={cune}"
|
||||||
|
|
||||||
if InformacionGeneral.AMBIENTE_PRUEBAS.same(ambiente):
|
if InformacionGeneral.AMBIENTE_PRUEBAS == ambiente:
|
||||||
codigo_qr = f"https://catalogo-vpfe-hab.dian.gov.co/document/searchqr?documentkey={cune}"
|
codigo_qr = f"https://catalogo-vpfe-hab.dian.gov.co/document/searchqr?documentkey={cune}"
|
||||||
elif ambiente is None:
|
elif ambiente is None:
|
||||||
raise RuntimeError('fail to get InformacionGeneral/@Ambiente')
|
raise RuntimeError('fail to get InformacionGeneral/@Ambiente')
|
||||||
@ -219,9 +219,8 @@ class InformacionGeneral:
|
|||||||
class TIPO_AMBIENTE:
|
class TIPO_AMBIENTE:
|
||||||
valor: str
|
valor: str
|
||||||
|
|
||||||
@classmethod
|
def __eq__(self, other):
|
||||||
def same(cls, value):
|
return self.valor == str(other)
|
||||||
return cls.valor == str(value)
|
|
||||||
|
|
||||||
# TABLA 5.1.1
|
# TABLA 5.1.1
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -243,9 +242,8 @@ class InformacionGeneral:
|
|||||||
class TIPO_XML:
|
class TIPO_XML:
|
||||||
valor: str
|
valor: str
|
||||||
|
|
||||||
@classmethod
|
def __eq__(self, other):
|
||||||
def same(cls, value):
|
return self.valor == str(other)
|
||||||
return cls.valor == str(value)
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class TIPO_XML_NORMAL(TIPO_XML):
|
class TIPO_XML_NORMAL(TIPO_XML):
|
||||||
|
Loading…
Reference in New Issue
Block a user