forked from zoexmh99/wvd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logic_client.py
55 lines (47 loc) · 1.83 KB
/
logic_client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
#########################################################
# python
import os, sys, traceback, re, json, threading, time, shutil
from datetime import datetime
# third-party
import requests
# third-party
from flask import request, render_template, jsonify, redirect
from sqlalchemy import or_, and_, func, not_, desc
import lxml.html
from lxml import etree as ET
# sjva 공용
from framework import db, scheduler, path_data, socketio, SystemModelSetting, app, celery
from framework.util import Util
from framework.common.util import headers, get_json_with_auth_session
from framework.common.plugin import LogicModuleBase, default_route_socketio
from tool_expand import ToolExpandFileProcess
# 패키지
from .plugin import P
logger = P.logger
package_name = P.package_name
ModelSetting = P.ModelSetting
from .utility import Utility
#from lib_metadata.server_util import MetadataServerUtil
#########################################################
class LogicClient(LogicModuleBase):
db_default = {
'client_db_version' : '1',
'client_server_ddns' : '',
'client_server_apikey' : '',
'client_netflix_id' : '',
'client_netflix_pw' : '',
}
def __init__(self, P):
super(LogicClient, self).__init__(P, 'setting')
self.name = 'client'
def process_menu(self, sub, req):
arg = P.ModelSetting.to_dict()
arg['sub'] = self.name
try:
return render_template(f'{package_name}_{self.name}_{sub}.html', arg=arg)
except Exception as e:
P.logger.error('Exception:%s', e)
P.logger.error(traceback.format_exc())
return render_template('sample.html', title=f"{package_name}/{self.name}")
#########################################################