Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
jr
Compare revisions
b7f1a824a69e8e871507da4b8d88059a462b81d3 to 2add8ee17d89a2abb7a63a9755bb690cbc48083c
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
jirikalvoda/jr
Select target project
No results found
2add8ee17d89a2abb7a63a9755bb690cbc48083c
Select Git revision
Branches
master
1 result
Swap
Target
jirikalvoda/jr
Select target project
jirikalvoda/jr
1 result
b7f1a824a69e8e871507da4b8d88059a462b81d3
Select Git revision
Branches
master
1 result
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source
2
type(A) == X -> isinstance(A, X)
· 7aa506d5
Jiří Kalvoda
authored
Jul 19, 2024
7aa506d5
Fix typo
· 2add8ee1
Jiří Kalvoda
authored
Jul 19, 2024
2add8ee1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
prog/communication.py
+4
-4
4 additions, 4 deletions
prog/communication.py
prog/data_utils.py
+3
-3
3 additions, 3 deletions
prog/data_utils.py
prog/download_server.py
+1
-1
1 addition, 1 deletion
prog/download_server.py
prog/preprocess.py
+1
-1
1 addition, 1 deletion
prog/preprocess.py
with
9 additions
and
9 deletions
prog/communication.py
View file @
2add8ee1
...
...
@@ -55,7 +55,7 @@ class SSHRunSocket(Socket):
# eprint("READ END", r)
return
r
class
As
i
ncioStreamSocket
(
Socket
):
class
As
y
ncioStreamSocket
(
Socket
):
async
def
connect
(
self
,
reader
,
writer
):
self
.
reader
=
reader
self
.
writer
=
writer
...
...
@@ -70,12 +70,12 @@ class AsincioStreamSocket(Socket):
# eprint("STDIN READ END", r)
return
r
class
StdInOutSocket
(
As
i
ncioStreamSocket
):
class
StdInOutSocket
(
As
y
ncioStreamSocket
):
async
def
connect
(
self
):
self
.
reader
,
self
.
writer
=
await
connect_stdin_stdout
()
return
self
class
UnixSocket
(
As
i
ncioStreamSocket
):
class
UnixSocket
(
As
y
ncioStreamSocket
):
async
def
connect
(
self
,
path
):
self
.
reader
,
self
.
writer
=
await
asyncio
.
open_unix_connection
(
path
)
return
self
...
...
@@ -190,7 +190,7 @@ class FuncCaller:
async
def
_server_caller_
(
self
,
in_head
,
in_data_raw
,
connection_controll
):
func_name
=
in_head
[
"
func_name
"
]
assert
type
(
func_name
)
==
str
and
func_name
[
0
]
!=
'
_
'
assert
type
(
func_name
)
is
str
and
func_name
[
0
]
!=
'
_
'
f
=
getattr
(
self
,
func_name
)
in_data
=
cbor2
.
loads
(
in_data_raw
)
r
=
await
f
(
*
in_data
[
'
args
'
],
**
in_data
[
'
kwargs
'
])
...
...
This diff is collapsed.
Click to expand it.
prog/data_utils.py
View file @
2add8ee1
...
...
@@ -12,13 +12,13 @@ _shape_matching_time = 0
async
def
unzip_parse
(
data
):
if
typ
e
(
data
)
==
dict
:
if
isinstanc
e
(
data
,
dict
)
:
assert
len
(
data
)
==
1
data
=
list
(
data
.
values
())[
0
]
if
typ
e
(
data
)
==
bytes
and
data
.
startswith
(
b
'
\x1f\x8b
'
):
if
isinstanc
e
(
data
,
bytes
)
and
data
.
startswith
(
b
'
\x1f\x8b
'
):
proc
=
await
asyncio
.
create_subprocess_exec
(
"
gunzip
"
,
stdout
=
asyncio
.
subprocess
.
PIPE
,
stdin
=
asyncio
.
subprocess
.
PIPE
)
data
,
stderr
=
await
proc
.
communicate
(
data
)
if
typ
e
(
data
)
==
bytes
and
data
.
startswith
(
b
'
(
\xb5
/
\xfd
'
):
if
isinstanc
e
(
data
,
bytes
)
and
data
.
startswith
(
b
'
(
\xb5
/
\xfd
'
):
proc
=
await
asyncio
.
create_subprocess_exec
(
"
unzstd
"
,
stdout
=
asyncio
.
subprocess
.
PIPE
,
stdin
=
asyncio
.
subprocess
.
PIPE
)
data
,
stderr
=
await
proc
.
communicate
(
data
)
return
json
.
loads
(
data
)
...
...
This diff is collapsed.
Click to expand it.
prog/download_server.py
View file @
2add8ee1
...
...
@@ -112,7 +112,7 @@ class DownloadServer(communication.FuncCaller):
async
def
client_connected
(
reader
,
writer
):
await
catch_all
(
DownloadServer
(
await
communication
.
As
i
ncioStreamSocket
().
connect
(
reader
,
writer
),
is_server
=
True
).
_server_
.
run
())
await
catch_all
(
DownloadServer
(
await
communication
.
As
y
ncioStreamSocket
().
connect
(
reader
,
writer
),
is_server
=
True
).
_server_
.
run
())
async
def
main
():
global
caio_ctx
...
...
This diff is collapsed.
Click to expand it.
prog/preprocess.py
View file @
2add8ee1
...
...
@@ -167,7 +167,7 @@ async def main():
loaded_timestamps
=
[]
async
def
client_connected
(
reader
,
writer
):
s
=
PreprocessServer
(
await
communication
.
As
i
ncioStreamSocket
().
connect
(
reader
,
writer
),
is_server
=
True
)
s
=
PreprocessServer
(
await
communication
.
As
y
ncioStreamSocket
().
connect
(
reader
,
writer
),
is_server
=
True
)
s
.
ths
=
ths
s
.
loaded_timestamps
=
loaded_timestamps
await
catch_all
(
s
.
_server_
.
run
())
...
...
This diff is collapsed.
Click to expand it.