Skip to content

Commit

Permalink
Revert "Broadcast, history, log, and sms modules."
Browse files Browse the repository at this point in the history
  • Loading branch information
enty8080 authored Jul 16, 2022
1 parent c3d7cec commit c37c81a
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 154 deletions.
11 changes: 6 additions & 5 deletions ghost/core/base/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

import readline
import sys
import os

from ghost.core.base.device import Device
from ghost.core.cli.badges import Badges
Expand Down Expand Up @@ -71,13 +72,14 @@ def shell(self) -> None:

self.badges.print_empty(self.banner)

readline.parse_and_bind('tab: complete')
while True:
try:
command = input(
command = input(
f'{self.colors.REMOVE}(ghost)> '
).strip()
self.badges.log_information(command)
command = command.split()

if not command:
continue

Expand Down Expand Up @@ -119,7 +121,6 @@ def shell(self) -> None:
connected = device.connect()

if connected:
self.badges.log_information(f'Connected successfully to {command[1]}')
self.devices.update({
len(self.devices): {
'host': host,
Expand Down Expand Up @@ -153,7 +154,7 @@ def shell(self) -> None:
self.devices[int(command[1])]['device'].disconnect()
del self.devices[int(command[1])]
else:
self.badges.print_error("Invalid device id!")
self.badges.print_error("Invalud device id!")

elif command[0] == 'interact':
if len(command) < 2:
Expand Down
1 change: 0 additions & 1 deletion ghost/core/base/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ def interact(self) -> None:
f'{self.colors.REMOVE}(ghost: {self.colors.RED}'
f'{self.host}{self.colors.END})> '
).strip()
self.badges.log_information(command)
command = command.split()

if not command:
Expand Down
13 changes: 1 addition & 12 deletions ghost/core/cli/badges.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import time
import os


class Badges:
@staticmethod
Expand All @@ -48,13 +47,3 @@ def print_warning(message, end='\n'):
@staticmethod
def print_information(message, end='\n'):
print(f"\033[1K\r\033[1;77m[i]\033[0m {message}", end=end)

def log_information(pass_, message):
if os.path.exists("history.log"):
history_f = open(f'history.log', "a")
history_f.write(f'[{time.ctime()}] (ghost)> {message} \n')
history_f.close()
else:
history_f = open(f'history.log', "w")
history_f.write(f'[{time.ctime()}] (ghost)> {message} \n')
history_f.close()
28 changes: 0 additions & 28 deletions ghost/modules/broadcast.py

This file was deleted.

33 changes: 0 additions & 33 deletions ghost/modules/history.py

This file was deleted.

41 changes: 0 additions & 41 deletions ghost/modules/log.py

This file was deleted.

34 changes: 0 additions & 34 deletions ghost/modules/sms.py

This file was deleted.

0 comments on commit c37c81a

Please sign in to comment.