remote-run-everything 2.0.5__py3-none-any.whl → 2.0.6__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.
@@ -29,9 +29,12 @@ class ByHttp:
29
29
  sql = f"select * from down where path='{path}' and time='{t}' "
30
30
  res = con.sql(sql).fetchone()
31
31
  if res is not None: continue
32
+ ok=self.t.pull(self.host, path, self.local, self.remote)
33
+ if ok!="ok":
34
+ print ("err==",ok,dic)
35
+ continue
32
36
  print("down", dic)
33
37
  con.execute(f"delete from down where path='{path}' ")
34
- self.t.pull(self.host, path, self.local, self.remote)
35
38
  add_l.append(dic)
36
39
  con.commit()
37
40
  c.insert_many(eg, mod, add_l)
@@ -53,10 +56,13 @@ class ByHttp:
53
56
  sql = f"select * from up where path='{path}' and time='{t}' and host='{self.host}' "
54
57
  res = con.sql(sql).fetchone()
55
58
  if res is not None: continue
59
+ ok=self.t.push(self.host, path, self.local, self.remote)
60
+ if ok!="ok":
61
+ print ("err==",ok,dic)
62
+ continue
56
63
  print("up==", dic)
57
64
  sql = f"delete from up where path='{path}' and host='{self.host}'"
58
65
  con.execute(sql).commit()
59
- self.t.push(self.host, path, self.local, self.remote)
60
66
  dic['host'] = self.host
61
67
  add_l.append(dic)
62
68
  con.commit()
@@ -6,23 +6,26 @@ import os, glob, arrow, requests
6
6
  class ByHttpTool:
7
7
  def push(self, host, f, local, remote):
8
8
  # b64 = Common().readb64(f)
9
- # push_url = f"{host}/wb64"
9
+ # push_url = f"{host}/wb64"
10
10
  # pay = {"b64": b64, "path": path}
11
11
  # res = requests.post(push_url, json=pay).json()
12
12
  rpath = self.loc2remote(f, local, remote)
13
13
  lpath = f
14
- self.upload_file(host, rpath, lpath)
15
- return
14
+ return self.upload_file(host, rpath, lpath)
15
+
16
16
 
17
17
  def pull(self, host, f, local, remote):
18
18
  rpath = f
19
19
  lpath = self.remote2loc(f, local, remote)
20
- self.download_file(host, rpath, lpath)
20
+ try:
21
+ self.download_file(host, rpath, lpath)
22
+ return "ok"
23
+ except Exception as e:
24
+ return str(e)
21
25
  # res = requests.post(f"{host}/rb64", json={"path": f}).json()
22
26
  # b64 = res['data']
23
27
  # path = self.remote2loc(f, local, remote)
24
28
  # Common().writeb64(path, b64)
25
- return
26
29
 
27
30
  def all_remote_path(self, host, root, disallow_keys=None):
28
31
  url = f"{host}/iterdir"
@@ -83,6 +86,5 @@ class ByHttpTool:
83
86
  def upload_file(self, host, rpath, lpath):
84
87
  url = f"{host}/upfile"
85
88
  files = {'files': open(lpath, 'rb')}
86
- r = requests.post(url, files=files, data={'path': rpath})
87
- if "ok" in r.text: return "ok"
88
- return "fail"
89
+ r = requests.post(url, files=files, data={'path': rpath}).json()
90
+ return r['status']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: remote_run_everything
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Summary: Deploy Tools
5
5
  Author-email: Wang Qi <wangmarkqi@gmail.com>
6
6
  License-Expression: MIT
@@ -5,8 +5,8 @@ remote_run_everything/db/crud_sqlalchemy.py,sha256=cDyDGHwE-1TUBZrXMVDTjIa4Z0ZUQ
5
5
  remote_run_everything/db/crude_duck.py,sha256=OYkE26_Js_PFr0DoBOBCZ6tYxsp7BhhNvGMn7-rJgWA,4370
6
6
  remote_run_everything/db/kv_store.py,sha256=Df2Lp2l5ip0YQuTdVnlQbkZT_Sz01j9D5bJ8PYaSFRY,3357
7
7
  remote_run_everything/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- remote_run_everything/deploy/by_http.py,sha256=q08g3qCoDcu7y1SfEfRsWU2rlbJAYZDHYEZ7Utprf8k,2471
9
- remote_run_everything/deploy/by_http_tool.py,sha256=w0BAcp9-nEIyKmCSBLoZzFMsILzf91nLDiH0iDMOr0w,3110
8
+ remote_run_everything/deploy/by_http.py,sha256=QWL3XqLTbp9O2WadPX59uR1fGJdgd9xzg1Pv8CuxfbQ,2661
9
+ remote_run_everything/deploy/by_http_tool.py,sha256=H_-OvpayNVGG9e93Qnq5SCT0CsDbCEVtiA2kF2XVQ8U,3166
10
10
  remote_run_everything/deploy/record_mod.py,sha256=29L-RTnvANpjbWRND7GGz5sdCzbz1Ba9QxdS858bdAY,725
11
11
  remote_run_everything/nosql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  remote_run_everything/nosql/no_sql.py,sha256=1-dT6LhrayQqLqZ4ES2tmWfXYCEXOnqwNzKgyXWYRG4,2343
@@ -20,8 +20,8 @@ remote_run_everything/tools/decorators.py,sha256=SIacNAs7afgkU0D09J-s-YscCVnxSG8
20
20
  remote_run_everything/tools/sqlacodegen_go_struct.py,sha256=0xWJVCjFyEF2VjC1aGo6DmIqEQQ0Q46CfBAb9FSCUuE,3237
21
21
  remote_run_everything/vsconf/conf_txt.py,sha256=nhFuKLlts-sCIBmfr0IKv1pP-qPUvQQrsRRg21q5Gd4,2418
22
22
  remote_run_everything/vsconf/core.py,sha256=HmSEzXjGPY7R64rwfAV024YxMHwmBkLin6lGace4U0M,833
23
- remote_run_everything-2.0.5.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
24
- remote_run_everything-2.0.5.dist-info/METADATA,sha256=Z0SSxn3qhvpwoMFV-GN4l6lEvquPzr7lfNjNAf2QVHs,3121
25
- remote_run_everything-2.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
- remote_run_everything-2.0.5.dist-info/top_level.txt,sha256=1TUcAqPgSwiVBqUHz-1pZFXvRpr9cudEYlmfw_mztRY,22
27
- remote_run_everything-2.0.5.dist-info/RECORD,,
23
+ remote_run_everything-2.0.6.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
24
+ remote_run_everything-2.0.6.dist-info/METADATA,sha256=y5vDF98lRt0ZfgIpzrh3byYsG-rmkhq8nM2AWVLtiOQ,3121
25
+ remote_run_everything-2.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
+ remote_run_everything-2.0.6.dist-info/top_level.txt,sha256=1TUcAqPgSwiVBqUHz-1pZFXvRpr9cudEYlmfw_mztRY,22
27
+ remote_run_everything-2.0.6.dist-info/RECORD,,