Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
coco
Commits
b0f0453d
Commit
b0f0453d
authored
Mar 05, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改model
parent
e6e1a489
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
models.py
coco/models.py
+5
-2
No files found.
coco/models.py
View file @
b0f0453d
...
@@ -101,7 +101,7 @@ class Server:
...
@@ -101,7 +101,7 @@ class Server:
else
:
else
:
return
None
return
None
def
send
(
self
,
b
):
def
parse
(
self
,
b
):
if
isinstance
(
b
,
str
):
if
isinstance
(
b
,
str
):
b
=
b
.
encode
(
"utf-8"
)
b
=
b
.
encode
(
"utf-8"
)
if
not
self
.
_input_initial
:
if
not
self
.
_input_initial
:
...
@@ -122,6 +122,9 @@ class Server:
...
@@ -122,6 +122,9 @@ class Server:
del
self
.
input_data
[:]
del
self
.
input_data
[:]
del
self
.
output_data
[:]
del
self
.
output_data
[:]
self
.
_in_input_state
=
True
self
.
_in_input_state
=
True
def
send
(
self
,
b
):
self
.
parse
(
b
)
return
self
.
chan
.
send
(
b
)
return
self
.
chan
.
send
(
b
)
def
recv
(
self
,
size
):
def
recv
(
self
,
size
):
...
@@ -136,7 +139,7 @@ class Server:
...
@@ -136,7 +139,7 @@ class Server:
def
close
(
self
):
def
close
(
self
):
logger
.
info
(
"Closed server {}"
.
format
(
self
))
logger
.
info
(
"Closed server {}"
.
format
(
self
))
self
.
send
(
b
''
)
self
.
parse
(
b
''
)
self
.
chan
.
close
()
self
.
chan
.
close
()
self
.
stop_evt
.
set
()
self
.
stop_evt
.
set
()
self
.
chan
.
close
()
self
.
chan
.
close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment