This repository has been archived by the owner on Apr 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added new
workflow
directory from https://github.com/NorthIsUp/alf…
…red-workflow-py3` for python3 support. Auto-updating is not working now.
- Loading branch information
1 parent
bb5aff6
commit 2cbbc15
Showing
26 changed files
with
193 additions
and
895 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.10.5 | ||
0.10.6 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
# | ||
# Copyright (c) 2014 [email protected] | ||
|
@@ -17,7 +16,6 @@ | |
and examples. | ||
""" | ||
|
||
from __future__ import print_function, unicode_literals | ||
|
||
import signal | ||
import sys | ||
|
@@ -97,7 +95,10 @@ def _job_pid(name): | |
return | ||
|
||
with open(pidfile, 'rb') as fp: | ||
pid = int(fp.read()) | ||
read = fp.read() | ||
print(str(read)) | ||
pid = int.from_bytes(read, sys.byteorder) | ||
print(pid) | ||
|
||
if _process_exists(pid): | ||
return pid | ||
|
@@ -141,7 +142,7 @@ def _fork_and_exit_parent(errmsg, wait=False, write=False): | |
if write: # write PID of child process to `pidfile` | ||
tmp = pidfile + '.tmp' | ||
with open(tmp, 'wb') as fp: | ||
fp.write(str(pid)) | ||
fp.write(pid.to_bytes(4, sys.byteorder)) | ||
os.rename(tmp, pidfile) | ||
if wait: # wait for child process to exit | ||
os.waitpid(pid, 0) | ||
|
@@ -162,9 +163,9 @@ def _fork_and_exit_parent(errmsg, wait=False, write=False): | |
|
||
# Now I am a daemon! | ||
# Redirect standard file descriptors. | ||
si = open(stdin, 'r', 0) | ||
so = open(stdout, 'a+', 0) | ||
se = open(stderr, 'a+', 0) | ||
si = open(stdin, 'r', 1) | ||
so = open(stdout, 'a+', 1) | ||
se = open(stderr, 'a+', 1) | ||
if hasattr(sys.stdin, 'fileno'): | ||
os.dup2(si.fileno(), sys.stdin.fileno()) | ||
if hasattr(sys.stdout, 'fileno'): | ||
|
@@ -230,9 +231,9 @@ def run_in_background(name, args, **kwargs): | |
_log().debug('[%s] command cached: %s', name, argcache) | ||
|
||
# Call this script | ||
cmd = ['/usr/bin/python', __file__, name] | ||
cmd = [sys.executable, '-m', 'workflow.background', name] | ||
_log().debug('[%s] passing job to background runner: %r', name, cmd) | ||
retcode = subprocess.call(cmd) | ||
retcode = subprocess.call(cmd, env={'PYTHONPATH': ':'.join(sys.path)}) | ||
|
||
if retcode: # pragma: no cover | ||
_log().error('[%s] background runner failed with %d', name, retcode) | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.