public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Devan Franchini" <twitch153@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/webapp-config:experimental commit in: WebappConfig/
Date: Tue, 23 Sep 2014 17:09:08 +0000 (UTC)	[thread overview]
Message-ID: <1411489530.a05f1ed3659699ac75d5c489049babe4b8e3fef0.twitch153@gentoo> (raw)

commit:     a05f1ed3659699ac75d5c489049babe4b8e3fef0
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 23 16:25:30 2014 +0000
Commit:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Tue Sep 23 16:25:30 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=a05f1ed3

{config, debug}.py: Removes deprecated use of __dict__ invocation

---
 WebappConfig/config.py | 36 ++++++++++++++++++------------------
 WebappConfig/debug.py  | 38 +++++++++++++++++++-------------------
 2 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index 597dc18..5a04fb5 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -846,18 +846,18 @@ class Config:
         # Handle -E
         envmap = []
 
-        if ('envall' in options.__dict__ and 
-            options.__dict__['envall']):
+        if ('envall' in options and 
+            options['envall']):
             envmap = 'all'
 
-        elif ('envvar' in options.__dict__ and 
-              options.__dict__['envvar']):
-            envmap = [x.lower() for x in options.__dict__['envvar']]
+        elif ('envvar' in options and 
+              options['envvar']):
+            envmap = [x.lower() for x in options['envvar']]
 
         OUT.debug('Trying to import environment variables', 7)
 
         if envmap:
-            for (key, value) in list(os.environ.items()):
+            for (key, value) in os.environ.items():
 
                 if envmap == 'all' or key.lower() in envmap:
 
@@ -867,16 +867,16 @@ class Config:
                                     key.lower(),
                                     value)
 
-        if ('define' in options.__dict__ and
-              options.__dict__['define']):
-            for i in options.__dict__['define']:
+        if ('define' in options and
+              options['define']):
+            for i in options['define']:
                 if '=' in i:
                     self.config.set('USER', 
                                     i.split('=')[0].lower(),
                                     i.split('=')[1])
 
         # Indicate that --dir was found
-        if 'dir' in options.__dict__:
+        if 'dir' in options:
             self.flag_dir = True
 
         # Map command line options into the configuration
@@ -894,14 +894,14 @@ class Config:
                             'verbose'      : 'g_verbose',
                             'bug_report'   : 'g_bugreport'}
 
-        for i in list(option_to_config.keys()):
-            if i in options.__dict__ and options.__dict__[i]:
+        for i in option_to_config.keys():
+            if i in options and options[i]:
                 self.config.set('USER', option_to_config[i],
-                                str(options.__dict__[i]))
+                                str(options[i]))
 
         # handle verbosity
-        if ('pretend' in options.__dict__
-            and options.__dict__['pretend']):
+        if ('pretend' in options
+            and options['pretend']):
 
             self.config.set('USER', 'g_verbose', 'True')
 
@@ -944,12 +944,12 @@ class Config:
                 'show_postupgrade', 'check_config', 'query']
 
         for i in work:
-            if options.__dict__.get(i):
+            if options.get(i):
                 self.work = i
                 break
 
-        if options.__dict__.get('prune_database'):
-            self.prune_action = options.__dict__.get('prune_database')
+        if options.get('prune_database'):
+            self.prune_action = options.get('prune_database')
 
         OUT.debug('Checking command line arguments', 1)
 

diff --git a/WebappConfig/debug.py b/WebappConfig/debug.py
index 1e6bd2c..3ced649 100644
--- a/WebappConfig/debug.py
+++ b/WebappConfig/debug.py
@@ -169,37 +169,37 @@ class Message:
 
     def cli_handle(self, options):
 
-        if ('debug' in options.__dict__
-            and options.__dict__['debug']):
+        if ('debug' in options
+            and options['debug']):
             self.debug_on()
         else:
             self.debug_off()
             return
 
-        if ('debug_class_vars' in options.__dict__
-            and options.__dict__['debug_class_vars']):
+        if ('debug_class_vars' in options
+            and options['debug_class_vars']):
             self.class_variables_on()
         else:
             self.class_variables_off()
 
-        if ('debug_nocolor' in options.__dict__
-            and options.__dict__['debug_nocolor']):
+        if ('debug_nocolor' in options
+            and options['debug_nocolor']):
             self.color_off()
         else:
             self.color_on()
 
-        if ('debug_level' in options.__dict__ and
-            options.__dict__['debug_level']):
-            dbglvl = int(options.__dict__['debug_level'])
+        if ('debug_level' in options and
+            options['debug_level']):
+            dbglvl = int(options['debug_level'])
             if dbglvl < 0:
                 dbglvl = 0
             if dbglvl > 10:
                 dbglvl = 10
             self.set_debug_level(dbglvl)
 
