Browse Source

Enhanced the menu

pull/1/head
Jeffery Russell 6 years ago
parent
commit
f728a704fd
2 changed files with 17 additions and 4 deletions
  1. +1
    -1
      src/quote.py
  2. +16
    -3
      src/ssh_manager.py

+ 1
- 1
src/quote.py View File

@ -10,7 +10,7 @@ import subprocess
import random
INPUT_FILE = "/home/jeff/scripts/quotes.txt"
WELCOME_MESSAGE = "***************Jeff-Laptop*************"
WELCOME_MESSAGE = "***************Jeff-Laptop***************"
def print_cowsay_message(message):

+ 16
- 3
src/ssh_manager.py View File

@ -6,8 +6,20 @@ Jeffery Russell
import subprocess
import collections
import quote
INPUT_FILE = "/home/jeff/scripts/servers.txt"
Computer = collections.namedtuple("Computer", ('host', 'menue_id'))
WELCOME_MESSAGE = "***************Jeff-Laptop***************"
def print_menu_option(s):
"""
:param s:
:return:
"""
space = " " * len(quote) - 4 - len(s)
print("* " + s + space + "*")
def main():
"""
@ -22,10 +34,11 @@ def main():
cmp.append(Computer(line, count))
count += 1
print("SSH manager V 0.1")
print("* SSH manager V 0.1 *")
for c in cmp:
print(str(c.menue_id) + ")", c.host)
print()
print_menu_option(str(c.menue_id) + ") " + c.host)
print("*" * len(WELCOME_MESSAGE))
i = input("Enter number of computer to connect to or enter to exit:")
for c in cmp:

Loading…
Cancel
Save