Skip to content

Commit

Permalink
Optimize also the context keymap camalbase to string for the PO script
Browse files Browse the repository at this point in the history
  • Loading branch information
Littlesat committed Dec 30, 2024
1 parent 557b5b2 commit b021930
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion po/xml2po-python3.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def startElement(self, name, attrs):
k = attrs[x]
if k.strip() != "" and not self.ishex.match(k):
if x == "context":
attrlist.add((re.sub(r"(\w)([A-Z])([a-z])", r"\1 \2\3", k), self.last_comment))
attrlist.add((re.sub(r"(?:(?=(?<=[^A-Z])[A-Z])|(?=Actions|Select))(?!(?<=Pi)P)", " ", k), self.last_comment))
else:
attrlist.add((k, self.last_comment))
self.last_comment = None
Expand Down
2 changes: 1 addition & 1 deletion po/xml2po.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def startElement(self, name, attrs):
k = ktmp.decode()
if k.strip() != "" and not self.ishex.match(k):
if x == "context":
attrlist.add((re.sub(r"(\w)([A-Z])([a-z])", r"\1 \2\3", k), self.last_comment))
attrlist.add((re.sub(r"(?:(?=(?<=[^A-Z])[A-Z])|(?=Actions|Select))(?!(?<=Pi)P)", " ", k), self.last_comment))
else:
attrlist.add((k, self.last_comment))
self.last_comment = None
Expand Down

0 comments on commit b021930

Please sign in to comment.