Skip to main content

bstools 使用说明

概要

本程序包是在作者开发的过程中发现一些经常用到的功能没有被很好的封装起来而利用业余时间分装的一套工具集合,所包含内容比较杂乱。在多机部署的情况下为了避免重复的拷贝文件,所以我将这套工具的集合发布出来。首先,这些代码并不高深,也没有什么晦涩难懂的地方。希望大家能用得上。谢谢

基本信息

作者:Bernie Suen 电子邮件:bernie.suen@outlook.com 授权协议:MIT

使用方法介绍

本模块包目前包含三部分,分别为与时间有关系的stTime, 与远程连接有关系的sshCmd 和 与打印输出有关系的formatPrint。

stTime - 子模块

此模块包含1个装饰器和1个方法

performCacl - 装饰器方法

此方法用于模块的耗时计算,没有参数

tsToLocalTime - 方法

此方法用于时间戳转换为标准时间展示。 需要两个参数,timestamp, timeType timestamp: 时间戳,不可省略。没有默认值。float格式。 timeType:事件类型,可接受值("s", "ms"),有默认值("ms")


示例

import time
localTime = toToLocalTIimt(time.time(),"m")

formatPrint - 子模块

此模块包含三个枚举类型和一个方法

LftColor

对应liunx 前景色

LbgColor

对应liunx 背景色

LsType

对应liunx 显示类型

cprint - 方法

此方法用于在liunx环境下显示有颜色的内容。 需要四个参数,info, f, a, t info: 需要输入的内容,不可省略。没有默认值。字符串格式。 f: 前景色,传入LftColor的子类,默认空 a: 前景色,传入LbgColor的子类,默认空 t: 显示类型,传入LsType的子类,默认空


示例

import time
localTime = toToLocalTIimt(time.time(),"m")

sshCmd - 子模块

提供linux 远程操作, 此模块依赖 paramiko 模块。必须配置免密登录方可使用。 LiunxCmd(主机名)rCmd(命令)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bstools-0.1.19.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bstools-0.1.19-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file bstools-0.1.19.tar.gz.

File metadata

  • Download URL: bstools-0.1.19.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.2

File hashes

Hashes for bstools-0.1.19.tar.gz
Algorithm Hash digest
SHA256 1418a48c9493d75d71e06c94707934dc60ef9d9c9e9d3e7a0bf60ead9e0d4f5a
MD5 c95d2c5093fd2815a6c8cc9c782d0aa6
BLAKE2b-256 ce09e8fceb931a82fee2a90224e3b6111ee791b98ecfa207a402cd6298da8475

See more details on using hashes here.

File details

Details for the file bstools-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: bstools-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.2

File hashes

Hashes for bstools-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 c35edfe6d8c2fede26aebeacb3b06de893d5b2c7863c83eccdf71a487c17339f
MD5 7815202c7b29b8c26fed93bb7eb47901
BLAKE2b-256 100082d63490dbdb1517db979033984cd3f98951c980e59a2c15fe87d005b7fc

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

This release

0.1.19 This release

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

1 file

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page