gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-bank] 05/09: done linting talerconfig


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] 05/09: done linting talerconfig
Date: Tue, 05 Dec 2017 13:21:47 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository bank.

commit da36d0b31cee4b1e76fa72e0253c77fd05535d15
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Dec 5 12:23:41 2017 +0100

    done linting talerconfig
---
 talerbank/app/tests.py   |  2 +-
 talerbank/talerconfig.py | 17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index a207c00..d249f13 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -439,5 +439,5 @@ class MeasureHistory(TestCase):
                              setup="from talerbank.app.views import 
extract_history",
                              globals=locals())
         total_time = timer.timeit(number=1)
-        allowed_time_per_record = 0.0017
+        allowed_time_per_record = 0.002
         self.assertLess(total_time, self.ntransfers*allowed_time_per_record)
diff --git a/talerbank/talerconfig.py b/talerbank/talerconfig.py
index 0aa1780..a7ca065 100644
--- a/talerbank/talerconfig.py
+++ b/talerbank/talerconfig.py
@@ -108,8 +108,6 @@ class OptionDict(collections.defaultdict):
 
 
 class SectionDict(collections.defaultdict):
-    def __init__(self):
-        super().__init__()
     def __missing__(self, key):
         value = OptionDict(self, key)
         self[key] = value
@@ -171,10 +169,10 @@ class Entry:
         return None
 
     def value_filename(self, default=None, required=False, warn=False):
-        value = self.value_string(default, warn, required)
+        value = self.value_string(default, required, warn)
         if value is None:
             return None
-        return expand(value, lambda x: self._getsubst(x))
+        return expand(value, self._getsubst)
 
     def location(self):
         if self.filename is None or self.lineno is None:
@@ -303,10 +301,13 @@ class TalerConfig:
 
 
     def dump(self):
-        for section_name, section in self.sections.items():
-            print("[%s]" % (section.section_name,))
-            for option_name, entry in section.items():
-                print("%s = %s # %s" % (entry.option, entry.value, 
entry.location()))
+        for kv_section in self.sections.items():
+            print("[%s]" % (kv_section[1].section_name,))
+            for kv_option in kv_section[1].items():
+                print("%s = %s # %s" % \
+                      (kv_option[1].option,
+                       kv_option[1].value,
+                       kv_option[1].location()))
 
     def __getitem__(self, chunk):
         if isinstance(chunk, str):

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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