Skip to content

Commit

Permalink
Merge pull request #654 from nipy/no-py.path
Browse files Browse the repository at this point in the history
Replace py.path with pathlib
  • Loading branch information
yarikoptic authored Mar 29, 2023
2 parents b2e5d03 + 495abc3 commit c83e06c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions heudiconv/cli/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import os.path as op
from pathlib import Path
import re
import subprocess
import time
Expand All @@ -11,7 +12,6 @@
from datetime import date
import inotify.adapters
from inotify.constants import IN_MODIFY, IN_CREATE, IN_ISDIR
from py.path import local as localpath
from tinydb import TinyDB

_DEFAULT_LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
Expand Down Expand Up @@ -67,9 +67,9 @@ def process(paths2process, db, wait=WAIT_TIME, logdir='log'):
process_dict.update(run_dict)
db.insert(process_dict)
# save log
logdir = localpath(logdir)
log = logdir.join(process_dict['accession_number'] + '.log')
log.write(stdout)
logdir = Path(logdir)
log = logdir / (process_dict['accession_number'] + '.log')
log.write_text(stdout)
# if we processed it, or it failed,
# we need to remove it to avoid running it again
processed.append(path)
Expand Down

0 comments on commit c83e06c

Please sign in to comment.