WebScriptsTools
1.0.0
이 패키지는 웹 스크립트 스크립트 용 도구를 구현합니다.
이 패키지는 다음과 같습니다.
pip install WebScriptsTools # These command lines should be launch in a WebScripts Scripts Environment !
python3 -m WebScriptsTools
python3 -m WebScriptsTools get_log_file
python3 -m WebScriptsTools get_upload_script
python3 -m WebScriptsTools get_webscripts_data_path웹 스크립트 스크립팅 환경 밖에서이 명령 줄을 실행하면이 오류가 발생합니다.
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
스크립트 배쉬의 사용 예 :
logfile= $( python3 -m WebScriptsTools get_log_file )
echo " DEBUG: Get log file from WebScriptsTools " > " ${logfile} "
cat " $( python3 -m WebScriptsTools get_webscripts_data_path ) /datafile.txt "
echo " INFO: print data using WebScripts data directory " > " ${logfile} "
cat myfile.txt | " $( python3 -m WebScriptsTools get_upload_script ) " uploaded_filename.txt
cat myfile.txt | " $( python3 -m WebScriptsTools get_upload_script ) " -r 1000 -w 1000 -d 1000 -H -b -c -i uploaded_filename.txt # To use this module you should be in a WebScripts Scripts Environment
from WebScriptsTools import *
set_excepthook () # manage exceptions without printing sensible informations
# Get the upload module, to read, delete or write a shared file
upload = get_upload_module ()
upload . get_file ( "my_webscripts_shared_file.txt" )
# Use the data path to change databases
with open ( f" { get_webscripts_data_path () } /datafile.txt" ) as datafile :
print ( datafile . read ())
# Get the log file to configure your logger or read your logs
logs = open ( get_log_file ())
log = logs . readline ()
while log :
print ( log )
log = logs . readline ()
# Get the user to check permission or get informations like ID or name
user = get_user ()
print ( f"You are named ' { user [ 'name' ] } ' here !" )
class ClassModule :
@ module2to3
def method (
self ,
environ ,
user ,
configuration ,
filename ,
commande ,
inputs ,
csrf_token : str = None ,
) -> Tuple [ str , Dict [ str , str ], bytes ]:
return "200 OK" , {}, b'data'
@ module2to3
def function (
environ ,
user ,
configuration ,
filename ,
commande ,
inputs ,
csrf_token : str = None ,
) -> Tuple [ str , Dict [ str , str ], bytes ]:
return "200 OK" , {}, b'data' GPL, 버전 3에 따라 라이센스가 부여되었습니다.