{"action":"created","comment":{"url":"https://api.github.com/repos/kmee/PySPED/pulls/comments/124889437","pull_request_review_id":47224805,"id":124889437,"diff_hunk":"@@ -139,6 +167,58 @@ def set_xml(self, arquivo):\n             self.CPF.xml   = arquivo\n             self.distNSU.xml    = arquivo\n             self.consNSU.xml    = arquivo\n+            self.consChNFe.xml  = arquivo\n+\n+    xml = property(get_xml, set_xml)\n+\n+\n+class ResNFe(XMLNFe):\n+    def __init__(self):\n+        super(ResNFe, self).__init__()\n+        self.chNFe    = TagCaracter(nome='chNFe' , tamanho=[44, 44], raiz='//resNFe')\n+        self.CNPJ     = TagCaracter(nome='CNPJ'  , tamanho=[14, 14], raiz='//resNFe', obrigatorio=False)\n+        self.CPF      = TagCaracter(nome='CPF'   , tamanho=[11, 11], raiz='//resNFe', obrigatorio=False)\n+        self.xNome    = TagCaracter(nome='xNome' , tamanho=[ 1, 60], raiz='//resNFe')\n+        self.IE       = TagCaracter(nome='IE'    , tamanho=[ 2, 14], raiz='//resNFe', obrigatorio=False)\n+        self.dhEmi    = TagDataHoraUTC(nome='dhEmi',                   raiz='//resNFe', obrigatorio=False)\n+        self.tpNF     = TagCaracter(nome='tpNF'  , tamanho=[ 1,  1], raiz='//resNFe')\n+        self.vNF      = TagDecimal(nome='vNF'    , tamanho=[1, 15, 1], decimais=[0, 2, 2], raiz='//resNFe')\n+        self.digVal   = TagCaracter(nome='digVal', tamanho=[28, 28], raiz='//resNFe')\n+        self.dhRecbto = TagDataHoraUTC(nome='dhRecbto', raiz='//resNFe')\n+        self.cSitNFe  = TagCaracter(nome='cSitNFe', tamanho=[ 1,  1], raiz='//resNFe')\n+        self.cSitConf = TagCaracter(nome='cSitConf', tamanho=[ 1,  1], raiz='//resNFe', obrigatorio=False)\n+\n+    def get_xml(self):\n+        xml = XMLNFe.get_xml(self)\n+        xml += self.chNFe.xml\n+        xml += self.CNPJ.xml\n+        xml += self.CPF.xml\n+        xml += self.xNome.xml\n+        xml += self.IE.xml\n+        xml += self.dhEmi.xml\n+        xml += self.tpNF.xml\n+        xml += self.vNF.xml\n+        xml += self.digVal.xml\n+        xml += self.dhRecbto.xml\n+        xml += self.cSitNFe.xml\n+        xml += self.cSitConf.xml\n+        xml += '</resNFe>'\n+        return xml\n+\n+    def set_xml(self, arquivo):\n+        if self._le_xml(arquivo):\n+            self.chNFe.xml   = arquivo","path":"pysped/nfe/leiaute/distdfeint_100.py","position":116,"original_position":113,"commit_id":"d7a0131014cdf2a0fcb3cba2fde254fd4fe5f930","original_commit_id":"c7d9287768770083f8e2feee2adcdf2687e9ab5d","user":{"login":"leorochael","id":239125,"avatar_url":"https://avatars0.githubusercontent.com/u/239125?v=3","gravatar_id":"","url":"https://api.github.com/users/leorochael","html_url":"https://github.com/leorochael","followers_url":"https://api.github.com/users/leorochael/followers","following_url":"https://api.github.com/users/leorochael/following{/other_user}","gists_url":"https://api.github.com/users/leorochael/gists{/gist_id}","starred_url":"https://api.github.com/users/leorochael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leorochael/subscriptions","organizations_url":"https://api.github.com/users/leorochael/orgs","repos_url":"https://api.github.com/users/leorochael/repos","events_url":"https://api.github.com/users/leorochael/events{/privacy}","received_events_url":"https://api.github.com/users/leorochael/received_events","type":"User","site_admin":false},"body":"> > Não seria melhor ter uma lista na classe com o nome de todos os \"segmentos\" (...)\r\n> \r\n> não, porque tem casos em que os segmentos não são lineares com todas as tags na classe; veja o preenchimento do imposto, por exemplo, e dos itens da nota;\r\n\r\nEsse argumento explica (parcialmente) porque o código é repetitivo, mas não explica nem um pouco porque foi usada concatenação de strings ao invés de APIs do etree, que poderiam adicionar tags numa sequência exatamente tão arbitrária quanto o concatenamento de strings, mas que garantiriam que o XML estaria sempre bem formado, sem precisar de truques sujos como fechar tag em escopo diferente do qual foi aberto.\r\n\r\n> tudo na pysped foi pensado pra evitar que o faturamento do cliente pare por problemas técnicos, em libs de terceiros, etc.\r\n\r\nEste é um objetivo muito louvável. Que infelizmente é prejudicado pela decisão abaixo:\r\n\r\n> por isso tudo foi feito o mais possível com strings pura e simplesmente;\r\n\r\nUsar strings puras para compor XML, **aumenta** o risco de que o faturamento pare por conta de problemas em libs de terceiros. Ou, na verdade, aumenta o risco que problemas na PySPED quebrem o código de terceiros, na medida em que facilita a criação de XML mal formado.\r\n\r\nDe todo modo, minhas perguntas e objeções aqui se referem todas a detalhes que já existiam antes no código, e que foram apenas repetidas nesse PR, então não vejo motivo para impedir a inclusão desse PR por causa das minhas objeções.\r\n","created_at":"2017-06-29T19:16:38Z","updated_at":"2017-06-29T19:16:38Z","html_url":"https://github.com/kmee/PySPED/pull/15#discussion_r124889437","pull_request_url":"https://api.github.com/repos/kmee/PySPED/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/kmee/PySPED/pulls/comments/124889437"},"html":{"href":"https://github.com/kmee/PySPED/pull/15#discussion_r124889437"},"pull_request":{"href":"https://api.github.com/repos/kmee/PySPED/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/kmee/PySPED/pulls/15","id":124775955,"html_url":"https://github.com/kmee/PySPED/pull/15","diff_url":"https://github.com/kmee/PySPED/pull/15.diff","patch_url":"https://github.com/kmee/PySPED/pull/15.patch","issue_url":"https://api.github.com/repos/kmee/PySPED/issues/15","number":15,"state":"open","locked":false,"title":"Reabilita conhecimento/download de NFe","user":{"login":"leorochael","id":239125,"avatar_url":"https://avatars0.githubusercontent.com/u/239125?v=3","gravatar_id":"","url":"https://api.github.com/users/leorochael","html_url":"https://github.com/leorochael","followers_url":"https://api.github.com/users/leorochael/followers","following_url":"https://api.github.com/users/leorochael/following{/other_user}","gists_url":"https://api.github.com/users/leorochael/gists{/gist_id}","starred_url":"https://api.github.com/users/leorochael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leorochael/subscriptions","organizations_url":"https://api.github.com/users/leorochael/orgs","repos_url":"https://api.github.com/users/leorochael/repos","events_url":"https://api.github.com/users/leorochael/events{/privacy}","received_events_url":"https://api.github.com/users/leorochael/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-09T01:35:03Z","updated_at":"2017-06-29T19:16:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a2007629d430e25c063504ce292afe6be0c13d4","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/kmee/PySPED/pulls/15/commits","review_comments_url":"https://api.github.com/repos/kmee/PySPED/pulls/15/comments","review_comment_url":"https://api.github.com/repos/kmee/PySPED/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kmee/PySPED/issues/15/comments","statuses_url":"https://api.github.com/repos/kmee/PySPED/statuses/d7a0131014cdf2a0fcb3cba2fde254fd4fe5f930","head":{"label":"kmee:fix/pyxmlsecnext-mde-import","ref":"fix/pyxmlsecnext-mde-import","sha":"d7a0131014cdf2a0fcb3cba2fde254fd4fe5f930","user":{"login":"kmee","id":6465492,"avatar_url":"https://avatars0.githubusercontent.com/u/6465492?v=3","gravatar_id":"","url":"https://api.github.com/users/kmee","html_url":"https://github.com/kmee","followers_url":"https://api.github.com/users/kmee/followers","following_url":"https://api.github.com/users/kmee/following{/other_user}","gists_url":"https://api.github.com/users/kmee/gists{/gist_id}","starred_url":"https://api.github.com/users/kmee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmee/subscriptions","organizations_url":"https://api.github.com/users/kmee/orgs","repos_url":"https://api.github.com/users/kmee/repos","events_url":"https://api.github.com/users/kmee/events{/privacy}","received_events_url":"https://api.github.com/users/kmee/received_events","type":"Organization","site_admin":false},"repo":{"id":24888378,"name":"PySPED","full_name":"kmee/PySPED","owner":{"login":"kmee","id":6465492,"avatar_url":"https://avatars0.githubusercontent.com/u/6465492?v=3","gravatar_id":"","url":"https://api.github.com/users/kmee","html_url":"https://github.com/kmee","followers_url":"https://api.github.com/users/kmee/followers","following_url":"https://api.github.com/users/kmee/following{/other_user}","gists_url":"https://api.github.com/users/kmee/gists{/gist_id}","starred_url":"https://api.github.com/users/kmee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmee/subscriptions","organizations_url":"https://api.github.com/users/kmee/orgs","repos_url":"https://api.github.com/users/kmee/repos","events_url":"https://api.github.com/users/kmee/events{/privacy}","received_events_url":"https://api.github.com/users/kmee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kmee/PySPED","description":"Sistema Público de Escrituração Digital em Python","fork":true,"url":"https://api.github.com/repos/kmee/PySPED","forks_url":"https://api.github.com/repos/kmee/PySPED/forks","keys_url":"https://api.github.com/repos/kmee/PySPED/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kmee/PySPED/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kmee/PySPED/teams","hooks_url":"https://api.github.com/repos/kmee/PySPED/hooks","issue_events_url":"https://api.github.com/repos/kmee/PySPED/issues/events{/number}","events_url":"https://api.github.com/repos/kmee/PySPED/events","assignees_url":"https://api.github.com/repos/kmee/PySPED/assignees{/user}","branches_url":"https://api.github.com/repos/kmee/PySPED/branches{/branch}","tags_url":"https://api.github.com/repos/kmee/PySPED/tags","blobs_url":"https://api.github.com/repos/kmee/PySPED/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kmee/PySPED/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kmee/PySPED/git/refs{/sha}","trees_url":"https://api.github.com/repos/kmee/PySPED/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kmee/PySPED/statuses/{sha}","languages_url":"https://api.github.com/repos/kmee/PySPED/languages","stargazers_url":"https://api.github.com/repos/kmee/PySPED/stargazers","contributors_url":"https://api.github.com/repos/kmee/PySPED/contributors","subscribers_url":"https://api.github.com/repos/kmee/PySPED/subscribers","subscription_url":"https://api.github.com/repos/kmee/PySPED/subscription","commits_url":"https://api.github.com/repos/kmee/PySPED/commits{/sha}","git_commits_url":"https://api.github.com/repos/kmee/PySPED/git/commits{/sha}","comments_url":"https://api.github.com/repos/kmee/PySPED/comments{/number}","issue_comment_url":"https://api.github.com/repos/kmee/PySPED/issues/comments{/number}","contents_url":"https://api.github.com/repos/kmee/PySPED/contents/{+path}","compare_url":"https://api.github.com/repos/kmee/PySPED/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kmee/PySPED/merges","archive_url":"https://api.github.com/repos/kmee/PySPED/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kmee/PySPED/downloads","issues_url":"https://api.github.com/repos/kmee/PySPED/issues{/number}","pulls_url":"https://api.github.com/repos/kmee/PySPED/pulls{/number}","milestones_url":"https://api.github.com/repos/kmee/PySPED/milestones{/number}","notifications_url":"https://api.github.com/repos/kmee/PySPED/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kmee/PySPED/labels{/name}","releases_url":"https://api.github.com/repos/kmee/PySPED/releases{/id}","deployments_url":"https://api.github.com/repos/kmee/PySPED/deployments","created_at":"2014-10-07T11:59:57Z","updated_at":"2017-06-01T17:52:41Z","pushed_at":"2017-06-20T19:36:42Z","git_url":"git://github.com/kmee/PySPED.git","ssh_url":"git@github.com:kmee/PySPED.git","clone_url":"https://github.com/kmee/PySPED.git","svn_url":"https://github.com/kmee/PySPED","homepage":"","size":16742,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":2,"default_branch":"odoo"}},"base":{"label":"kmee:feature/8.0-pyxmlsec-next","ref":"feature/8.0-pyxmlsec-next","sha":"d6256c97746579879cd7172e29ed84402e3338b5","user":{"login":"kmee","id":6465492,"avatar_url":"https://avatars0.githubusercontent.com/u/6465492?v=3","gravatar_id":"","url":"https://api.github.com/users/kmee","html_url":"https://github.com/kmee","followers_url":"https://api.github.com/users/kmee/followers","following_url":"https://api.github.com/users/kmee/following{/other_user}","gists_url":"https://api.github.com/users/kmee/gists{/gist_id}","starred_url":"https://api.github.com/users/kmee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmee/subscriptions","organizations_url":"https://api.github.com/users/kmee/orgs","repos_url":"https://api.github.com/users/kmee/repos","events_url":"https://api.github.com/users/kmee/events{/privacy}","received_events_url":"https://api.github.com/users/kmee/received_events","type":"Organization","site_admin":false},"repo":{"id":24888378,"name":"PySPED","full_name":"kmee/PySPED","owner":{"login":"kmee","id":6465492,"avatar_url":"https://avatars0.githubusercontent.com/u/6465492?v=3","gravatar_id":"","url":"https://api.github.com/users/kmee","html_url":"https://github.com/kmee","followers_url":"https://api.github.com/users/kmee/followers","following_url":"https://api.github.com/users/kmee/following{/other_user}","gists_url":"https://api.github.com/users/kmee/gists{/gist_id}","starred_url":"https://api.github.com/users/kmee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmee/subscriptions","organizations_url":"https://api.github.com/users/kmee/orgs","repos_url":"https://api.github.com/users/kmee/repos","events_url":"https://api.github.com/users/kmee/events{/privacy}","received_events_url":"https://api.github.com/users/kmee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kmee/PySPED","description":"Sistema Público de Escrituração Digital em Python","fork":true,"url":"https://api.github.com/repos/kmee/PySPED","forks_url":"https://api.github.com/repos/kmee/PySPED/forks","keys_url":"https://api.github.com/repos/kmee/PySPED/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kmee/PySPED/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kmee/PySPED/teams","hooks_url":"https://api.github.com/repos/kmee/PySPED/hooks","issue_events_url":"https://api.github.com/repos/kmee/PySPED/issues/events{/number}","events_url":"https://api.github.com/repos/kmee/PySPED/events","assignees_url":"https://api.github.com/repos/kmee/PySPED/assignees{/user}","branches_url":"https://api.github.com/repos/kmee/PySPED/branches{/branch}","tags_url":"https://api.github.com/repos/kmee/PySPED/tags","blobs_url":"https://api.github.com/repos/kmee/PySPED/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kmee/PySPED/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kmee/PySPED/git/refs{/sha}","trees_url":"https://api.github.com/repos/kmee/PySPED/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kmee/PySPED/statuses/{sha}","languages_url":"https://api.github.com/repos/kmee/PySPED/languages","stargazers_url":"https://api.github.com/repos/kmee/PySPED/stargazers","contributors_url":"https://api.github.com/repos/kmee/PySPED/contributors","subscribers_url":"https://api.github.com/repos/kmee/PySPED/subscribers","subscription_url":"https://api.github.com/repos/kmee/PySPED/subscription","commits_url":"https://api.github.com/repos/kmee/PySPED/commits{/sha}","git_commits_url":"https://api.github.com/repos/kmee/PySPED/git/commits{/sha}","comments_url":"https://api.github.com/repos/kmee/PySPED/comments{/number}","issue_comment_url":"https://api.github.com/repos/kmee/PySPED/issues/comments{/number}","contents_url":"https://api.github.com/repos/kmee/PySPED/contents/{+path}","compare_url":"https://api.github.com/repos/kmee/PySPED/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kmee/PySPED/merges","archive_url":"https://api.github.com/repos/kmee/PySPED/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kmee/PySPED/downloads","issues_url":"https://api.github.com/repos/kmee/PySPED/issues{/number}","pulls_url":"https://api.github.com/repos/kmee/PySPED/pulls{/number}","milestones_url":"https://api.github.com/repos/kmee/PySPED/milestones{/number}","notifications_url":"https://api.github.com/repos/kmee/PySPED/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kmee/PySPED/labels{/name}","releases_url":"https://api.github.com/repos/kmee/PySPED/releases{/id}","deployments_url":"https://api.github.com/repos/kmee/PySPED/deployments","created_at":"2014-10-07T11:59:57Z","updated_at":"2017-06-01T17:52:41Z","pushed_at":"2017-06-20T19:36:42Z","git_url":"git://github.com/kmee/PySPED.git","ssh_url":"git@github.com:kmee/PySPED.git","clone_url":"https://github.com/kmee/PySPED.git","svn_url":"https://github.com/kmee/PySPED","homepage":"","size":16742,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":2,"default_branch":"odoo"}},"_links":{"self":{"href":"https://api.github.com/repos/kmee/PySPED/pulls/15"},"html":{"href":"https://github.com/kmee/PySPED/pull/15"},"issue":{"href":"https://api.github.com/repos/kmee/PySPED/issues/15"},"comments":{"href":"https://api.github.com/repos/kmee/PySPED/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/kmee/PySPED/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/kmee/PySPED/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kmee/PySPED/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/kmee/PySPED/statuses/d7a0131014cdf2a0fcb3cba2fde254fd4fe5f930"}}}}
{"actor":{"display_login":"leorochael"}}