[glib] Support initial underscores in dbus codegen namespace
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Support initial underscores in dbus codegen namespace
- Date: Thu, 19 Apr 2012 08:40:54 +0000 (UTC)
commit ff92fe95935b38eaacedb287f6600df000ed1c1a
Author: Alexander Larsson <alexl redhat com>
Date: Mon Apr 16 09:55:29 2012 +0200
Support initial underscores in dbus codegen namespace
Before these were considered lowercase and thus got duplicated.
gio/gdbus-2.0/codegen/utils.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py
index 687b979..94bd05c 100644
--- a/gio/gdbus-2.0/codegen/utils.py
+++ b/gio/gdbus-2.0/codegen/utils.py
@@ -44,7 +44,14 @@ def camel_case_to_uscore(s):
ret = ''
insert_uscore = False
prev_was_lower = False
+ initial = True;
for c in s:
+ # Keep initial underscores in camel case
+ if initial and c == '_':
+ ret += '_'
+ continue;
+ initial = False
+
if c.isupper():
if prev_was_lower:
insert_uscore = True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]