-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HGC Parser #68
HGC Parser #68
Conversation
"""Parse HGC subject string.""" | ||
data = {} | ||
try: | ||
search = re.search(r"^.+\((.+)\)", subject.replace("\n", "")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add an example of this parser? (easy to understand the regex)
try: | ||
search = re.search(r"^.+\((.+)\)", subject.replace("\n", "")) | ||
if search: | ||
data["maintenance_id"] = search.group(1) | ||
else: | ||
split = subject.split(" | ") | ||
data["maintenance_id"] = split[2] | ||
return [data] | ||
except Exception as exc: | ||
raise ParserError from exc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try: | |
search = re.search(r"^.+\((.+)\)", subject.replace("\n", "")) | |
if search: | |
data["maintenance_id"] = search.group(1) | |
else: | |
split = subject.split(" | ") | |
data["maintenance_id"] = split[2] | |
return [data] | |
except Exception as exc: | |
raise ParserError from exc | |
search = re.search(r"^.+\((.+)\)", subject.replace("\n", "")) | |
if search: | |
data["maintenance_id"] = search.group(1) | |
else: | |
split = subject.split(" | ") | |
data["maintenance_id"] = split[2] | |
return [data] |
the main parse
method is taking care of this (merge from develop!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
|
||
class HtmlParserHGC2(Html): | ||
"""HGC HTML parser.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""HGC HTML parser.""" | |
"""HGC HTML 2 parser.""" |
|
||
|
||
class HtmlParserHGC1(Html): | ||
"""HGC HTML parser.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""HGC HTML parser.""" | |
"""HGC HTML 1 parser.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
New HGC parser created