Skip to content

Commit 4e061e8

Browse files
authored
Merge pull request #3419 from threefoldtech/development
2 parents 4160e2f + 7d1a7f7 commit 4e061e8

File tree

44 files changed

+457
-493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+457
-493
lines changed

.github/workflows/black-docstr.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ name: black-docstr
22

33
on: pull_request
44
jobs:
5-
black-docstr:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v2
9-
- name: Install dependencies
10-
run: |
11-
sudo apt-get update
12-
sudo apt-get install -y git python3-pip
13-
sudo pip3 install black==22.10.0 docstr-coverage
14-
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
15-
- name: Running black and docstr-coverage check
16-
run: |
17-
FILES="$(git diff --name-only --diff-filter=A --diff-filter=M "origin/${{github.base_ref}}" '*.py')"
18-
black --check -l 120 -t py37 --exclude 'templates' $FILES
19-
for FILE in $FILES; do echo $FILE; docstr-coverage $FILE || true; done
5+
black-docstr:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Install dependencies
10+
run: |
11+
sudo apt-get update
12+
sudo apt-get install -y git python3-pip
13+
sudo pip3 install black==22.10.0 docstr-coverage
14+
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
15+
- name: Running black and docstr-coverage check
16+
run: |
17+
FILES="$(git diff --name-only --diff-filter=A --diff-filter=M "origin/${{github.base_ref}}" '*.py')"
18+
[ ! -z "$FILES" ] && black --check -l 120 -t py37 --exclude 'templates' $FILES
19+
for FILE in $FILES; do echo $FILE; docstr-coverage $FILE || true; done

docs/api/jumpscale/clients/redis/redis.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ <h1 class="title">Module <code>jumpscale.clients.redis.redis</code></h1>
7474
self.__client = Redis(self.hostname, self.port)
7575

7676
return self.__client
77-
77+
7878
def is_running(self):
7979
try:
8080
return self.redis_client.ping()
@@ -154,7 +154,7 @@ <h2 id="args">Args</h2>
154154
self.__client = Redis(self.hostname, self.port)
155155

156156
return self.__client
157-
157+
158158
def is_running(self):
159159
try:
160160
return self.redis_client.ping()

docs/api/jumpscale/clients/sshclient/sshclient.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ <h2 id="creating-sshclient-using-that-key-and-executing-commands">Creating sshcl
107107

