Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
49d33f61
Commit
49d33f61
authored
Sep 15, 2011
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perf tests: linux version of adb search
parent
db4b72c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
run.py
modules/ts/misc/run.py
+13
-2
No files found.
modules/ts/misc/run.py
View file @
49d33f61
...
...
@@ -48,7 +48,7 @@ def query_yes_no(stdout, question, default="yes"):
stdout
.
write
(
"Please respond with 'yes' or 'no' "
\
"(or 'y' or 'n').
\n
"
)
def
getRunningProcessExePathByName_win32
(
name
)
:
def
getRunningProcessExePathByName_win32
(
name
):
from
ctypes
import
windll
,
POINTER
,
pointer
,
Structure
,
sizeof
from
ctypes
import
c_long
,
c_int
,
c_uint
,
c_char
,
c_ubyte
,
c_char_p
,
c_void_p
...
...
@@ -126,15 +126,26 @@ def getRunningProcessExePathByName_win32(name) :
CloseHandle
(
hProcessSnap
)
return
path
def
getRunningProcessExePathByName_posix
(
name
):
pids
=
[
pid
for
pid
in
os
.
listdir
(
'/proc'
)
if
pid
.
isdigit
()]
for
pid
in
pids
:
try
:
path
=
os
.
readlink
(
os
.
path
.
join
(
'/proc'
,
pid
,
'exe'
))
if
path
and
path
.
endswith
(
name
):
return
path
except
:
pass
def
getRunningProcessExePathByName
(
name
):
try
:
if
hostos
==
"nt"
:
return
getRunningProcessExePathByName_win32
(
name
)
elif
hostos
==
"posix"
:
return
getRunningProcessExePathByName_posix
(
name
)
else
:
return
None
except
:
return
None
class
RunInfo
(
object
):
def
__init__
(
self
,
path
,
configuration
=
None
):
...
...
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