Skip to content

Commit acfcd9c

Browse files
committed
Change variable name for better understanding
1 parent 4b0ccfb commit acfcd9c

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

bin/Debug/netcoreapp3.1/pdfconverter.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,29 @@
1111

1212
# >> VARIÁVEIS <<
1313

14-
# - NOMES DE ARQUIVOS -
15-
# Nome do arquivo em PDF formatado sem a extensão
14+
# - NOMES
15+
# Nome do arquivo PDF que vai ser convertido (sem a extensão)
1616
fileName = ""
1717

1818
# - CAMINHOS
19-
# Caminho atual
19+
# Caminho atual para a raiz do projeto (outros caminhos vão se
20+
# basear nele)
2021
currentPath = ""
21-
# Caminhos baseados no currentPath
22-
pathOutputFile = ""
23-
# Arquivo raíz exportado
22+
# Caminho para o arquivo do terminal
23+
txtOutputFilePath = ""
24+
# Caminho do arquivo PDF que vai ser convertido
2425
txtFilePath = ""
2526

26-
# - ARQUIVOS DE SAÍDA
27-
# Saída do Terminal
28-
outputFile = ""
27+
# - ARQUIVOS
28+
# Arquivo de saída do Terminal
29+
txtOutputFile = ""
2930

3031
# - CONTADORES
3132
# Índice do Data Frame
3233
indexDataFrame = 0
3334

34-
35-
# Linha gigante que vai ficar disposta em
36-
# alguns lugares como divisão no terminal
35+
# Linha gigante que vai ficar disposta em alguns lugares como
36+
# divisão no terminal
3737
strGiantLine = (
3838
"_____________________________________________________________"
3939
"_____________________________________________________________"
@@ -61,7 +61,7 @@ def Main():
6161
global indexDataFrame
6262

6363
# - CONTADORES
64-
# Índice do arquivo
64+
# Índice de arquivos
6565
indexFile = 1
6666

6767
# ---------------------------------------------------------------------- #
@@ -85,7 +85,7 @@ def Main():
8585
strGiantLine + "\n"
8686
"\n\n\n\n\n\n\n\n\n",
8787

88-
file = outputFile
88+
file = txtOutputFile
8989
)
9090
setTerminalFile("closed")
9191

@@ -107,7 +107,7 @@ def Main():
107107
" O arquivo '" + fileName + "' foi lido e está pronto pra ser convertido\n\n"
108108
" ----- + -----\n\n\n\n",
109109

110-
file = outputFile
110+
file = txtOutputFile
111111
)
112112
setTerminalFile("closed")
113113

@@ -169,7 +169,7 @@ def Main():
169169
strGiantLine + "\n" +
170170
strGiantLine,
171171

172-
file = outputFile
172+
file = txtOutputFile
173173
)
174174
setTerminalFile("closed")
175175
# Se até o término da operação nenhum PDF foi convertido ainda
@@ -195,7 +195,7 @@ def setCurrentPath():
195195

196196
# - Globais
197197
global currentPath
198-
global pathOutputFile
198+
global txtOutputFilePath
199199

200200
# ---------------------------------------------------------------------- #
201201

@@ -210,7 +210,7 @@ def setCurrentPath():
210210
# (pdfconverter\bin\Debug\netcoreapp3.1)
211211
# \___[a diminuição de caracteres faz voltar até a pasta 'pdfconverter']
212212

213-
pathOutputFile = currentPath + "\\resultados\\output.txt"
213+
txtOutputFilePath = currentPath + "\\resultados\\output.txt"
214214
except Exception as err:
215215
showError(
216216
"Não foi possível achar o diretório atual. Provável problema na hora de encurtar o "
@@ -275,7 +275,7 @@ def setProjectStructure():
275275

276276
# Cria arquivo para exibir a saída do terminal,
277277
# se já existir o arquivo, limpa o mesmo
278-
outputClear = open(pathOutputFile, "w", encoding="UTF-8")
278+
outputClear = open(txtOutputFilePath, "w", encoding="UTF-8")
279279
outputClear.close()
280280

281281
# >> CONFIGURAÇÕES DO PANDAS <<
@@ -307,14 +307,14 @@ def setTerminalFile(setState):
307307
# >> VARIÁVEIS <<
308308

309309
# - GLOBAIS
310-
global outputFile
310+
global txtOutputFile
311311

312312
# ---------------------------------------------------------------------- #
313313

314314
if (setState == "open"):
315-
outputFile = open(pathOutputFile, "a", encoding="UTF-8")
315+
txtOutputFile = open(txtOutputFilePath, "a", encoding="UTF-8")
316316
elif (setState == "closed"):
317-
outputFile.close()
317+
txtOutputFile.close()
318318
else:
319319
showError("O terminal só pode ser aberto ou fechado. Tenha certeza que atribuiu 'open' para aberto ou 'close' para fechado pro método 'terminal'.", "")
320320
exit()
@@ -324,31 +324,31 @@ def setTerminalFile(setState):
324324
# Função responsável por exibir mensagens de erros disponíveis nas Exceptions.
325325
def showError(errorMessage, err):
326326
# Limpa o terminal para exibir melhor o erro
327-
open(pathOutputFile, "w").close()
327+
open(txtOutputFilePath, "w").close()
328328

329-
outputFile = open(pathOutputFile, "a", encoding="UTF-8")
329+
txtOutputFile = open(txtOutputFilePath, "a", encoding="UTF-8")
330330
print(
331331
"**********************************************************************\n"
332332
"--- MENSAGEM ---\n"
333333
"\n"
334334
"ERRO\n"
335335
"Descrição: " + errorMessage + "\n",
336336

337-
file = outputFile
337+
file = txtOutputFile
338338
)
339339

340340
# Caso tenha uma exception, ele exibe
341341
if (err != ""):
342-
print("EXCEPTION", file = outputFile)
343-
print(str(err), file = outputFile)
342+
print("EXCEPTION", file = txtOutputFile)
343+
print(str(err), file = txtOutputFile)
344344

345345
# Fecha o layout
346346
print(
347347
"**********************************************************************",
348348

349-
file = outputFile
349+
file = txtOutputFile
350350
)
351-
outputFile.close()
351+
txtOutputFile.close()
352352

353353
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SAÍDAS DE AVISOS - FIM <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
354354

@@ -432,10 +432,10 @@ def conversionStart(conversionMethod, tableDataFrame):
432432
"\________________________________________________________________________________/\n" +
433433
"Search this (Ctrl + F): '" + fileName + " " + conversionMethod + " tbl" + str(indexDataFrame) + "'\n",
434434

435-
file = outputFile
435+
file = txtOutputFile
436436
)
437437
# Imprime o DataFrame
438-
print(pandas.DataFrame(tableDataFrame), file = outputFile)
438+
print(pandas.DataFrame(tableDataFrame), file = txtOutputFile)
439439
setTerminalFile("closed")
440440

441441
indexDataFrame = indexDataFrame + 1

0 commit comments

Comments
 (0)