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
Commits
b7f1a824
Commit
b7f1a824
authored
11 months ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
Code cleanup
parent
c5bf0f87
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
prog/communication.py
+6
-6
6 additions, 6 deletions
prog/communication.py
prog/gtfs.py
+1
-1
1 addition, 1 deletion
prog/gtfs.py
with
7 additions
and
7 deletions
prog/communication.py
+
6
−
6
View file @
b7f1a824
...
...
@@ -31,7 +31,7 @@ async def connect_stdin_stdout():
writer
=
asyncio
.
StreamWriter
(
w_transport
,
w_protocol
,
reader
,
loop
)
return
reader
,
writer
class
Socket
()
:
class
Socket
:
async
def
write
():
raise
NotImplementedError
async
def
read
():
...
...
@@ -82,7 +82,7 @@ class UnixSocket(AsincioStreamSocket):
class
MsgParser
()
:
class
MsgParser
:
def
__init__
(
self
,
socket
):
self
.
socket
=
socket
self
.
buffer
=
[]
...
...
@@ -116,11 +116,11 @@ def msg(head, data):
assert
head
return
int_to_str_len
(
len
(
head
),
5
).
encode
(
'
utf-8
'
)
+
int_to_str_len
(
len
(
data
),
12
).
encode
(
'
utf-8
'
)
+
head
+
data
class
WaitingQuestion
()
:
class
WaitingQuestion
:
def
__init__
(
self
,
id
):
self
.
future
=
asyncio
.
get_running_loop
().
create_future
()
class
Client
()
:
class
Client
:
def
__init__
(
self
,
socket
):
self
.
socket
=
socket
self
.
msg_parser
=
MsgParser
(
socket
)
...
...
@@ -151,7 +151,7 @@ class Client():
# eprint(asyncio.all_tasks())
return
await
q
.
future
class
Server
()
:
class
Server
:
def
__init__
(
self
,
socket
,
callback
):
self
.
socket
=
socket
self
.
msg_parser
=
MsgParser
(
socket
)
...
...
@@ -172,7 +172,7 @@ class Server():
def
cbor_dump
(
x
):
return
cbor2
.
dumps
(
x
,
timezone
=
local_timezone
)
class
FuncCaller
()
:
class
FuncCaller
:
def
__init__
(
self
,
socket
=
None
,
is_server
=
False
):
if
socket
==
None
:
is_server
=
True
...
...
This diff is collapsed.
Click to expand it.
prog/gtfs.py
+
1
−
1
View file @
b7f1a824
...
...
@@ -47,7 +47,7 @@ class TripStop:
shape_dist_traveled
:
float
class
GtfsDay
()
:
class
GtfsDay
:
def
__init__
(
self
,
date
,
data_getter
):
self
.
date
=
date
self
.
data_getter
=
data_getter
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment