Skip to content

Commit e10326d

Browse files
committed
updated log command and added config.example
1 parent e6f2cb8 commit e10326d

File tree

4 files changed

+15
-50
lines changed

4 files changed

+15
-50
lines changed

config.example.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
run={
2+
"SMTPTester" : {"directory":"SMTPTester", "restart":False, "main_method":"main", "repository":"https://github.com/lupin012345/SMTPTester.git"},
3+
}
4+
5+
daemon={
6+
"port": 4242,
7+
"host": "127.0.0.1",
8+
"services_directory": "run",
9+
"password": "password",
10+
"log_file": "/var/log/pythonms.log"
11+
}

config.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

daemon.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

modules/commands.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ def handle_input(command, worker, server=None):
1313
return True, output
1414

1515
def log(worker, args=None, server=None):
16-
with open(config.log_file) as f:
17-
return f.read()
18-
return "Unable to find logfile %s" %config.log_file
16+
if "log_file" in config.daemon.keys():
17+
with open(config.daemon['log_file']) as f:
18+
return f.read()
19+
return "Unable to find logfile"
1920

2021
def keepalive(worker, args=None, server=None):
2122
if len(args) < 3:

0 commit comments

Comments
 (0)