From e618d99bc7adb47b724aebf67ea85e59c520e10d Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Wed, 6 Aug 2008 03:58:15 +0000 Subject: 57: to_cli() function no longer replaces '__' with '.'; from_cli() function no longer replaces '.' with '__'; updated unit tests --- ipalib/plugable.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ipalib/plugable.py') diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 801ef7ab..01adc613 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -32,7 +32,7 @@ def to_cli(name): Command Line Interface. """ assert isinstance(name, str) - return name.replace('__', '.').replace('_', '-') + return name.replace('_', '-') def from_cli(cli_name): @@ -41,7 +41,7 @@ def from_cli(cli_name): Python identifier. """ assert isinstance(cli_name, basestring) - return cli_name.replace('-', '_').replace('.', '__') + return cli_name.replace('-', '_') def check_identifier(name): @@ -143,7 +143,7 @@ class Proxy(ReadOnly): """ if proxy_name is None: proxy_name = obj.__class__.__name__ - assert isinstance(proxy_name, str) + check_identifier(proxy_name) object.__setattr__(self, '_Proxy__obj', obj) object.__setattr__(self, 'name', proxy_name) if callable(obj): -- cgit