54 lines
1.4 KiB
Python
54 lines
1.4 KiB
Python
from biopro.util.sys import system_sudo, system_call
|
|
"""Application programing interface for communicating between Web server and Data server.
|
|
|
|
**python JSON type format represent**
|
|
|
|
This present will used in whole project documents, for any class has ability to read/write
|
|
the json format data.
|
|
|
|
::
|
|
|
|
object_name (extend object_name) = {
|
|
# comment
|
|
*type # extend type
|
|
"key" : type = value # description
|
|
"key" # key with str type value
|
|
"key"? # optional key with str type value
|
|
"key" : type # not-nullable value
|
|
"key" : type? # nullable value
|
|
"key" : type1 | type2 # union type
|
|
"key" : [type] # list type
|
|
"key" = [value] # list value
|
|
"key" = [value:type] # list value with type
|
|
"key" = {key:type = value:type}
|
|
# dict (json object) type
|
|
} | sub_object_name
|
|
|
|
|
|
"""
|
|
|
|
# global
|
|
|
|
NAME = 'BioPro Controller'
|
|
|
|
VENDOR = 'BioPro Scientific'
|
|
|
|
COPYRIGHT = 'Copyright (c) 2019. ' + VENDOR
|
|
|
|
VERSION = "develop"
|
|
|
|
WEB_SITE = 'http://www.bioproweb.com/'
|
|
|
|
try:
|
|
REV_VERSION = system_call('git', 'log', '-n', '1', '--pretty=tformat:%H').strip()
|
|
except:
|
|
REV_VERSION = ''
|
|
print('get git-rev fail')
|
|
|
|
|
|
try:
|
|
WIFI_NAME = system_call('grep', '^ssid', '/etc/hostapd/hostapd.conf').strip().split('=')[1]
|
|
except:
|
|
WIFI_NAME = ''
|
|
print('get wifi-name fail')
|