diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-07-02 06:02:49 +0200 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-07-15 12:28:56 +0200 |
commit | d11075c164cebad8642b138895a975497918dca4 (patch) | |
tree | 27d547cc808e674c35ee301644eb3382cb80c626 | |
parent | c0cc0f2b3537821a4e9dd7c18707bc9ed824c5d9 (diff) | |
download | nbb-d11075c164cebad8642b138895a975497918dca4.tar.gz nbb-d11075c164cebad8642b138895a975497918dca4.tar.xz nbb-d11075c164cebad8642b138895a975497918dca4.zip |
Get rid of all {}.has_key() occurences
-rw-r--r-- | src/nbblib/commands.py | 2 | ||||
-rw-r--r-- | src/nbblib/main.py | 2 | ||||
-rw-r--r-- | src/nbblib/plugins.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/nbblib/commands.py b/src/nbblib/commands.py index 4a9a17f..e5eab40 100644 --- a/src/nbblib/commands.py +++ b/src/nbblib/commands.py @@ -357,7 +357,7 @@ class UnknownCommand(Exception): __all__.append('NBB_Command') class NBB_Command(object): def __init__(self, cmd, cmdargs, context): - if Command.plugins.has_key(cmd): + if cmd in Command.plugins: try: c = Command.plugins[cmd](*cmdargs, **{'context':context}) c.run() diff --git a/src/nbblib/main.py b/src/nbblib/main.py index 3800665..fabbdad 100644 --- a/src/nbblib/main.py +++ b/src/nbblib/main.py @@ -101,7 +101,7 @@ class InvalidPropertyValue(Exception): class Property(object): def __init__(self, *args, **kwargs): assert(len(args) == 0) - if kwargs.has_key('default'): + if 'default' in kwargs: self.default = kwargs['default'] valid_kwargs = ('default',) for kwa in kwargs.iterkeys(): diff --git a/src/nbblib/plugins.py b/src/nbblib/plugins.py index c71be79..784b49e 100644 --- a/src/nbblib/plugins.py +++ b/src/nbblib/plugins.py @@ -182,7 +182,7 @@ class PluginDict(dict): # This is the important difference between PluginDict and dict. def __setitem__(self, key, value): - if self.has_key(key): + if key in self: raise DuplicatePluginName() else: super(PluginDict, self).__setitem__(key, value) |