Was id_map.py generated with AI?
Closed this issue · 2 comments
It kinda looks like something out of GitHub copilot, and also i found this in the code, which doesn't work in python:
def add_face(self, face_line):
brush_plane_re = re.compile('\(\s([\s|\d|\-|.]+)\s\)\s' # point 1
'\(\s([\s|\d|\-|.]+)\s\)\s' # point 2
'\(\s([\s|\d|\-|.]+)\s\)\s' # point 3
'([\w|/|\d]+)\s' # texture name
'([\d|\s|.|\-]+)') # texture params
match = brush_plane_re.match(face_line)
...
Please correct me if this indeed valid python 3 code :D
Hey
This code was written back in 2015 (check the commit logs) before any of today's AI existed. Yes, this is valid (python 2?) code and I assume in modern python the multi-string combination doesn't work / had been removed from the standard (this is a holdover from C). The regular expression is straightforward, it parses each point, texture, and params based on the different possibilities for them. It is just a condensed expression. You can probably make it work by combining all the strings into one if that is what is actually wrong here but I don't know since you haven't posted your error.
My bad! I'm sorry for not researching this more thourougly! I tried matching the regexps but some of them didnt give results, but i'm sure it's gonna help if i install the right python version and try again :D Thanks for getting back and giving your code to open source <3