qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qapi: escaping the dots in c_var


From: Michael Roth
Subject: Re: [Qemu-devel] [PATCH] qapi: escaping the dots in c_var
Date: Thu, 15 Mar 2012 09:51:10 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Mar 15, 2012 at 01:53:38PM +0000, Federico Simoncelli wrote:
> This allows qapi commands and types with dots.
> 
> Signed-off-by: Federico Simoncelli <address@hidden>
> ---
>  scripts/qapi.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/qapi.py b/scripts/qapi.py
> index 6e05469..4090c55 100644
> --- a/scripts/qapi.py
> +++ b/scripts/qapi.py
> @@ -131,7 +131,7 @@ def camel_case(name):
>      return new_name
> 
>  def c_var(name):
> -    return '_'.join(name.split('-')).lstrip("*")
> +    return name.replace('-', '_').replace('.', '_').lstrip('*')

What are you looking to use this for? The general rule so far has been to
always use "-" as the word delimiter.

> 
>  def c_list_type(name):
>      return '%sList' % name
> -- 
> 1.7.1
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]