Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-Erm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-Erm
Commits
b464aa23
Commit
b464aa23
authored
Apr 12, 2021
by
Suzhi Bi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update send.py
parent
7c821268
Pipeline
#72
canceled with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
11 deletions
+0
-11
client_code/send.py
client_code/send.py
+0
-11
No files found.
client_code/send.py
View file @
b464aa23
...
...
@@ -2,7 +2,6 @@ import socket
import
os
import
sys
import
struct
#import json
ip
=
'192.168.191.4'
...
...
@@ -13,9 +12,7 @@ except socket.error as msg:
print
(
msg
)
sys
.
exit
(
1
)
#auxiliary_list = []
time_max
=
input
(
"please enter the maximum time (seconds) allowed for picture(s): "
)
#auxiliary_list.append(time_max)
if
time_max
.
isdigit
():
s
.
send
(
time_max
.
encode
(
'utf-8'
))
s
.
close
()
...
...
@@ -32,11 +29,6 @@ if time_max.isdigit():
filepath
=
input
(
"please input file or folder path: "
)
if
os
.
path
.
isdir
(
filepath
):
img_path_vec
=
[
os
.
path
.
join
(
filepath
,
imgpath
)
for
imgpath
in
os
.
listdir
(
filepath
)
if
os
.
path
.
splitext
(
imgpath
)[
1
]
in
img_type
]
# img_num = len(img_path_vec)
# auxiliary_list.append(img_num)
# auxiliary_var = json.dumps(auxiliary_list)
# s.send(auxiliary_var.encode('utf-8'))
# s.close()
for
img_name
in
img_path_vec
:
fileinfo_size
=
struct
.
calcsize
(
'128sq'
)
fhead
=
struct
.
pack
(
'128sq'
,
bytes
(
os
.
path
.
basename
(
img_name
).
encode
(
'utf-8'
)),
os
.
stat
(
img_name
).
st_size
)
...
...
@@ -63,9 +55,6 @@ if time_max.isdigit():
else
:
if
os
.
path
.
isfile
(
filepath
):
if
os
.
path
.
splitext
(
filepath
)[
1
]
in
img_type
:
# auxiliary_list.append(1)
# auxiliary_var = json.dumps(auxiliary_list)
# s.send(auxiliary_var.encode('utf-8'))
fileinfo_size
=
struct
.
calcsize
(
'128sq'
)
fhead
=
struct
.
pack
(
'128sq'
,
bytes
(
os
.
path
.
basename
(
filepath
).
encode
(
'utf-8'
)),
os
.
stat
(
filepath
).
st_size
)
s
.
send
(
fhead
)
...
...
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