Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
prunner
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rx-etersoft
prunner
Commits
6fc84a5e
Commit
6fc84a5e
authored
Mar 25, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert to python3 with 2to3
parent
5eabf530
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
prunner
bin/prunner
+16
-16
No files found.
bin/prunner
View file @
6fc84a5e
#!/usr/bin/env python
#!/usr/bin/env python
3
# -*- coding: utf-8 -*-
import
sys
...
...
@@ -7,7 +7,7 @@ import threading
import
psutil
import
time
PRUNNER_VERSION
=
"0.0.
1
"
PRUNNER_VERSION
=
"0.0.
2
"
# Global variables
timeout_for_terminate
=
5
# sec
...
...
@@ -20,12 +20,12 @@ term_check_alive.clear()
def
log_error
(
text
):
print
"(prunner): ERROR:
%
s"
%
text
print
(
"(prunner): ERROR:
%
s"
%
text
)
def
log_info
(
text
):
if
verbose
:
print
"(prunner):
%
s"
%
text
print
(
"(prunner):
%
s"
%
text
)
def
get_arg_param
(
param
,
defval
=
""
):
...
...
@@ -374,23 +374,23 @@ def read_from_commandline(param):
def
usage
():
print
"[-p|--monitor-pid] pid - pid of main process (for monitoring)"
print
"[-d|--run-from-dir] dir - run programs from directory"
print
"[-f|--run-from-file] file - run programs from file"
print
"[-r|--run] '[params]prog args..' - run programs from command line"
print
"[-a|--run-after] 'prog args..' - run programs after main process terminated"
print
"[-v|--verbose] - Print info messages"
print
"[-V|--version] - Version info"
print
"[-c|--check-period] sec - period for check processes. Default:
%
s"
%
check_alive_period
print
"[-t|--terminate-timeout] sec - timeout for teminate processes"
print
" Then the processes will be killed. Default:
%
s"
%
timeout_for_terminate
print
"--disable-monitor - only run process"
print
(
"[-p|--monitor-pid] pid - pid of main process (for monitoring)"
)
print
(
"[-d|--run-from-dir] dir - run programs from directory"
)
print
(
"[-f|--run-from-file] file - run programs from file"
)
print
(
"[-r|--run] '[params]prog args..' - run programs from command line"
)
print
(
"[-a|--run-after] 'prog args..' - run programs after main process terminated"
)
print
(
"[-v|--verbose] - Print info messages"
)
print
(
"[-V|--version] - Version info"
)
print
(
"[-c|--check-period] sec - period for check processes. Default:
%
s"
%
check_alive_period
)
print
(
"[-t|--terminate-timeout] sec - timeout for teminate processes"
)
print
(
" Then the processes will be killed. Default:
%
s"
%
timeout_for_terminate
)
print
(
"--disable-monitor - only run process"
)
if
__name__
==
"__main__"
:
if
check_arg_param
([
'--version'
,
'-V'
]):
print
"Version:
%
s"
%
PRUNNER_VERSION
print
(
"Version:
%
s"
%
PRUNNER_VERSION
)
exit
(
0
)
if
check_arg_param
([
'-h'
,
'--help'
]):
...
...
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