Skip to content

Commit

Permalink
Revert "Revert "Revert "Made it pip-installable by adding a setup.py"""
Browse files Browse the repository at this point in the history
  • Loading branch information
perylemke authored Oct 26, 2017
1 parent bc382ba commit 21414be
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ Why? I'm study Python and I'm a Lazy SysAdmin.

Clone the repo:
```bash
pip install git+https://github.com/perylemke/sesamo.git
git clone https://github.com/perylemke/sesamo.git
```

Execute the Install script:
```bash
cd sesamo
./install.sh
```

Configure config.ini:
Expand Down
26 changes: 26 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#
# versao 1.0
#
# NOME
# install.sh
#
# DESCRICAO
# Script para instalação do Sesamo no Linux.
#
# NOTA
# Executar como root.
########################################################################################

echo "Verificando se é o root executando..."
[ "$(id -u)" != "0" ] && { echo "Executar esse script novamente como root"; exit 1; }

echo "Copiando o arquivo de configuração..."
mkdir -p $HOME/.config/sesamo
cp -pv ./config.ini.example $HOME/.config/sesamo/config.ini

echo "Criando o executável do Sesamo..."
cp -pv ./sesamo.py /usr/local/bin/sesamo
chmod +x /usr/local/bin/sesamo

exit 0
9 changes: 3 additions & 6 deletions sesamo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def front():
print("0 - Sair")
print("")

def run():
def main():
should_exit = False

while not should_exit:
Expand All @@ -63,9 +63,9 @@ def run():
os.system('clear')
print ("Somente números são permitidos. Tente novamente.")

def main():
if __name__ == '__main__':
try:
run()
main()
except(Exception):
print('')
print('Bye!')
Expand All @@ -75,6 +75,3 @@ def main():
print('Você executou um comando inválido. Sésamo fechando!')
time.sleep(1)
sys.exit(1)

if __name__ == '__main__':
main()
25 changes: 0 additions & 25 deletions setup.py

This file was deleted.

0 comments on commit 21414be

Please sign in to comment.