Skip to content

Commit

Permalink
Fix updater e kill (dnv)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuiBrandt committed Feb 20, 2019
1 parent 928b14c commit 81b88d1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions god/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from god.version import current as version

_LIST_ITEM_MARKER = "~>"
_INT_LIST = False
_IN_LIST = False


color_init(autoreset=True)
Expand All @@ -38,9 +38,9 @@ def newline():
def header(color=Fore.BLUE):
"""Printa o cabeçalho do God"""

f = Figlet(font='alligator2', justify='center', width=width())
fig = Figlet(font='alligator2', justify='center', width=width())
newline()
print(color + f.renderText('G o d'))
print(color + fig.renderText('G o d'))
newline()
print(color + version().center(width()))
print(flush=True)
Expand All @@ -67,7 +67,7 @@ def print_settings():
def i_am(doing):
"""Escreve uma mensagem de indicador de ação"""

if _INT_LIST:
if _IN_LIST:
print("\t", Fore.CYAN + _LIST_ITEM_MARKER + Fore.RESET, end=' ')
print(Fore.YELLOW + doing, end=' ', flush=True)

Expand Down Expand Up @@ -99,15 +99,15 @@ def info(text):
def list_begin():
"""Entra no modo de listagem"""

global _INT_LIST
_INT_LIST = True
global _IN_LIST
_IN_LIST = True


def list_end():
"""Termina o modo de listagem"""

global _INT_LIST
_INT_LIST = False
global _IN_LIST
_IN_LIST = False
newline()


Expand All @@ -130,11 +130,11 @@ def read_command():
return input().strip()


def yesno(prompt="Confirmar?"):
def yesno(text="Confirmar?"):
"""Faz uma confirmação de Sim/Não"""

while True:
answer = input(f"\t{prompt} [S/n] ").lower().strip()
answer = input(f"\t{text} [S/n] ").lower().strip()
if answer in ['s', '', 'n']:
break

Expand Down
2 changes: 1 addition & 1 deletion god/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def kill_processes(process_list):
process_name += ".exe"

for process in wmi.Win32_Process(Name=process_name):
os.kill(process.ProcessId, 9)
os.system(f"taskkill /f /pid {process.ProcessId}")


def danger():
Expand Down
8 changes: 4 additions & 4 deletions god/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

# Informação da versão atual
if os.path.isfile(".version"):
with open(".version", "r") as version:
_VERSION = {"tag": version.readline().strip()}
with open(".version", "r") as version_file:
_VERSION = {"tag": version_file.readline().strip()}
else:
_VERSION = None
_VERSION = {"tag": "v2.1.0-beta"}


def current():
"""Obtém a versão atual do God"""

return _VERSION["tag"] if _VERSION else "2.0.0"
return _VERSION["tag"]


def set_tag(version):
Expand Down

0 comments on commit 81b88d1

Please sign in to comment.