Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
70727b20
Commit
70727b20
authored
Apr 03, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass os.getpid() to psutil.Process for psutil<1.2 (#284)
parent
d95a66f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
__init__.py
printrun/power/__init__.py
+5
-5
No files found.
printrun/power/__init__.py
View file @
70727b20
...
...
@@ -15,6 +15,7 @@
import
platform
import
traceback
import
os
if
platform
.
system
()
==
"Darwin"
:
from
.osx
import
inhibit_sleep_osx
,
deinhibit_sleep_osx
...
...
@@ -60,19 +61,18 @@ else:
try
:
import
psutil
def
set_nice
(
p
,
nice
):
def
set_nice
(
nice
):
p
=
psutil
.
Process
(
os
.
getpid
())
if
callable
(
p
.
nice
):
p
.
nice
(
nice
)
else
:
p
.
nice
=
nice
def
set_priority
():
p
=
psutil
.
Process
()
set_nice
(
p
,
10
if
platform
.
system
()
!=
"Windows"
else
psutil
.
HIGH_PRIORITY_CLASS
)
set_nice
(
10
if
platform
.
system
()
!=
"Windows"
else
psutil
.
HIGH_PRIORITY_CLASS
)
def
reset_priority
():
p
=
psutil
.
Process
()
set_nice
(
p
,
0
if
platform
.
system
()
!=
"Windows"
else
psutil
.
NORMAL_PRIORITY_CLASS
)
set_nice
(
0
if
platform
.
system
()
!=
"Windows"
else
psutil
.
NORMAL_PRIORITY_CLASS
)
def
powerset_print_start
(
reason
):
set_priority
()
...
...
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