Skip to content

Commit

Permalink
Try another grep fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cscollett committed Aug 30, 2024
1 parent 2f5df77 commit e6fa590
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def analyze_logs(log_content):
python_version = None
issues_found = False

# Corrected patterns to capture actual output content
id_pattern = re.compile(r'^ID: (.+)')
version_id_pattern = re.compile(r'^VERSION_ID: "(.+)"')
version_codename_pattern = re.compile(r'^VERSION_CODENAME: (.+)')
full_version_pattern = re.compile(r'^FULL VERSION: (.+)')
python_version_pattern = re.compile(r'^LANGUAGE VERSION: (.+)')
# Improved patterns to capture actual output content
id_pattern = re.compile(r'ID: (.+)')
version_id_pattern = re.compile(r'VERSION_ID: "?(.+?)"?')
version_codename_pattern = re.compile(r'VERSION_CODENAME: (.+)')
full_version_pattern = re.compile(r'FULL VERSION: (.+)')
python_version_pattern = re.compile(r'LANGUAGE VERSION: (.+)')

# Patterns to capture possible errors
error_patterns = [
Expand All @@ -60,6 +60,8 @@ def analyze_logs(log_content):
log_lines = log_content.splitlines()

for line in log_lines:
line = line.strip() # Remove leading/trailing spaces

if os_id is None and id_pattern.search(line):
os_id = id_pattern.search(line).group(1)

Expand Down

0 comments on commit e6fa590

Please sign in to comment.