-        if ('debug_verbose' in options.__dict__ and
-            options.__dict__['debug_verbose']):
-            dbgvrb = int(options.__dict__['debug_verbose'])
+        if ('debug_verbose' in options and
+            options['debug_verbose']):
+            dbgvrb = int(options['debug_verbose'])
             if dbgvrb < 1:
                 dbgvrb = 1
             if dbgvrb > 3:
@@ -210,9 +210,9 @@ class Message:
                   ('debug_classes',   self.set_debug_classes),
                   ('debug_variables', self.set_debug_variables),]:
 
-            if (i[0] in options.__dict__ and
-                options.__dict__[i[0]]):
-                i[1](options.__dict__[i[0]])
+            if (i[0] in options and
+                options[i[0]]):
+                i[1](options[i[0]])
 
 
     #############################################################################
@@ -395,7 +395,7 @@ class Message:
         callerlocals = inspect.getargvalues(caller[0])[3]
 
         ## Is the caller an obejct? If so he provides 'self'
-        if 'self' in list(callerlocals.keys()):
+        if 'self' in callerlocals.keys():
             callerobject = callerlocals['self']
             del callerlocals['self']
             if self.show_class_variables:
@@ -407,7 +407,7 @@ class Message:
 
         # Remove variables not requested
         if not '*' in self.debug_var:
-            callerlocals = dict([i for i in list(callerlocals.items())
+            callerlocals = dict([i for i in callerlocals.items()
                                  if i[0] in self.debug_var])
 
         ## Is the object among the list of objects to debug?
@@ -445,7 +445,7 @@ class Message:
             print('// ' + c, file=self.debug_out)
             # Selected variables follow
             if callerlocals:
-                for i,j in list(callerlocals.items()):
+                for i,j in callerlocals.items():
                     print('// '                              \
                           + self.maybe_color('turquoise', str(i)) + ':' + str(j), file=self.debug_out)
             # Finally the message
@@ -480,7 +480,7 @@ class Message:
             if self.debug_vrb == 3:
                 print(ls + '//', file=self.debug_out)
                 print(ls + '// VALUES ', file=self.debug_out)
-            for i,j in list(callerlocals.items()):
+            for i,j in callerlocals.items():
                 print(ls + '// ------------------> '         \
                       + self.maybe_color('turquoise', str(i)) + ':', file=self.debug_out)
                 breaklines(str(j))


             reply	other threads:[~2014-09-23 17:09 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 17:09 Devan Franchini [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-06-19 19:19 [gentoo-commits] proj/webapp-config:experimental commit in: WebappConfig/ Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-05-17  3:54 Devan Franchini
2015-05-17  3:44 Devan Franchini
2015-05-17  3:19 Devan Franchini
2015-05-17  2:51 Devan Franchini
2015-05-17  2:42 Devan Franchini
2015-05-17  2:28 Devan Franchini
2015-05-17  0:38 Devan Franchini
2015-05-16  2:16 Devan Franchini
2014-11-18  0:03 Devan Franchini
2014-11-17 23:58 Devan Franchini
2014-11-17 23:42 Devan Franchini
2014-11-14  1:14 Devan Franchini
2014-10-16 19:18 Devan Franchini
2014-10-15 13:27 Devan Franchini
2014-10-15 13:27 Devan Franchini
2014-10-15 13:27 Devan Franchini
2014-10-14 19:13 Devan Franchini
2014-10-14 17:14 Devan Franchini
2014-10-09 18:02 Devan Franchini
2014-10-09 17:58 Devan Franchini
2014-10-09 17:52 Devan Franchini
2014-04-26 19:33 Devan Franchini
2014-01-24 21:45 Devan Franchini
2014-01-22 15:32 Devan Franchini
2014-01-08  4:03 Devan Franchini
2014-01-04  1:40 Devan Franchini
2014-01-04  1:13 Devan Franchini
2013-12-19  6:34 Devan Franchini
2013-12-10  1:34 Devan Franchini
2013-12-09  8:31 Devan Franchini
2013-12-01  8:50 Devan Franchini
2013-12-01  8:44 Devan Franchini
2013-11-05 22:17 Devan Franchini
2013-11-05 22:17 Devan Franchini
2013-10-29  2:18 Devan Franchini
2013-10-27 19:27 Devan Franchini
2013-10-27  2:26 Devan Franchini
2013-10-19  3:34 Devan Franchini
2013-10-18  3:39 Devan Franchini
2013-10-10  3:46 Devan Franchini
2013-10-10  3:41 Devan Franchini
2013-10-10  3:36 Devan Franchini
2013-10-10  2:00 Devan Franchini
2013-09-23  3:51 Devan Franchini
2013-09-23  1:13 Devan Franchini
2013-09-23  1:06 Devan Franchini
2013-09-23  0:19 Devan Franchini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1411489530.a05f1ed3659699ac75d5c489049babe4b8e3fef0.twitch153@gentoo \
    --to=twitch153@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox