Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
repo
Overview
Overview
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
YongjieWang
repo
Commits
c710fe05
Commit
c710fe05
authored
Jan 13, 2016
by
Matthias Putz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Portable: fixed -p option for forall
parent
a4168527
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
portable.py
portable.py
+14
-0
forall.py
subcmds/forall.py
+4
-2
No files found.
portable.py
View file @
c710fe05
...
@@ -64,6 +64,12 @@ class file_reader(object):
...
@@ -64,6 +64,12 @@ class file_reader(object):
def
read
(
self
,
bufsize
):
def
read
(
self
,
bufsize
):
return
self
.
fd
.
read
(
bufsize
)
return
self
.
fd
.
read
(
bufsize
)
def
close
(
self
):
return
self
.
fd
.
close
()
def
src
(
self
):
return
self
.
fd
class
socket_reader
():
class
socket_reader
():
"""select socket with file descriptor class"""
"""select socket with file descriptor class"""
def
__init__
(
self
,
src
,
dest
,
std_name
=
''
):
def
__init__
(
self
,
src
,
dest
,
std_name
=
''
):
...
@@ -98,12 +104,20 @@ class socket_reader():
...
@@ -98,12 +104,20 @@ class socket_reader():
return
self
.
server_socket
.
recv
(
bufsize
)
return
self
.
server_socket
.
recv
(
bufsize
)
except
Exception
as
e
:
except
Exception
as
e
:
Trace
(
"failed to read from server socket: "
+
e
.
strerror
)
Trace
(
"failed to read from server socket: "
+
e
.
strerror
)
self
.
close
()
def
close
(
self
):
if
self
.
client_socket
:
self
.
client_socket
.
close
()
self
.
client_socket
.
close
()
if
self
.
server_socket
:
self
.
server_socket
.
close
()
self
.
server_socket
.
close
()
def
fileno
(
self
):
def
fileno
(
self
):
return
self
.
server_socket
.
fileno
()
return
self
.
server_socket
.
fileno
()
def
src
(
self
):
return
self
.
src
def
os_symlink
(
src
,
dst
):
def
os_symlink
(
src
,
dst
):
if
isUnix
():
if
isUnix
():
...
...
subcmds/forall.py
View file @
c710fe05
...
@@ -364,12 +364,14 @@ def DoWork(project, mirror, opt, cmd, shell, cnt, config):
...
@@ -364,12 +364,14 @@ def DoWork(project, mirror, opt, cmd, shell, cnt, config):
# buf = s.fd.read(4096)
# buf = s.fd.read(4096)
buf
=
s
.
read
(
4096
)
buf
=
s
.
read
(
4096
)
if
not
buf
:
if
not
buf
:
s
.
fd
.
close
()
# s.fd.close()
s
.
close
()
s_in
.
remove
(
s
)
s_in
.
remove
(
s
)
continue
continue
if
not
opt
.
verbose
:
if
not
opt
.
verbose
:
if
s
.
fd
!=
p
.
stdout
:
# if s.fd != p.stdout:
if
s
.
src
!=
p
.
stdout
:
errbuf
+=
buf
errbuf
+=
buf
continue
continue
...
...
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