Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/class/core/config_api.py

40 lines
860 B

6 years ago
# coding: utf-8
import psutil
import time
import os
import sys
import public
import re
import json
import pwd
class config_api:
def __init__(self):
pass
##### ----- start ----- ###
6 years ago
def get(self):
data = {}
data['site_path'] = public.getWwwDir()
6 years ago
data['backup_path'] = public.getBackupDir()
data['systemdate'] = public.execShell(
'date +"%Y-%m-%d %H:%M:%S %Z %z"')[0].strip()
if os.path.exists('data/port.pl'):
data['port'] = public.readFile('data/port.pl').strip()
else:
data['port'] = '7200'
if os.path.exists('data/iplist.txt'):
data['ip'] = public.readFile('data/iplist.txt').strip()
else:
data['ip'] = '127.0.0.1'
6 years ago
return data
6 years ago
##### ----- end ----- ###