python23
Shawn J. Goff
shawn7400 at gmail.com
Mon Dec 17 10:45:11 PST 2012
On 12/17/2012 12:39 PM, Dan Williams wrote:
> On Mon, 2012-12-17 at 11:46 -0500, Shawn J. Goff wrote:
>> qmi-codegen produces lots of python2/3 problems like this:
>>
>> Traceback (most recent call last):
>> message = Message(object_dictionary, common_objects_dictionary)
>> File "../../build-aux/qmi-codegen/qmi-codegen", line 97, in <module>
>> message_list = MessageList(object_list_json, common_object_list_json)
>> File
>> "/home/shawn/projects/all-projects/fx/buildroot-fresh/output/build/libqmi-1.0.0/build-aux/qmi-codegen/Message.py",
>> line 56, in __init__
>> File
>> "/home/shawn/projects/all-projects/fx/buildroot-fresh/output/build/libqmi-1.0.0/build-aux/qmi-codegen/MessageList.py",
>> line 46, in __init__
>> message = Message(object_dictionary, common_objects_dictionary)
>> File
>> "/home/shawn/projects/all-projects/fx/buildroot-fresh/output/build/libqmi-1.0.0/build-aux/qmi-codegen/Message.py",
>> line 56, in __init__
>> self.id_enum_name =
>> string.upper(utils.build_underscore_name(self.fullname))
>> AttributeError: 'module' object has no attribute 'upper'
> Can you give the 'python3' branch a shot and we'll work on fixing stuff
> up there? That should fix all the relevant upper/lower calls to start
> with.
>
> Dan
>
Sure. I can fix all the things and submit a patch; I was just not sure
if it would be easier to pull from a new codegen somewhere. I started
working on this a while ago, then moved to a different project, now I'm
back on it.
There are various string methods similar to upper/lower that need to be
changed. There is also a has_key method that needs to be changed to "key
in dict". I have a gist for a regex to fix that here:
https://gist.github.com/3543601 . I'll go ahead and fix everything and
submit a patch series to the list.
More information about the libqmi-devel
mailing list