WebScriptsTools
Description
This package implements tools for WebScripts Scripts.
Requirements
This package require:
- python3
- python3 Standard Library
Installation
pip install WebScriptsTools
Usages
Command line
Module
# 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
If you run these command lines outside the WebScripts scripting environment, you get this error:
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
Example of usage in a script bash:
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
Python script
# 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'
Links
Licence
Licensed under the GPL, version 3.
Metadata
Release files for WebScriptsTools 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| WebScriptsTools-0.1.0.tar.gz | 18.2 kB | Without provenance | Details for WebScriptsTools-0.1.0.tar.gz |
Release files / WebScriptsTools-0.1.0.tar.gz
| Download URL | WebScriptsTools-0.1.0.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0532f8c5dd93563923527087c6591c2e5d21c1043e4ed7c24024694e80663fc0
|
|
BLAKE2b-256 checksum How to use checksums |
48ed4e2c45f7d7bb02da778d04ea94a295ab016b8bfdda3db08c7566cba8cc75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for WebScriptsTools 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.