Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 8, 2024
1 parent de856c4 commit 464ca21
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions lib/condorLogParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

class cachedLogClass:


def clInit(self, logname, cache_dir, cache_ext):
"""Initializes the log and cache file paths.
Expand All @@ -41,7 +40,7 @@ def has_changed(self):
Returns:
bool: True if the log file has changed or if there is no cache, False otherwise.
"""
"""
if os.path.isfile(self.logname):
fstat = os.lstat(self.logname)
logtime = fstat[stat.ST_MTIME]
Expand Down Expand Up @@ -108,7 +107,6 @@ def saveCache(self):

class logSummary(cachedLogClass):


def __init__(self, logname, cache_dir):
"""Initializes the logSummary class with log and cache paths.
Expand Down Expand Up @@ -210,7 +208,6 @@ def diff(self, other):

class logCompleted(cachedLogClass):


def __init__(self, logname, cache_dir):
"""Initializes the logCompleted clas with log and cache paths.
Expand Down Expand Up @@ -331,7 +328,6 @@ def diff(self, other):

class logCounts(cachedLogClass):


def __init__(self, logname, cache_dir):
"""Initializes the logCounts class with log and cache paths.
Expand Down Expand Up @@ -427,7 +423,6 @@ def diff(self, other):

class logSummaryTimings(cachedLogClass):


def __init__(self, logname, cache_dir):
"""Initializes the logSummaryTimings class with log and cache paths.
Expand Down Expand Up @@ -563,7 +558,7 @@ def __init__(
wrapperClass=None,
username=None,
):

self.cdInit(
logClass,
dirname,
Expand All @@ -590,7 +585,6 @@ def cdInit(
wrapperClass=None,
username=None,
):


self.wrapperClass = wrapperClass
self.username = username
Expand All @@ -614,7 +608,6 @@ def cdInit(
return

def getFileList(self, active_only):


prefix_len = len(self.log_prefix)
suffix_len = len(self.log_suffix)
Expand Down Expand Up @@ -682,7 +675,6 @@ def load(self, active_only=True):

def diff(self, other):


if (self.wrapperClass is not None) and (self.username is not None):
dummyobj = self.wrapperClass.getObj(os.path.join(self.dirname, "dummy.txt"), self.cache_dir, self.username)
else:
Expand All @@ -694,7 +686,6 @@ def diff(self, other):

class dirSummary(cacheDirClass):


def __init__(
self,
dirname,
Expand All @@ -705,13 +696,12 @@ def __init__(
inactive_timeout=24 * 3600,
cache_dir=None,
):


self.cdInit(logSummary, dirname, log_prefix, log_suffix, cache_ext, inactive_files, inactive_timeout, cache_dir)


class dirCompleted(cacheDirClass):

def __init__(
self,
dirname,
Expand All @@ -722,15 +712,13 @@ def __init__(
inactive_timeout=24 * 3600,
cache_dir=None,
):


self.cdInit(
logCompleted, dirname, log_prefix, log_suffix, cache_ext, inactive_files, inactive_timeout, cache_dir
)


class dirCounts(cacheDirClass):


def __init__(
self,
Expand All @@ -742,13 +730,12 @@ def __init__(
inactive_timeout=24 * 3600,
cache_dir=None,
):

self.cdInit(logCounts, dirname, log_prefix, log_suffix, cache_ext, inactive_files, inactive_timeout, cache_dir)


class dirSummaryTimings(cacheDirClass):


def __init__(
self,
dirname,
Expand All @@ -759,7 +746,6 @@ def __init__(
inactive_timeout=24 * 3600,
cache_dir=None,
):


self.cdInit(
logSummaryTimings, dirname, log_prefix, log_suffix, cache_ext, inactive_files, inactive_timeout, cache_dir
Expand Down Expand Up @@ -1050,7 +1036,7 @@ def rawTime2cTime(instr, year):


def rawTime2cTimeLastYear(instr):

now = time.time()
current_year = time.localtime(now)[0]
ctime = rawTime2cTime(instr, current_year)
Expand Down Expand Up @@ -1123,7 +1109,6 @@ def countStatuses(jobs):

def countAndInterpretRawStatuses(jobs_raw):


outc = {}
tmpc = countStatuses(jobs_raw)
for s in list(tmpc.keys()):
Expand All @@ -1138,7 +1123,6 @@ def countAndInterpretRawStatuses(jobs_raw):

def listStatuses(jobs):


status = {}
for k, e in list(jobs.items()):
try:
Expand All @@ -1151,7 +1135,6 @@ def listStatuses(jobs):

def listStatusesTimings(jobs):


status = {}
for k, e in list(jobs.items()):
try:
Expand Down Expand Up @@ -1182,7 +1165,6 @@ def listAndInterpretRawStatuses(jobs_raw, invert_function):

def parseSubmitLogFast(fname):


jobs_raw = parseSubmitLogFastRaw(fname)
jobs = {}
for k in list(jobs_raw.keys()):
Expand All @@ -1192,7 +1174,6 @@ def parseSubmitLogFast(fname):

def parseSubmitLogFastTimings(fname, year=None):


jobs_raw, first_time, last_time = parseSubmitLogFastRawTimings(fname)

if year is None:
Expand Down

0 comments on commit 464ca21

Please sign in to comment.