[Spice-devel] [spice-common PATCH] python_modules/ptypes.py/EnumBaseType.c_enumname: add missing return to fix broken enums generation

2012-06-14 Thread Alon Levy
---
 python_modules/ptypes.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index 132ba99..d9fbfe2 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -234,7 +234,7 @@ class EnumBaseType(Type):
 return codegen.prefix_camel(self.name)
 
 def c_enumname(self, value):
-self.c_enumname_by_name(self.names[value])
+return self.c_enumname_by_name(self.names[value])
 
 def c_enumname_by_name(self, name):
 if self.has_attr(prefix):
-- 
1.7.10.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [spice-common PATCH] python_modules/ptypes.py/EnumBaseType.c_enumname: add missing return to fix broken enums generation

2012-06-14 Thread Marc-André Lureau
I don't see exactly what it will fixed, perhaps you should include a small 
example. But that looks like a typo and can't harm, ACK

- Mensaje original -
 ---
  python_modules/ptypes.py |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
 index 132ba99..d9fbfe2 100644
 --- a/python_modules/ptypes.py
 +++ b/python_modules/ptypes.py
 @@ -234,7 +234,7 @@ class EnumBaseType(Type):
  return codegen.prefix_camel(self.name)
  
  def c_enumname(self, value):
 -self.c_enumname_by_name(self.names[value])
 +return self.c_enumname_by_name(self.names[value])
  
  def c_enumname_by_name(self, name):
  if self.has_attr(prefix):
 --
 1.7.10.1
 
 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel
 
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [spice-common PATCH] python_modules/ptypes.py/EnumBaseType.c_enumname: add missing return to fix broken enums generation

2012-06-14 Thread Alon Levy
On Thu, Jun 14, 2012 at 05:11:02AM -0400, Marc-André Lureau wrote:
 I don't see exactly what it will fixed, perhaps you should include a small 
 example. But that looks like a typo and can't harm, ACK
 

./spice_codegen.py --generate-enums spice.proto spice-protocol/spice/enums.h

Produces a file with many None's without this patch.

I'll update the commit message.

 - Mensaje original -
  ---
   python_modules/ptypes.py |2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
  
  diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
  index 132ba99..d9fbfe2 100644
  --- a/python_modules/ptypes.py
  +++ b/python_modules/ptypes.py
  @@ -234,7 +234,7 @@ class EnumBaseType(Type):
   return codegen.prefix_camel(self.name)
   
   def c_enumname(self, value):
  -self.c_enumname_by_name(self.names[value])
  +return self.c_enumname_by_name(self.names[value])
   
   def c_enumname_by_name(self, name):
   if self.has_attr(prefix):
  --
  1.7.10.1
  
  ___
  Spice-devel mailing list
  Spice-devel@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/spice-devel
  
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel