remote-run-everything 2.0.8__py3-none-any.whl → 2.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- remote_run_everything/__init__.py +1 -0
- remote_run_everything/db/crude_duck.py +1 -1
- remote_run_everything/deploy/process_manage.py +46 -0
- remote_run_everything/tools/common.py +89 -30
- remote_run_everything/tools/common1.py +5 -101
- remote_run_everything/tools/crc16.py +64 -0
- {remote_run_everything-2.0.8.dist-info → remote_run_everything-2.1.1.dist-info}/METADATA +17 -16
- {remote_run_everything-2.0.8.dist-info → remote_run_everything-2.1.1.dist-info}/RECORD +11 -9
- {remote_run_everything-2.0.8.dist-info → remote_run_everything-2.1.1.dist-info}/WHEEL +1 -1
- {remote_run_everything-2.0.8.dist-info → remote_run_everything-2.1.1.dist-info}/licenses/LICENSE +0 -0
- {remote_run_everything-2.0.8.dist-info → remote_run_everything-2.1.1.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from remote_run_everything.deploy.by_http import ByHttp
|
|
2
2
|
from remote_run_everything.deploy.by_sftp import BySftp
|
|
3
|
+
from remote_run_everything.deploy.process_manage import ProcessManage
|
|
3
4
|
|
|
4
5
|
from remote_run_everything.db.crude_duck import CrudeDuck
|
|
5
6
|
from remote_run_everything.db.crud_sqlalchemy import Crud
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import os, signal
|
|
2
|
+
import subprocess, sys
|
|
3
|
+
class ProcessManage:
|
|
4
|
+
def is_process_running(self,pid):
|
|
5
|
+
import psutil
|
|
6
|
+
try:
|
|
7
|
+
process = psutil.Process(pid)
|
|
8
|
+
# Check if process is still running
|
|
9
|
+
return process.is_running()
|
|
10
|
+
except psutil.NoSuchProcess:
|
|
11
|
+
return False
|
|
12
|
+
except psutil.AccessDenied:
|
|
13
|
+
# Process exists but we don't have permission to access it
|
|
14
|
+
print(f"Access denied to process {pid}")
|
|
15
|
+
return True
|
|
16
|
+
def read_pid_file(self,pidfile):
|
|
17
|
+
if os.path.exists(pidfile):
|
|
18
|
+
with open(pidfile, "rb") as f:
|
|
19
|
+
pid = f.read().decode()
|
|
20
|
+
return pid
|
|
21
|
+
return None
|
|
22
|
+
|
|
23
|
+
# 只需要在程序中引入这个函数,启动后会把 os.getpid()存入,然后有了pid,结合psutil,什么都有了
|
|
24
|
+
def write_pid_file(self,pidfile,pid):
|
|
25
|
+
with open(pidfile, "wb") as f:
|
|
26
|
+
s = str(pid).encode()
|
|
27
|
+
f.write(s)
|
|
28
|
+
|
|
29
|
+
def kill_by_pid(self,pid):
|
|
30
|
+
try:
|
|
31
|
+
os.kill(int(pid), signal.SIGTERM)
|
|
32
|
+
except Exception as e:
|
|
33
|
+
print("kill err==", e)
|
|
34
|
+
|
|
35
|
+
def popen_with_pid(self, workdir, app):
|
|
36
|
+
os.chdir(workdir)
|
|
37
|
+
process = subprocess.Popen(app, creationflags=subprocess.CREATE_NEW_CONSOLE)
|
|
38
|
+
pid= process.pid
|
|
39
|
+
print("new pid====",pid)
|
|
40
|
+
return pid
|
|
41
|
+
# sys.exit()
|
|
42
|
+
|
|
43
|
+
def restart_windows(self):
|
|
44
|
+
os.system("shutdown -t 0 -r -f")
|
|
45
|
+
|
|
46
|
+
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import jinja2, requests, os
|
|
2
|
-
import pandas as pd
|
|
3
1
|
import socket, os, tomllib
|
|
4
|
-
import base64
|
|
5
|
-
import os, signal
|
|
6
|
-
import subprocess, sys
|
|
7
2
|
from remote_run_everything.tools.common1 import Common1
|
|
8
|
-
|
|
3
|
+
import pandas as pd
|
|
4
|
+
import jinja2, os,base64,struct, glob, arrow, uuid, hashlib
|
|
9
5
|
|
|
10
6
|
class Common(Common1):
|
|
11
7
|
@property
|
|
@@ -25,31 +21,94 @@ class Common(Common1):
|
|
|
25
21
|
data = tomllib.load(f)
|
|
26
22
|
return data
|
|
27
23
|
|
|
28
|
-
def
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
def table_search(self, data, search):
|
|
25
|
+
res = []
|
|
26
|
+
for i in data:
|
|
27
|
+
if search == "":
|
|
28
|
+
res.append(i)
|
|
29
|
+
elif search != "" and search in str(i):
|
|
30
|
+
res.append(i)
|
|
31
|
+
return res
|
|
32
|
+
|
|
33
|
+
def split_page(self, numPerPage, cur, search, data):
|
|
34
|
+
data = self.table_search(data, search)
|
|
35
|
+
if data is None or len(data) == 0:
|
|
36
|
+
return {"total": 0, "data": []}
|
|
37
|
+
cur = int(cur)
|
|
38
|
+
res = {"total": len(data)}
|
|
39
|
+
n = int(numPerPage)
|
|
40
|
+
total = len(data)
|
|
41
|
+
start = (cur - 1) * n
|
|
42
|
+
end = cur * n
|
|
43
|
+
if start > total - 1:
|
|
44
|
+
res['data'] = []
|
|
45
|
+
elif end > total - 1:
|
|
46
|
+
remainder = total % numPerPage
|
|
47
|
+
if remainder == 0:
|
|
48
|
+
res['data'] = data[-numPerPage:]
|
|
49
|
+
else:
|
|
50
|
+
res['data'] = data[-remainder:]
|
|
51
|
+
else:
|
|
52
|
+
res['data'] = data[start:end]
|
|
53
|
+
return res
|
|
54
|
+
|
|
55
|
+
def render(self, dir, html, data):
|
|
56
|
+
env = jinja2.Environment(loader=jinja2.FileSystemLoader(f'{dir}/templates'))
|
|
57
|
+
template = env.get_template(html)
|
|
58
|
+
outputText = template.render(data=data) # this is where to put args
|
|
59
|
+
return outputText
|
|
60
|
+
|
|
61
|
+
def inven_everyday(self, df, begin, end):
|
|
62
|
+
df1 = df.groupby(by=['id', 'date']).sum()
|
|
63
|
+
# 可以把复合index重新拆分成columns
|
|
64
|
+
trades = df1.reset_index()
|
|
65
|
+
trades['id'] = trades['id']
|
|
66
|
+
trades['date'] = trades['date']
|
|
67
|
+
# create a range of dates for the merged dataframe pd.datetime.today()
|
|
68
|
+
if not begin:
|
|
69
|
+
begin = df['date'].min()
|
|
70
|
+
if not end:
|
|
71
|
+
end = df['date'].max()
|
|
72
|
+
index_of_dates = pd.date_range(begin, end).to_frame().reset_index(drop=True).rename(columns={0: 'date'}).astype(
|
|
73
|
+
str)
|
|
74
|
+
# create a merged dataframe with columns date / stock / stock_Tr.
|
|
75
|
+
merged = pd.merge(index_of_dates, trades, how='left', on='date')
|
|
76
|
+
# create a pivottable showing the shares_TR of each stock for each date
|
|
77
|
+
shares_tr = merged.pivot(index='date', columns='id', values='q')
|
|
78
|
+
shares_tr = shares_tr.dropna(axis=1, how='all').fillna(0)
|
|
79
|
+
cumShares = shares_tr.cumsum()
|
|
80
|
+
cumShares.index = cumShares.index.astype(str)
|
|
81
|
+
return cumShares
|
|
82
|
+
|
|
83
|
+
def writeb64(self, path, b64):
|
|
84
|
+
dir = os.path.dirname(path)
|
|
85
|
+
if not os.path.exists(dir):
|
|
86
|
+
os.makedirs(dir, exist_ok=True)
|
|
87
|
+
content = base64.b64decode(b64)
|
|
88
|
+
with open(path, "wb") as f:
|
|
89
|
+
f.write(content)
|
|
90
|
+
os.chmod(path, 0o777)
|
|
91
|
+
|
|
92
|
+
def readb64(self, f):
|
|
93
|
+
with open(f, "rb") as file:
|
|
94
|
+
encoded_string = base64.b64encode(file.read())
|
|
95
|
+
return encoded_string.decode()
|
|
96
|
+
|
|
97
|
+
def prefix_zero(self, n, d):
|
|
98
|
+
if len(str(d)) >= n: return str(d)[-n:]
|
|
99
|
+
l = ["0"] * (n - len(str(d)))
|
|
100
|
+
zeros = "".join(l)
|
|
101
|
+
return f"{zeros}{d}"
|
|
102
|
+
|
|
103
|
+
def ascii2int(self,l,big_little,signed):
|
|
104
|
+
b = bytearray(l)
|
|
105
|
+
return int.from_bytes(b, byteorder=big_little,signed=signed)
|
|
52
106
|
|
|
107
|
+
def ascii2float(self,l,big):
|
|
108
|
+
s=bytearray(l).hex()
|
|
109
|
+
if big:
|
|
110
|
+
return struct.unpack('>f', bytes.fromhex(s))[0]
|
|
111
|
+
return struct.unpack('<f', bytes.fromhex(s))[0]
|
|
53
112
|
|
|
54
113
|
if __name__ == '__main__':
|
|
55
114
|
g = Common()
|
|
@@ -1,88 +1,8 @@
|
|
|
1
|
-
import pandas as pd
|
|
2
1
|
import jinja2, os,base64,struct, glob, arrow, uuid, hashlib
|
|
3
|
-
|
|
2
|
+
from remote_run_everything.tools.crc16 import *
|
|
4
3
|
|
|
5
4
|
class Common1:
|
|
6
5
|
|
|
7
|
-
def table_search(self, data, search):
|
|
8
|
-
res = []
|
|
9
|
-
for i in data:
|
|
10
|
-
if search == "":
|
|
11
|
-
res.append(i)
|
|
12
|
-
elif search != "" and search in str(i):
|
|
13
|
-
res.append(i)
|
|
14
|
-
return res
|
|
15
|
-
|
|
16
|
-
def split_page(self, numPerPage, cur, search, data):
|
|
17
|
-
data = self.table_search(data, search)
|
|
18
|
-
if data is None or len(data) == 0:
|
|
19
|
-
return {"total": 0, "data": []}
|
|
20
|
-
cur = int(cur)
|
|
21
|
-
res = {"total": len(data)}
|
|
22
|
-
n = int(numPerPage)
|
|
23
|
-
total = len(data)
|
|
24
|
-
start = (cur - 1) * n
|
|
25
|
-
end = cur * n
|
|
26
|
-
if start > total - 1:
|
|
27
|
-
res['data'] = []
|
|
28
|
-
elif end > total - 1:
|
|
29
|
-
remainder = total % numPerPage
|
|
30
|
-
if remainder == 0:
|
|
31
|
-
res['data'] = data[-numPerPage:]
|
|
32
|
-
else:
|
|
33
|
-
res['data'] = data[-remainder:]
|
|
34
|
-
else:
|
|
35
|
-
res['data'] = data[start:end]
|
|
36
|
-
return res
|
|
37
|
-
|
|
38
|
-
def render(self, dir, html, data):
|
|
39
|
-
env = jinja2.Environment(loader=jinja2.FileSystemLoader(f'{dir}/templates'))
|
|
40
|
-
template = env.get_template(html)
|
|
41
|
-
outputText = template.render(data=data) # this is where to put args
|
|
42
|
-
return outputText
|
|
43
|
-
|
|
44
|
-
def inven_everyday(self, df, begin, end):
|
|
45
|
-
df1 = df.groupby(by=['id', 'date']).sum()
|
|
46
|
-
# 可以把复合index重新拆分成columns
|
|
47
|
-
trades = df1.reset_index()
|
|
48
|
-
trades['id'] = trades['id']
|
|
49
|
-
trades['date'] = trades['date']
|
|
50
|
-
# create a range of dates for the merged dataframe pd.datetime.today()
|
|
51
|
-
if not begin:
|
|
52
|
-
begin = df['date'].min()
|
|
53
|
-
if not end:
|
|
54
|
-
end = df['date'].max()
|
|
55
|
-
index_of_dates = pd.date_range(begin, end).to_frame().reset_index(drop=True).rename(columns={0: 'date'}).astype(
|
|
56
|
-
str)
|
|
57
|
-
# create a merged dataframe with columns date / stock / stock_Tr.
|
|
58
|
-
merged = pd.merge(index_of_dates, trades, how='left', on='date')
|
|
59
|
-
# create a pivottable showing the shares_TR of each stock for each date
|
|
60
|
-
shares_tr = merged.pivot(index='date', columns='id', values='q')
|
|
61
|
-
shares_tr = shares_tr.dropna(axis=1, how='all').fillna(0)
|
|
62
|
-
cumShares = shares_tr.cumsum()
|
|
63
|
-
cumShares.index = cumShares.index.astype(str)
|
|
64
|
-
return cumShares
|
|
65
|
-
|
|
66
|
-
def writeb64(self, path, b64):
|
|
67
|
-
dir = os.path.dirname(path)
|
|
68
|
-
if not os.path.exists(dir):
|
|
69
|
-
os.makedirs(dir, exist_ok=True)
|
|
70
|
-
content = base64.b64decode(b64)
|
|
71
|
-
with open(path, "wb") as f:
|
|
72
|
-
f.write(content)
|
|
73
|
-
os.chmod(path, 0o777)
|
|
74
|
-
|
|
75
|
-
def readb64(self, f):
|
|
76
|
-
with open(f, "rb") as file:
|
|
77
|
-
encoded_string = base64.b64encode(file.read())
|
|
78
|
-
return encoded_string.decode()
|
|
79
|
-
|
|
80
|
-
def prefix_zero(self, n, d):
|
|
81
|
-
if len(str(d)) >= n: return str(d)[-n:]
|
|
82
|
-
l = ["0"] * (n - len(str(d)))
|
|
83
|
-
zeros = "".join(l)
|
|
84
|
-
return f"{zeros}{d}"
|
|
85
|
-
|
|
86
6
|
def clear_by_days(self, root, n):
|
|
87
7
|
files = glob.glob(f"{root}/*/*.*", recursive=True)
|
|
88
8
|
now = arrow.now()
|
|
@@ -96,28 +16,12 @@ class Common1:
|
|
|
96
16
|
hex_string = hashlib.md5(s.encode("UTF-8")).hexdigest()
|
|
97
17
|
return str(uuid.UUID(hex=hex_string))
|
|
98
18
|
|
|
99
|
-
def
|
|
100
|
-
|
|
101
|
-
tu = [self.prefix_zero(2, i) for i in tu]
|
|
102
|
-
return "".join(tu)
|
|
103
|
-
|
|
104
|
-
def ascii2int(self,l,big):
|
|
105
|
-
s=self.ascii2hex(l)
|
|
106
|
-
b = bytes.fromhex(s)
|
|
107
|
-
if big:
|
|
108
|
-
return int.from_bytes(b, byteorder='big')
|
|
109
|
-
return int.from_bytes(b, byteorder='little')
|
|
110
|
-
|
|
111
|
-
def ascii2float(self,l,big):
|
|
112
|
-
s=self.ascii2hex(l)
|
|
113
|
-
if big:
|
|
114
|
-
return struct.unpack('>f', bytes.fromhex(s))[0]
|
|
115
|
-
return struct.unpack('<f', bytes.fromhex(s))[0]
|
|
116
|
-
|
|
117
|
-
|
|
19
|
+
def add_crc16(self,package: bytes) -> bytes:
|
|
20
|
+
return add_crc16(package)
|
|
118
21
|
|
|
22
|
+
def check_crc16(self,package: bytes) -> bool:
|
|
23
|
+
return check_crc16(package)
|
|
119
24
|
|
|
120
25
|
|
|
121
26
|
if __name__ == '__main__':
|
|
122
27
|
g = Common1()
|
|
123
|
-
a = g.prefix_zero(5, 111)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# coding=utf8
|
|
2
|
+
|
|
3
|
+
LOW_BYTES = b'\
|
|
4
|
+
\x00\xC0\xC1\x01\xC3\x03\x02\xC2\xC6\x06\x07\xC7\x05\xC5\xC4\x04\
|
|
5
|
+
\xCC\x0C\x0D\xCD\x0F\xCF\xCE\x0E\x0A\xCA\xCB\x0B\xC9\x09\x08\xC8\
|
|
6
|
+
\xD8\x18\x19\xD9\x1B\xDB\xDA\x1A\x1E\xDE\xDF\x1F\xDD\x1D\x1C\xDC\
|
|
7
|
+
\x14\xD4\xD5\x15\xD7\x17\x16\xD6\xD2\x12\x13\xD3\x11\xD1\xD0\x10\
|
|
8
|
+
\xF0\x30\x31\xF1\x33\xF3\xF2\x32\x36\xF6\xF7\x37\xF5\x35\x34\xF4\
|
|
9
|
+
\x3C\xFC\xFD\x3D\xFF\x3F\x3E\xFE\xFA\x3A\x3B\xFB\x39\xF9\xF8\x38\
|
|
10
|
+
\x28\xE8\xE9\x29\xEB\x2B\x2A\xEA\xEE\x2E\x2F\xEF\x2D\xED\xEC\x2C\
|
|
11
|
+
\xE4\x24\x25\xE5\x27\xE7\xE6\x26\x22\xE2\xE3\x23\xE1\x21\x20\xE0\
|
|
12
|
+
\xA0\x60\x61\xA1\x63\xA3\xA2\x62\x66\xA6\xA7\x67\xA5\x65\x64\xA4\
|
|
13
|
+
\x6C\xAC\xAD\x6D\xAF\x6F\x6E\xAE\xAA\x6A\x6B\xAB\x69\xA9\xA8\x68\
|
|
14
|
+
\x78\xB8\xB9\x79\xBB\x7B\x7A\xBA\xBE\x7E\x7F\xBF\x7D\xBD\xBC\x7C\
|
|
15
|
+
\xB4\x74\x75\xB5\x77\xB7\xB6\x76\x72\xB2\xB3\x73\xB1\x71\x70\xB0\
|
|
16
|
+
\x50\x90\x91\x51\x93\x53\x52\x92\x96\x56\x57\x97\x55\x95\x94\x54\
|
|
17
|
+
\x9C\x5C\x5D\x9D\x5F\x9F\x9E\x5E\x5A\x9A\x9B\x5B\x99\x59\x58\x98\
|
|
18
|
+
\x88\x48\x49\x89\x4B\x8B\x8A\x4A\x4E\x8E\x8F\x4F\x8D\x4D\x4C\x8C\
|
|
19
|
+
\x44\x84\x85\x45\x87\x47\x46\x86\x82\x42\x43\x83\x41\x81\x80\x40'
|
|
20
|
+
|
|
21
|
+
HIGH_BYTES = b'\
|
|
22
|
+
\x00\xC1\x81\x40\x01\xC0\x80\x41\x01\xC0\x80\x41\x00\xC1\x81\x40\
|
|
23
|
+
\x01\xC0\x80\x41\x00\xC1\x81\x40\x00\xC1\x81\x40\x01\xC0\x80\x41\
|
|
24
|
+
\x01\xC0\x80\x41\x00\xC1\x81\x40\x00\xC1\x81\x40\x01\xC0\x80\x41\
|
|
25
|
+
\x00\xC1\x81\x40\x01\xC0\x80\x41\x01\xC0\x80\x41\x00\xC1\x81\x40\
|
|
26
|
+
\x01\xC0\x80\x41\x00\xC1\x81\x40\x00\xC1\x81\x40\x01\xC0\x80\x41\
|
|
27
|
+
\x00\xC1\x81\x40\x01\xC0\x80\x41\x01\xC0\x80\x41\x00\xC1\x81\x40\
|
|
28
|
+
\x00\xC1\x81\x40\x01\xC0\x80\x41\x01\xC0\x80\x41\x00\xC1\x81\x40\
|
|
29
|
+
\x01\xC0\x80\x41\x00\xC1\x81\x40\x00\xC1\x81\x40\x01\xC0\x80\x41\
|
|
30
|
+
\x01\xC0\x80\x41\x00\xC1\x81\x40\x00\xC1\x81\x40\x01\xC0\x80\x41\
|
|
31
|
+
\x00\xC1\x81\x40\x01\xC0\x80\x41\x01\xC0\x80\x41\x00\xC1\x81\x40\
|
|
32
|
+
\x00\xC1\x81\x40\x01\xC0\x80\x41\x01\xC0\x80\x41\x00\xC1\x81\x40\
|
|
33
|
+
\x01\xC0\x80\x41\x00\xC1\x81\x40\x00\xC1\x81\x40\x01\xC0\x80\x41\
|
|
34
|
+
\x00\xC1\x81\x40\x01\xC0\x80\x41\x01\xC0\x80\x41\x00\xC1\x81\x40\
|
|
35
|
+
\x01\xC0\x80\x41\x00\xC1\x81\x40\x00\xC1\x81\x40\x01\xC0\x80\x41\
|
|
36
|
+
\x01\xC0\x80\x41\x00\xC1\x81\x40\x00\xC1\x81\x40\x01\xC0\x80\x41\
|
|
37
|
+
\x00\xC1\x81\x40\x01\xC0\x80\x41\x01\xC0\x80\x41\x00\xC1\x81\x40'
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def crc16(data: bytes) -> bytes:
|
|
41
|
+
"""Calculate CRC-16 for Modbus."""
|
|
42
|
+
crc_high = 0xFF
|
|
43
|
+
crc_low = 0xFF
|
|
44
|
+
|
|
45
|
+
for byte in data:
|
|
46
|
+
index = crc_high ^ int(byte)
|
|
47
|
+
crc_high = crc_low ^ HIGH_BYTES[index]
|
|
48
|
+
crc_low = LOW_BYTES[index]
|
|
49
|
+
|
|
50
|
+
return bytes([crc_high, crc_low])
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def add_crc16(package: bytes) -> bytes:
|
|
54
|
+
"""Add CRC-16 to bytes package."""
|
|
55
|
+
return package + crc16(package)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def check_crc16(package: bytes) -> bool:
|
|
59
|
+
"""Validate signed bytes package."""
|
|
60
|
+
return crc16(package) == b'\x00\x00'
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
if __name__ == "__main__":
|
|
64
|
+
pass
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: remote_run_everything
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.1
|
|
4
4
|
Summary: Deploy Tools
|
|
5
5
|
Author-email: Wang Qi <wangmarkqi@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,9 +8,24 @@ Project-URL: Homepage, https://github.com/wangmarkqi/remote_run_everything
|
|
|
8
8
|
Project-URL: Issues, https://github.com/wangmarkqi/remote_run_everything/issues
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
+
Requires-Dist: setuptools>=40.8.0
|
|
15
|
+
Requires-Dist: wheel
|
|
16
|
+
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: sqlalchemy
|
|
18
|
+
Requires-Dist: arrow
|
|
19
|
+
Requires-Dist: duckdb
|
|
20
|
+
Requires-Dist: requests
|
|
21
|
+
Requires-Dist: paramiko
|
|
22
|
+
Requires-Dist: pymysql
|
|
23
|
+
Requires-Dist: psycopg2-binary
|
|
24
|
+
Requires-Dist: pandas
|
|
25
|
+
Requires-Dist: jinja2
|
|
26
|
+
Requires-Dist: pymongo
|
|
27
|
+
Requires-Dist: twine
|
|
28
|
+
Requires-Dist: build
|
|
14
29
|
Dynamic: license-file
|
|
15
30
|
|
|
16
31
|
# remote_run_everthing 各类实用代码集合封装
|
|
@@ -99,22 +114,8 @@ q = {"a": 2,"b":{"$gt":1}}
|
|
|
99
114
|
print(col.find(q))
|
|
100
115
|
db.drop_db()
|
|
101
116
|
```
|
|
102
|
-
## 进程管理
|
|
103
|
-
```python
|
|
104
|
-
import os
|
|
105
|
-
class ProcessManage:
|
|
106
|
-
# nosql is instance of Nosql or Nosqlmysql or Nqsqlpg
|
|
107
|
-
def __init__(self, nosql):
|
|
108
|
-
self.db = nosql
|
|
109
|
-
self.col = self.db['pid']
|
|
110
117
|
|
|
111
|
-
# 只需要在程序中引入这个函数,启动后会把pid存入数据库,然后有了pid,结合psutil,什么都有了
|
|
112
|
-
def save_pid(self, name, cmd):
|
|
113
|
-
dic = {"name": name, "cmd": cmd, "pid": os.getpid()}
|
|
114
|
-
print("save pid", dic)
|
|
115
|
-
self.col.insert_one(dic)
|
|
116
118
|
|
|
117
|
-
```
|
|
118
119
|
## 缓存装饰器
|
|
119
120
|
```python
|
|
120
121
|
from remote_run_everything import cache_by_1starg,cache_by_name,cache_by_rkey,cache_by_nth_arg
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
remote_run_everything/__init__.py,sha256=
|
|
1
|
+
remote_run_everything/__init__.py,sha256=C4YH1LMe1BFN3ZXe1w09LW53iH-GTAFCRHPlVjXMKIs,956
|
|
2
2
|
remote_run_everything/binocular/ba_front.py,sha256=wDCW5tycvaCAEau_vxhoyUEuB_9HhUMibbxr1c1SoNk,2592
|
|
3
3
|
remote_run_everything/binocular/back_tool.py,sha256=eUGdkwE4TMm-hmjs4puVM-iy_iyJJuPEqdZWQxKvOGc,4873
|
|
4
4
|
remote_run_everything/binocular/cam_tool.py,sha256=ASZ2opsrnjhlvV7N6hn9axUjWIeQskR3t44a8oRpppw,1032
|
|
@@ -7,12 +7,13 @@ remote_run_everything/binocular/relative_pos.py,sha256=FX6pwXgK_JViPa1cjbHOYEYG3
|
|
|
7
7
|
remote_run_everything/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
remote_run_everything/db/backup.py,sha256=_mDUNQo1q6Gc75-diwadrooZsdV89KGG9mIcS4rmcBQ,1152
|
|
9
9
|
remote_run_everything/db/crud_sqlalchemy.py,sha256=cDyDGHwE-1TUBZrXMVDTjIa4Z0ZUQvM9m9sk-eIwaSM,5192
|
|
10
|
-
remote_run_everything/db/crude_duck.py,sha256=
|
|
10
|
+
remote_run_everything/db/crude_duck.py,sha256=qO4Giwmgbgmu7VClL5gueItumFG8pPMA0ZbjWGmd_CI,4369
|
|
11
11
|
remote_run_everything/db/kv_store.py,sha256=Df2Lp2l5ip0YQuTdVnlQbkZT_Sz01j9D5bJ8PYaSFRY,3357
|
|
12
12
|
remote_run_everything/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
remote_run_everything/deploy/by_http.py,sha256=QWL3XqLTbp9O2WadPX59uR1fGJdgd9xzg1Pv8CuxfbQ,2661
|
|
14
14
|
remote_run_everything/deploy/by_http_tool.py,sha256=H_-OvpayNVGG9e93Qnq5SCT0CsDbCEVtiA2kF2XVQ8U,3166
|
|
15
15
|
remote_run_everything/deploy/by_sftp.py,sha256=dGb8SmhTlFntL_wRFRSubNziSy9xrd-Uzm5AdGHgHB4,2688
|
|
16
|
+
remote_run_everything/deploy/process_manage.py,sha256=kOf4rEH9yxyZldP_xvGSbfpUVhOxU0Jbl5jEcp5XIio,1511
|
|
16
17
|
remote_run_everything/deploy/record_mod.py,sha256=29L-RTnvANpjbWRND7GGz5sdCzbz1Ba9QxdS858bdAY,725
|
|
17
18
|
remote_run_everything/nosql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
19
|
remote_run_everything/nosql/no_sql.py,sha256=1-dT6LhrayQqLqZ4ES2tmWfXYCEXOnqwNzKgyXWYRG4,2343
|
|
@@ -20,14 +21,15 @@ remote_run_everything/nosql/no_sql_mysql.py,sha256=agpXc5UcevN_uojexD9pNG6xAR099
|
|
|
20
21
|
remote_run_everything/nosql/no_sql_pg.py,sha256=XCrEnHKp5RVHPOyPOMICY2PnvNMkkIIDijTVKjk-ENc,2209
|
|
21
22
|
remote_run_everything/nosql/no_sql_tool.py,sha256=xRu7vsDgr3JQNSo6CLNTtNNxlg4fl-Q7_vw4y9lklWI,2590
|
|
22
23
|
remote_run_everything/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
-
remote_run_everything/tools/common.py,sha256=
|
|
24
|
-
remote_run_everything/tools/common1.py,sha256=
|
|
24
|
+
remote_run_everything/tools/common.py,sha256=HQD1m8_jbA_RLRmnjPvWYeVUbDl_KtkfkQwpia8jlbA,4166
|
|
25
|
+
remote_run_everything/tools/common1.py,sha256=zK7hVufrVfSkgtUgBDrBfEmIFtA5VefwYVLyxCt0u08,792
|
|
26
|
+
remote_run_everything/tools/crc16.py,sha256=PG24zWESN3MdtBbEfdiwDvhuvN3a-sZjOB8yU69zQPg,2797
|
|
25
27
|
remote_run_everything/tools/decorators.py,sha256=SIacNAs7afgkU0D09J-s-YscCVnxSG8Qj9vSL4VzCHw,1988
|
|
26
28
|
remote_run_everything/tools/sqlacodegen_go_struct.py,sha256=0xWJVCjFyEF2VjC1aGo6DmIqEQQ0Q46CfBAb9FSCUuE,3237
|
|
27
29
|
remote_run_everything/vsconf/conf_txt.py,sha256=nhFuKLlts-sCIBmfr0IKv1pP-qPUvQQrsRRg21q5Gd4,2418
|
|
28
30
|
remote_run_everything/vsconf/core.py,sha256=HmSEzXjGPY7R64rwfAV024YxMHwmBkLin6lGace4U0M,833
|
|
29
|
-
remote_run_everything-2.
|
|
30
|
-
remote_run_everything-2.
|
|
31
|
-
remote_run_everything-2.
|
|
32
|
-
remote_run_everything-2.
|
|
33
|
-
remote_run_everything-2.
|
|
31
|
+
remote_run_everything-2.1.1.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
|
32
|
+
remote_run_everything-2.1.1.dist-info/METADATA,sha256=TQinRk_es5s7JwmrY4UlzU7nUaAy2b8d439j6RxRYCk,4471
|
|
33
|
+
remote_run_everything-2.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
34
|
+
remote_run_everything-2.1.1.dist-info/top_level.txt,sha256=1TUcAqPgSwiVBqUHz-1pZFXvRpr9cudEYlmfw_mztRY,22
|
|
35
|
+
remote_run_everything-2.1.1.dist-info/RECORD,,
|
{remote_run_everything-2.0.8.dist-info → remote_run_everything-2.1.1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{remote_run_everything-2.0.8.dist-info → remote_run_everything-2.1.1.dist-info}/top_level.txt
RENAMED
|
File without changes
|