remote-run-everything 1.4__tar.gz → 1.6__tar.gz
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-1.4 → remote_run_everything-1.6}/PKG-INFO +1 -5
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything/remote.py +34 -21
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything.egg-info/PKG-INFO +1 -5
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything.egg-info/SOURCES.txt +1 -0
- remote_run_everything-1.6/remote_run_everything.egg-info/requires.txt +1 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/setup.py +6 -3
- {remote_run_everything-1.4 → remote_run_everything-1.6}/MANIFEST.in +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/README.md +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything/__init__.py +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything/__scripts__/kill_ps.py +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything/__scripts__/kill_ss.py +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything/__scripts__/mongo_dump_restore.py +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything/conf.py +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything/local.py +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything.egg-info/dependency_links.txt +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything.egg-info/top_level.txt +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/setup.cfg +0 -0
- {remote_run_everything-1.4 → remote_run_everything-1.6}/test/test.py +0 -0
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: remote_run_everything
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6
|
|
4
4
|
Summary: 远程上传、调试、下载任何语言
|
|
5
5
|
Home-page: https://github.com/wangmarkqi/remote_run_everything
|
|
6
6
|
Author: Wang Qi
|
|
7
7
|
Author-email: wangmarkqi@gmail.com
|
|
8
|
-
License: UNKNOWN
|
|
9
8
|
Keywords: remote,debug,development tool
|
|
10
|
-
Platform: UNKNOWN
|
|
11
9
|
Classifier: Programming Language :: Python :: 3
|
|
12
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
11
|
Classifier: Operating System :: OS Independent
|
|
@@ -106,5 +104,3 @@ r.cmd(['source /home/anaconda3/bin/activate server','python ./__scripts__/mongo_
|
|
|
106
104
|
start=['source /home/anaconda3/bin/activate server',"gunicorn riskMis:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8887 --daemon"]
|
|
107
105
|
r.cmd(start)
|
|
108
106
|
```
|
|
109
|
-
|
|
110
|
-
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import pysftp, os
|
|
2
2
|
|
|
3
|
-
import os,pickle
|
|
3
|
+
import os, pickle
|
|
4
|
+
|
|
5
|
+
|
|
4
6
|
class Remote:
|
|
5
7
|
def __init__(self, conf):
|
|
6
8
|
self.c = conf
|
|
7
|
-
self.hist_pickle=os.path.join(self.c.local_root,"up_hist.pickle").replace("\\","/")
|
|
9
|
+
self.hist_pickle = os.path.join(self.c.local_root, "up_hist.pickle").replace("\\", "/")
|
|
8
10
|
|
|
9
11
|
def get_upload_records(self):
|
|
10
12
|
if os.path.exists(self.hist_pickle):
|
|
11
13
|
with open(self.hist_pickle, 'rb') as file:
|
|
12
14
|
try:
|
|
13
|
-
data=pickle.load(file)
|
|
15
|
+
data = pickle.load(file)
|
|
14
16
|
return data
|
|
15
17
|
except EOFError:
|
|
16
18
|
return None
|
|
@@ -20,52 +22,62 @@ class Remote:
|
|
|
20
22
|
pickle.dump(data, file)
|
|
21
23
|
|
|
22
24
|
def upload_record_or_not(self, file_path):
|
|
23
|
-
if file_path==self.hist_pickle:
|
|
25
|
+
if file_path == self.hist_pickle:
|
|
24
26
|
return False
|
|
25
|
-
already=self.get_upload_records()
|
|
26
|
-
new_rev=os.path.getmtime(file_path)
|
|
27
|
+
already = self.get_upload_records()
|
|
28
|
+
new_rev = os.path.getmtime(file_path)
|
|
27
29
|
if already is not None:
|
|
28
|
-
old_rev=already.get((self.c.host, file_path), None)
|
|
29
|
-
if new_rev!=old_rev:
|
|
30
|
-
already[(self.c.host, file_path)]=new_rev
|
|
30
|
+
old_rev = already.get((self.c.host, file_path), None)
|
|
31
|
+
if new_rev != old_rev:
|
|
32
|
+
already[(self.c.host, file_path)] = new_rev
|
|
31
33
|
self.save_upload_records(already)
|
|
32
34
|
return True
|
|
33
35
|
else:
|
|
34
36
|
return False
|
|
35
37
|
else:
|
|
36
|
-
dic={}
|
|
37
|
-
dic[(self.c.host, file_path)]=new_rev
|
|
38
|
+
dic = {}
|
|
39
|
+
dic[(self.c.host, file_path)] = new_rev
|
|
38
40
|
self.save_upload_records(dic)
|
|
39
41
|
return True
|
|
42
|
+
|
|
43
|
+
def conn(self):
|
|
44
|
+
cnopts = pysftp.CnOpts()
|
|
45
|
+
cnopts.hostkeys = None
|
|
46
|
+
return pysftp.Connection(self.c.host, username=self.c.user, port=self.c.port, password=self.c.pwd,
|
|
47
|
+
cnopts=cnopts)
|
|
48
|
+
|
|
40
49
|
def upload(self, data):
|
|
41
50
|
cnopts = pysftp.CnOpts()
|
|
42
51
|
cnopts.hostkeys = None
|
|
43
|
-
with pysftp.Connection(self.c.host, username=self.c.user, port=self.c.port,password=self.c.pwd,
|
|
52
|
+
with pysftp.Connection(self.c.host, username=self.c.user, port=self.c.port, password=self.c.pwd,
|
|
53
|
+
cnopts=cnopts) as shell:
|
|
44
54
|
for i in data:
|
|
45
|
-
will_up=self.upload_record_or_not(i[0])
|
|
55
|
+
will_up = self.upload_record_or_not(i[0])
|
|
46
56
|
if will_up:
|
|
47
|
-
print
|
|
57
|
+
print("upload file:", i[0])
|
|
48
58
|
remote_dir = os.path.dirname(i[1])
|
|
49
59
|
shell.makedirs(remote_dir, mode=777)
|
|
50
60
|
shell.put(i[0], i[1])
|
|
51
|
-
|
|
61
|
+
|
|
52
62
|
def download(self, data):
|
|
53
63
|
cnopts = pysftp.CnOpts()
|
|
54
64
|
cnopts.hostkeys = None
|
|
55
|
-
with pysftp.Connection(self.c.host, username=self.c.user, port=self.c.port,password=self.c.pwd,
|
|
65
|
+
with pysftp.Connection(self.c.host, username=self.c.user, port=self.c.port, password=self.c.pwd,
|
|
66
|
+
cnopts=cnopts) as shell:
|
|
56
67
|
for i in data:
|
|
57
68
|
local_dir = os.path.dirname(i[0])
|
|
58
69
|
os.makedirs(local_dir, exist_ok=True, mode=777)
|
|
59
70
|
shell.get(i[1], i[0])
|
|
60
|
-
|
|
71
|
+
|
|
61
72
|
def get_remote(self, dir):
|
|
62
73
|
files = self._get_remote(dir, [])
|
|
63
74
|
return files
|
|
64
|
-
|
|
75
|
+
|
|
65
76
|
def _get_remote(self, root, res):
|
|
66
77
|
cnopts = pysftp.CnOpts()
|
|
67
78
|
cnopts.hostkeys = None
|
|
68
|
-
with pysftp.Connection(self.c.host, username=self.c.user, port=self.c.port,password=self.c.pwd,
|
|
79
|
+
with pysftp.Connection(self.c.host, username=self.c.user, port=self.c.port, password=self.c.pwd,
|
|
80
|
+
cnopts=cnopts) as shell:
|
|
69
81
|
data = shell.listdir(root)
|
|
70
82
|
for d in data:
|
|
71
83
|
new = os.path.join(root, d).replace("\\", "/")
|
|
@@ -74,11 +86,12 @@ class Remote:
|
|
|
74
86
|
else:
|
|
75
87
|
self._get_remote(new, res)
|
|
76
88
|
return res
|
|
77
|
-
|
|
89
|
+
|
|
78
90
|
def cmd(self, cmds):
|
|
79
91
|
cnopts = pysftp.CnOpts()
|
|
80
92
|
cnopts.hostkeys = None
|
|
81
|
-
with pysftp.Connection(self.c.host, username=self.c.user,port=self.c.port, password=self.c.pwd,
|
|
93
|
+
with pysftp.Connection(self.c.host, username=self.c.user, port=self.c.port, password=self.c.pwd,
|
|
94
|
+
cnopts=cnopts) as shell:
|
|
82
95
|
common_cmds = ["/usr/bin/bash -c", f"cd {self.c.remote_root}"]
|
|
83
96
|
all = common_cmds + cmds
|
|
84
97
|
cmd = ";".join(all)
|
{remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything.egg-info/PKG-INFO
RENAMED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: remote-run-everything
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6
|
|
4
4
|
Summary: 远程上传、调试、下载任何语言
|
|
5
5
|
Home-page: https://github.com/wangmarkqi/remote_run_everything
|
|
6
6
|
Author: Wang Qi
|
|
7
7
|
Author-email: wangmarkqi@gmail.com
|
|
8
|
-
License: UNKNOWN
|
|
9
8
|
Keywords: remote,debug,development tool
|
|
10
|
-
Platform: UNKNOWN
|
|
11
9
|
Classifier: Programming Language :: Python :: 3
|
|
12
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
11
|
Classifier: Operating System :: OS Independent
|
|
@@ -106,5 +104,3 @@ r.cmd(['source /home/anaconda3/bin/activate server','python ./__scripts__/mongo_
|
|
|
106
104
|
start=['source /home/anaconda3/bin/activate server',"gunicorn riskMis:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8887 --daemon"]
|
|
107
105
|
r.cmd(start)
|
|
108
106
|
```
|
|
109
|
-
|
|
110
|
-
|
{remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything.egg-info/SOURCES.txt
RENAMED
|
@@ -8,6 +8,7 @@ remote_run_everything/remote.py
|
|
|
8
8
|
remote_run_everything.egg-info/PKG-INFO
|
|
9
9
|
remote_run_everything.egg-info/SOURCES.txt
|
|
10
10
|
remote_run_everything.egg-info/dependency_links.txt
|
|
11
|
+
remote_run_everything.egg-info/requires.txt
|
|
11
12
|
remote_run_everything.egg-info/top_level.txt
|
|
12
13
|
remote_run_everything/__scripts__/kill_ps.py
|
|
13
14
|
remote_run_everything/__scripts__/kill_ss.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pysftp
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import setuptools
|
|
2
2
|
# read the contents of your README file
|
|
3
3
|
from os import path
|
|
4
|
+
|
|
4
5
|
this_directory = path.abspath(path.dirname(__file__))
|
|
5
6
|
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
|
|
6
7
|
long_description = f.read()
|
|
7
8
|
setuptools.setup(
|
|
8
9
|
name='remote_run_everything',
|
|
9
|
-
version='1.
|
|
10
|
+
version='1.6',
|
|
10
11
|
description='远程上传、调试、下载任何语言',
|
|
11
12
|
long_description=long_description,
|
|
12
13
|
long_description_content_type='text/markdown',
|
|
@@ -23,6 +24,8 @@ setuptools.setup(
|
|
|
23
24
|
],
|
|
24
25
|
python_requires='>=3.6',
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
install_requires=[
|
|
28
|
+
'pysftp',
|
|
29
|
+
],
|
|
28
30
|
|
|
31
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything/__scripts__/kill_ps.py
RENAMED
|
File without changes
|
{remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything/__scripts__/kill_ss.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{remote_run_everything-1.4 → remote_run_everything-1.6}/remote_run_everything.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|