nb_libs
Project description
各种日常工具
安装
pip install nb_libs
1. restart_program每隔多久重启代码自身。
import time
import datetime
from nb_libs.restart_programe_by_interval import restart_program
def _run():
print(datetime.datetime.now(), '开始运行程序')
for i in range(1000):
time.sleep(0.5)
print(datetime.datetime.now(), i)
if __name__ == '__main__':
restart_program(10) # 每隔10秒重启。
_run()
2. nb_time.DatetimeConverter
好用的时间转换,类型兼容强,入参可以是时间戳 字符串 datatime类型 DatetimeConverter 类型.
3 auto_git.GitBranchMerge
git 自动化 分支合并.
多人合作项目git开发流程一般是:
自己分支写代码 -> 自己分支 add -> 自己分支commit -> 设置自己分支在远程对应的分支名 -> 自己分支push到远程 -> 切换到开发develop分支 ->
在develop分支 git pull ->把自己分merge到develop分支 -> develop分支 push到远程 -> checkout到自己分支
开发环境代码拉取develop代码重启部署,测试出现问题后,需要反复执行以上的git繁琐的流程,整个过程如果手动人工操作git太折磨人了,
auto_git.GitBranchMerge 一键执行以上操作,如果有某一步git命令出现错误或冲突,是会中断操作的,不用担心.
当develop代码测试没问题后,提merge request 把自己分支合并到master分支,管理人员审核通过后会把用户分支的代码合并到master.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nb_libs-0.6.tar.gz
(3.0 kB
view details)
Built Distribution
nb_libs-0.6-py3-none-any.whl
(2.1 kB
view details)
File details
Details for the file nb_libs-0.6.tar.gz
.
File metadata
- Download URL: nb_libs-0.6.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e04602f1775501e900998d39704a5ecef9cb41a200eadbbf8e4bfd65cbb7c5fa |
|
MD5 | 2e731f382c4a0699c81ffd5127e2a186 |
|
BLAKE2b-256 | 9a5a14e77ed70aec3ee4038e74ba6714aa2426d50d9866c2a144f6195ee0bedb |
File details
Details for the file nb_libs-0.6-py3-none-any.whl
.
File metadata
- Download URL: nb_libs-0.6-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b38669d11479a493e75acdd314f37881f3e089bbe55f4b277c81961215492759 |
|
MD5 | 5114044cbbd8a5a5b3005964f252a29c |
|
BLAKE2b-256 | 6bef231287718357eb77c48797ad6bb19cd80d46cf40c857527a7e60d7b6fbe0 |