Skip to content

Commit

Permalink
[REF] Refatoração feita automaticamente ao rodar o comando pre-commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbcosta committed Jan 22, 2024
1 parent 3d05008 commit 93b1f38
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions ci/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def exec_in_env():
check_call([bin_path / "pip", "install", "jinja2", "tox"])
python_executable = bin_path / "python"
if not python_executable.exists():
python_executable = python_executable.with_suffix('.exe')
python_executable = python_executable.with_suffix(".exe")

print("Re-executing with: {0}".format(python_executable))
print("+ exec", python_executable, __file__, "--no-env")
Expand All @@ -61,16 +61,22 @@ def main():
# This uses sys.executable the same way that the call in
# cookiecutter-pylibrary/hooks/post_gen_project.py
# invokes this bootstrap.py itself.
for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines()
for line in subprocess.check_output(
[sys.executable, "-m", "tox", "--listenvs"], universal_newlines=True
).splitlines()
]
tox_environments = [line for line in tox_environments if line.startswith('py')]
tox_environments = [line for line in tox_environments if line.startswith("py")]

for template in templates_path.rglob('*'):
for template in templates_path.rglob("*"):
if template.is_file():
template_path = str(template.relative_to(templates_path))
destination = base_path / template_path
destination.parent.mkdir(parents=True, exist_ok=True)
destination.write_text(jinja.get_template(template_path).render(tox_environments=tox_environments))
destination.write_text(
jinja.get_template(template_path).render(
tox_environments=tox_environments
)
)
print("Wrote {}".format(template_path))
print("DONE.")

Expand Down
2 changes: 1 addition & 1 deletion src/erpbrasil/base/fiscal/edoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def partes(self, num_partes=11):
).format(num_partes)

salto = 44 // num_partes
return [self._campos[n: (n + salto)] for n in range(0, 44, salto)]
return [self._campos[n : (n + salto)] for n in range(0, 44, salto)]


class ChaveCFeSAT(ChaveEdoc):
Expand Down
2 changes: 1 addition & 1 deletion src/erpbrasil/base/gs1/gtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def calcula_dv(gs1_code, code_length):
prod = [3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3]

# get the product with some gs1_code length
gs1_prod = prod[len(prod) - len(gs1_code):]
gs1_prod = prod[len(prod) - len(gs1_code) :]

while len(gs1_code) < code_length:
r = sum([x * y for (x, y) in zip(gs1_code, gs1_prod)]) % 10
Expand Down

0 comments on commit 93b1f38

Please sign in to comment.