Skip to content

Commit

Permalink
Merge pull request #207 from akrherz/240105
Browse files Browse the repository at this point in the history
Fix reprocess PIPE
  • Loading branch information
akrherz authored Jan 15, 2024
2 parents 5abc6a9 + a55c8b3 commit cbcc65c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.11"
rev: "v0.1.13"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
26 changes: 20 additions & 6 deletions scripts/RT/reprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,42 @@ def main():
d9 = datetime.datetime.now() - datetime.timedelta(days=9)
d10 = datetime.datetime.now() - datetime.timedelta(days=10)
# Run env2database from 10 days ago
subprocess.call(
with subprocess.Popen(
[
"python",
"env2database.py",
"--date",
d10.strftime("%Y-%m-%d"),
"-s",
"0",
]
)
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
) as proc:
(stdout, stderr) = proc.communicate()
if stdout != b"":
print(stdout.decode("ascii"))
if stderr != b"":
print(stderr.decode("ascii"))
os.chdir("../cligen")
# Edit CLI files from 9 days ago
subprocess.call(
with subprocess.Popen(
[
"python",
"proctor_tile_edit.py",
"0",
f"{d9:%Y}",
f"{d9:%m}",
f"{d9:%d}",
]
)
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
) as proc:
(stdout, stderr) = proc.communicate()
if stdout != b"":
print(stdout.decode("ascii"))
if stderr != b"":
print(stderr.decode("ascii"))


if __name__ == "__main__":
Expand Down

0 comments on commit cbcc65c

Please sign in to comment.