108108
@property
109109
def _sshkey(self):
110-
&#34;&#34;&#34; Get sshkey client that you have loaded
110+
&#34;&#34;&#34;Get sshkey client that you have loaded
111111
e.g
112112
JS-NG&gt; localconnection = j.clients.sshclient.new(&#34;localconnection&#34;)
113113
JS-NG&gt; localconnection.sshkey = &#34;xmonader&#34;
@@ -138,7 +138,7 @@ <h2 id="creating-sshclient-using-that-key-and-executing-commands">Creating sshcl
138138
return self.__client
139139

140140
def reset_connection(self):
141-
&#34;&#34;&#34; Reset the connection
141+
&#34;&#34;&#34;Reset the connection
142142
e.g
143143
localconnection = j.clients.sshclient.new(&#34;localconnection&#34;)
144144
localconnection.reset_connection()
@@ -224,7 +224,7 @@ <h2 id="args">Args</h2>
224224

225225
@property
226226
def _sshkey(self):
227-
&#34;&#34;&#34; Get sshkey client that you have loaded
227+
&#34;&#34;&#34;Get sshkey client that you have loaded
228228
e.g
229229
JS-NG&gt; localconnection = j.clients.sshclient.new(&#34;localconnection&#34;)
230230
JS-NG&gt; localconnection.sshkey = &#34;xmonader&#34;
@@ -255,7 +255,7 @@ <h2 id="args">Args</h2>
255255
return self.__client
256256

257257
def reset_connection(self):
258-
&#34;&#34;&#34; Reset the connection
258+
&#34;&#34;&#34;Reset the connection
259259
e.g
260260
localconnection = j.clients.sshclient.new(&#34;localconnection&#34;)
261261
localconnection.reset_connection()
@@ -531,7 +531,7 @@ <h3>Methods</h3>
531531
<span>Expand source code</span>
532532
</summary>
533533
<pre><code class="python">def reset_connection(self):
534-
&#34;&#34;&#34; Reset the connection
534+
&#34;&#34;&#34;Reset the connection
535535
e.g
536536
localconnection = j.clients.sshclient.new(&#34;localconnection&#34;)
537537
localconnection.reset_connection()

docs/api/jumpscale/clients/sshkey/sshkey.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ <h3 id="writing-ssh-keys-to-files-system">Writing ssh keys to files system</h3>
9191
self.load_from_file_system()
9292

9393
def load_from_file_system(self):
94-
&#34;&#34;&#34; Load public key and private key from files using private key path and public key path
94+
&#34;&#34;&#34;Load public key and private key from files using private key path and public key path
9595
e.g
9696
ssh_cl = j.clients.sshkey.get(&#34;ssh_test&#34;)
9797
ssh_cl.load_from_file_system()
@@ -122,7 +122,7 @@ <h3 id="writing-ssh-keys-to-files-system">Writing ssh keys to files system</h3>
122122

123123
@property
124124
def public_key_path(self):
125-
&#34;&#34;&#34; Get the public key path
125+
&#34;&#34;&#34;Get the public key path
126126
e.g
127127
ssh_cl = j.clients.sshkey.get(&#34;ssh_test&#34;)
128128
ssh_cl.public_key_path -&gt; &#34;/root/.config/jumpscale/sshkeys/tU59lc6P.pub&#34;
@@ -133,7 +133,7 @@ <h3 id="writing-ssh-keys-to-files-system">Writing ssh keys to files system</h3>
133133
return &#34;{}.pub&#34;.format(self.private_key_path)
134134

135135
def write_to_filesystem(self):
136-
&#34;&#34;&#34; Write public key and private key to files using private key path and public key path.
136+
&#34;&#34;&#34;Write public key and private key to files using private key path and public key path.
137137
e.g
138138
ssh_cl = j.clients.sshkey.get(&#34;ssh_test&#34;)
139139
ssh_cl.write_to_filesystem()
@@ -204,7 +204,7 @@ <h2 id="args">Args</h2>
204204
self.load_from_file_system()
205205

206206
def load_from_file_system(self):
207-
&#34;&#34;&#34; Load public key and private key from files using private key path and public key path
207+
&#34;&#34;&#34;Load public key and private key from files using private key path and public key path
208208
e.g
209209
ssh_cl = j.clients.sshkey.get(&#34;ssh_test&#34;)
210210
ssh_cl.load_from_file_system()
@@ -235,7 +235,7 @@ <h2 id="args">Args</h2>
235235

236236
@property
237237
def public_key_path(self):
238-
&#34;&#34;&#34; Get the public key path
238+
&#34;&#34;&#34;Get the public key path
239239
e.g
240240
ssh_cl = j.clients.sshkey.get(&#34;ssh_test&#34;)
241241
ssh_cl.public_key_path -&gt; &#34;/root/.config/jumpscale/sshkeys/tU59lc6P.pub&#34;
@@ -246,7 +246,7 @@ <h2 id="args">Args</h2>
246246
return &#34;{}.pub&#34;.format(self.private_key_path)
247247

248248
def write_to_filesystem(self):
249-
&#34;&#34;&#34; Write public key and private key to files using private key path and public key path.
249+
&#34;&#34;&#34;Write public key and private key to files using private key path and public key path.
250250
e.g
251251
ssh_cl = j.clients.sshkey.get(&#34;ssh_test&#34;)
252252
ssh_cl.write_to_filesystem()
@@ -448,7 +448,7 @@ <h2 id="returns">Returns</h2>
448448
</summary>
449449
<pre><code class="python">@property
450450
def public_key_path(self):
451-
&#34;&#34;&#34; Get the public key path
451+
&#34;&#34;&#34;Get the public key path
452452
e.g
453453
ssh_cl = j.clients.sshkey.get(&#34;ssh_test&#34;)
454454
ssh_cl.public_key_path -&gt; &#34;/root/.config/jumpscale/sshkeys/tU59lc6P.pub&#34;
@@ -522,7 +522,7 @@ <h3>Methods</h3>
522522
<span>Expand source code</span>
523523
</summary>
524524
<pre><code class="python">def load_from_file_system(self):
525-
&#34;&#34;&#34; Load public key and private key from files using private key path and public key path
525+
&#34;&#34;&#34;Load public key and private key from files using private key path and public key path
526526
e.g
527527
ssh_cl = j.clients.sshkey.get(&#34;ssh_test&#34;)
528528
ssh_cl.load_from_file_system()
@@ -544,7 +544,7 @@ <h3>Methods</h3>
544544
<span>Expand source code</span>
545545
</summary>
546546
<pre><code class="python">def write_to_filesystem(self):
547-
&#34;&#34;&#34; Write public key and private key to files using private key path and public key path.
547+
&#34;&#34;&#34;Write public key and private key to files using private key path and public key path.
548548
e.g
549549
ssh_cl = j.clients.sshkey.get(&#34;ssh_test&#34;)
550550
ssh_cl.write_to_filesystem()

docs/api/jumpscale/core/base/factory.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ <h1 class="title">Module <code>jumpscale.core.base.factory</code></h1>
603603
raise ValueError(&#34;at least one query parameter is required, e.g. age=10&#34;)
604604

605605
new_cursor, count, result = self.store.find(cursor_=cursor_, limit_=limit_, **query)
606-
return new_cursor, count, (self._get_object_from_config(data[KEY_FIELD_NAME], data) for data in result)
606+
return (new_cursor, count, (self._get_object_from_config(data[KEY_FIELD_NAME], data) for data in result))
607607

608608
def list_all(self):
609609
&#34;&#34;&#34;
@@ -1478,7 +1478,7 @@ <h2 id="args">Args</h2>
14781478
raise ValueError(&#34;at least one query parameter is required, e.g. age=10&#34;)
14791479

14801480
new_cursor, count, result = self.store.find(cursor_=cursor_, limit_=limit_, **query)
1481-
return new_cursor, count, (self._get_object_from_config(data[KEY_FIELD_NAME], data) for data in result)
1481+
return (new_cursor, count, (self._get_object_from_config(data[KEY_FIELD_NAME], data) for data in result))
14821482

14831483
def list_all(self):
14841484
&#34;&#34;&#34;
@@ -1657,7 +1657,7 @@ <h2 id="returns">Returns</h2>
16571657
raise ValueError(&#34;at least one query parameter is required, e.g. age=10&#34;)
16581658

16591659
new_cursor, count, result = self.store.find(cursor_=cursor_, limit_=limit_, **query)
1660-
return new_cursor, count, (self._get_object_from_config(data[KEY_FIELD_NAME], data) for data in result)</code></pre>
1660+
return (new_cursor, count, (self._get_object_from_config(data[KEY_FIELD_NAME], data) for data in result))</code></pre>
16611661
</details>
16621662
</dd>
16631663
<dt id="jumpscale.core.base.factory.StoredFactory.get_instance_property"><code class="name flex">

docs/api/jumpscale/core/base/store/whooshfts.html

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ <h1 class="title">Module <code>jumpscale.core.base.store.whooshfts</code></h1>
106106
return self.location.type._fields.items()
107107

108108
def get_schema(self):
109-
schema_fields = {
110-
KEY_FIELD_NAME: fields.ID(unique=True, stored=True),
111-
}
109+
schema_fields = {KEY_FIELD_NAME: fields.ID(unique=True, stored=True)}
112110

113111
for name, field in self.type_fields:
114112
field_type_name = field.__class__.__name__
@@ -288,9 +286,7 @@ <h2 id="args">Args</h2>
288286
return self.location.type._fields.items()
289287

290288
def get_schema(self):
291-
schema_fields = {
292-
KEY_FIELD_NAME: fields.ID(unique=True, stored=True),
293-
}
289+
schema_fields = {KEY_FIELD_NAME: fields.ID(unique=True, stored=True)}
294290

295291
for name, field in self.type_fields:
296292
field_type_name = field.__class__.__name__
@@ -498,9 +494,7 @@ <h3>Methods</h3>
498494
<span>Expand source code</span>
499495
</summary>
500496
<pre><code class="python">def get_schema(self):
501-
schema_fields = {
502-
KEY_FIELD_NAME: fields.ID(unique=True, stored=True),
503-
}
497+
schema_fields = {KEY_FIELD_NAME: fields.ID(unique=True, stored=True)}
504498

505499
for name, field in self.type_fields:
506500
field_type_name = field.__class__.__name__

docs/api/jumpscale/core/config/config.html

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,7 @@ <h2 id="getset">Get/Set</h2>
186186
&#34;debug&#34;: True,
187187
&#34;shell&#34;: &#34;ptpython&#34;,
188188
&#34;logging&#34;: {
189-
&#34;default&#34;: {
190-
&#34;enabled&#34;: True,
191-
&#34;level&#34;: 10,
192-
},
189+
&#34;default&#34;: {&#34;enabled&#34;: True, &#34;level&#34;: 10},
193190
&#34;redis&#34;: {
194191
&#34;enabled&#34;: True,
195192
&#34;level&#34;: 15,
@@ -214,9 +211,7 @@ <h2 id="getset">Get/Set</h2>
214211
},
215212
&#34;factory&#34;: {&#34;always_reload&#34;: False},
216213
&#34;store&#34;: &#34;filesystem&#34;,
217-
&#34;threebot&#34;: {
218-
&#34;default&#34;: &#34;&#34;,
219-
},
214+
&#34;threebot&#34;: {&#34;default&#34;: &#34;&#34;},
220215
}
221216

222217

@@ -444,10 +439,7 @@ <h2 id="returns">Returns</h2>
444439
&#34;debug&#34;: True,
445440
&#34;shell&#34;: &#34;ptpython&#34;,
446441
&#34;logging&#34;: {
447-
&#34;default&#34;: {
448-
&#34;enabled&#34;: True,
449-
&#34;level&#34;: 10,
450-
},
442+
&#34;default&#34;: {&#34;enabled&#34;: True, &#34;level&#34;: 10},
451443
&#34;redis&#34;: {
452444
&#34;enabled&#34;: True,
453445
&#34;level&#34;: 15,
@@ -472,9 +464,7 @@ <h2 id="returns">Returns</h2>
472464
},
473465
&#34;factory&#34;: {&#34;always_reload&#34;: False},
474466
&#34;store&#34;: &#34;filesystem&#34;,
475-
&#34;threebot&#34;: {
476-
&#34;default&#34;: &#34;&#34;,
477-
},
467+
&#34;threebot&#34;: {&#34;default&#34;: &#34;&#34;},
478468
}</code></pre>
479469
</details>
480470
</dd>

docs/api/jumpscale/core/logging/logging.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@ <h1 class="title">Module <code>jumpscale.core.logging.logging</code></h1>
3939
from jumpscale.loader import j
4040

4141

42-
LEVELS = {
43-
10: &#34;DEBUG&#34;,
44-
20: &#34;INFO&#34;,
45-
30: &#34;WARNING&#34;,
46-
40: &#34;ERROR&#34;,
47-
50: &#34;CRITICAL&#34;,
48-
}
42+
LEVELS = {10: &#34;DEBUG&#34;, 20: &#34;INFO&#34;, 30: &#34;WARNING&#34;, 40: &#34;ERROR&#34;, 50: &#34;CRITICAL&#34;}
4943

5044
# init is kept as a name for backward compatibility
5145
DEFAULT_APP_NAME = &#34;init&#34;

0 commit comments

Comments
 (0)