Re: Errors in h2def.py and override.php
| From: | Alan Knowles | Date: | Mon, 26 Jan 2004 09:23:43 +0000 |
| Subject: | Re: Errors in h2def.py and override.php | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-616@lists.php.net to get a copy of this message | ||
try the php version of it in the gtk2 branch.
Regards
Alan
Mike Dransfield wrote:
I have been trying to make some bindings for MozEmbed recently and have found some problems with h2def.py and generator/overrides.php. Firstly, h2def.py on line 231 has args=arg_split_pat.split(args,', ') but the python manual says that this is incorrect for a compiled re object, the second parameter should be a limit integer. The expression is already compiled at line 215 with arg_split_pat = re.compile("\s*,\s*") Therefore line 231 should only be args=arg_split_pat.split(args) Which works for me, the original error that was produced was Traceback (most recent call last): File "../generator/h2def.py", line 345, in ?-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comwrite_def(filename,None)File "../generator/h2def.py", line 301, in write_defbuf = define_func(buf, fp)File "../generator/h2def.py", line 231, in define_funcargs=arg_split_pat.split(args, ', ')TypeError: an integer is required Next, overrides.php has an error on line 117. Currently, it has problems if the $glob variable has any preg special characters, the line should be if (preg_match('!' . str_replace(array('*', '(', ')', '!'), array('.*', '\(', '\)', '\!'), $glob) . '!', $name)) instead of if (preg_match('!' . str_replace('*', '.*'), $glob) . '!', $name)) The current code produces errors with the output from the corrected code above. I am using the gtkmozembed.h file from the 1.3.1 mozilla distribution, I can send the file if you like. Regards Mike