Description
Python library writed by Blues Liu.
Superpowers 离线安装(基于下载的 zip 包)
因网络无法从 GitHub 拉取插件,改用本地 zip 包离线安装:
- 下载 superpowers 源码压缩包(如
superpowers-main.zip)并解压。 - 将解压内容复制到 opencode 的标准 node_modules 安装位置:
mkdir -p ~/.config/opencode/node_modules/superpowers cp -R /path/to/superpowers-main/. ~/.config/opencode/node_modules/superpowers/
- 在全局配置
~/.config/opencode/opencode.json的plugin数组指向本地路径(替代远程 git 地址):{ "plugin": ["~/.config/opencode/node_modules/superpowers"] }
- 重启 opencode,用
opencode run "Tell me about your superpowers"验证加载。
pytest
# windows
pytest tests/xx.test.ts
# macos
python3 -m pytest tests/xx.test.ts
Install
install by requirements.txt
pip install -r requirements.txt
// first installation
pip install blues-lib==1.3.14
// upgrade to the newest version
pip install --upgrade blues-lib
sele
BluesDebugChrome
reliant env variables
$env:CHROME_EXE: the chrome's .exe file path - * required
- such as
C:\Users\creep\AppData\Local\Google\Chrome\Application\chrome.exe
$env:CHROME_DRIVER_EXE: the chromedriver's .exe file path - * recommended
- such as
D:\devsoftware\Python38\webdriver\chrome\128.0.6613.86\chromedriver.exe
$env.LOGINER_EXECUTOR: the loginer program path
- dated setting:
D:\devapp\seleniumapp\loginer\Starter.py
input
config = {
'url':'http://deepbluenet.com',
}
arguments = {
'--user-data-dir':'"c:/sele/test3"',
'--remote-debugging-address':'localhost:8003',
}
util
from blues_lib.utils.file.File import File
print(File.exists('dir'))
set/get env variables
// set
[Environment]::SetEnvironmentVariable('LOGINER_EXECUTOR', 'D:\devapp\seleniumapp\loginer\Starter.py','machine')
// get
[Environment]::GetEnvironmentVariable('LOGINER_EXECUTOR','machine')
QA
Selenium Wire CA error
ERROR:cert_verify_proc_builtin.cc(766)] CertVerifyProcBuiltin for at.alicdn.com failed:
----- Certificate i=1 (CN=Selenium Wire CA) -----
Resolve:
- download ca.crt from selenium-wire library
https://github.com/wkeeling/selenium-wire/blob/master/seleniumwire/ca.crt
Execute by powershell scheduled task
task
unRegister-ScheduledTask -TaskName 'srp'
Get-ScheduledTask -TaskName 'srp'
Start-ScheduledTask -TaskName 'srp'
Get-ScheduledTaskInfo -TaskName 'srp'
enable-ScheduledTask -TaskName 'srp'
disable-ScheduledTask -TaskName 'srp'
task in 24hours
$arg='-NoProfile -command "& {set-location -path D:\devapp\pyapp\blues-lib-py\test\srp; python .\NAPSTest.py}"' ; $action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument $arg ;
$now = Get-Date ;
$interval = New-TimeSpan -Hours 2;
$trigger = New-ScheduledTaskTrigger -Once -RepetitionInterval $interval -At $now ;
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName 'srp'
task in 7:00-23:00
$arg = '-NoProfile -command "& {set-location -path D:\devapp\pyapp\blues-lib-py\test\srp; python .\NAPSTest.py}"'
$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument $arg
$startTime = Get-Date -Hour 7 -Minute 0 -Second 0
$trigger = New-ScheduledTaskTrigger -Daily -At $startTime -RepetitionInterval (New-TimeSpan -Hours 2) -RepetitionDuration (New-TimeSpan -Hours 16)
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName 'srp'
# define the execute order
$arg='-NoProfile -command "& {set-location -path D:\devapp\pyapp\blues-lib-py\test\srp; python .\NAPSTest.py}"' ;
# create task
$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument $arg ;
$startTime = (Get-Date).Date.AddHours(7);
$interval = New-TimeSpan -Hours 2;
$endTime = (Get-Date).Date.AddHours(23);
# define the trigger
$trigger = New-ScheduledTaskTrigger -Daily -At $startTime -RepetitionInterval $interval -RepetitionDuration ($endTime - $startTime)
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName 'srp'
exe
$chrome="'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'" ; $arg='-NoProfile -command "& { set-location -path D:\datacross\dist\App; .\App.exe '+$chrome+' }"' ; $action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument $arg ; $now = Get-Date ; $interval = New-TimeSpan -Hours 1; $trigger = New-ScheduledTaskTrigger -Once -RepetitionInterval $interval -At $now ; Register-ScheduledTask -Action $action -Trigger $trigger -TaskName 'datacross'
install
This develop pc will push pip to officail reigstry ,can't set the mirros
pip install -i https://mirrors.aliyun.com/pypi/simple selenium
pip install -i https://mirrors.aliyun.com/pypi/simple --upgrade selenium
Metadata
Release files for blues-lib 1.19.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 | |
|---|---|---|---|
| blues_lib-1.19.0.tar.gz | 252.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| blues_lib-1.19.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 731.7 kB
Release files / blues_lib-1.19.0.tar.gz
| Download URL | blues_lib-1.19.0.tar.gz |
|---|---|
| Size | 252.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b752cd2ccd654c092b674cf9f91b37cceb87aacf3476955b37c776ccb946fbc4
|
|
BLAKE2b-256 checksum How to use checksums |
71e43a881ab287e67ba4357f895528b904e9ae6ae64c70c7344f4873f7e62528
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / blues_lib-1.19.0-py3-none-any.whl
| Download URL | blues_lib-1.19.0-py3-none-any.whl |
|---|---|
| Size | 479.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19ce19a3c7ae02f7055de451c2274ee1dd23b406b043c1c2c24fb1a11c91981c
|
|
BLAKE2b-256 checksum How to use checksums |
b9d5bab7d56a4f64cc51a721bb8ac46067f5cfe1e78767f07e91badea5ca1aff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|