You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kibble.apache.org by GitBox <gi...@apache.org> on 2020/10/27 17:35:42 UTC

[GitHub] [kibble] turbaszek commented on a change in pull request #83: Use KibbleConfigParser in setup script

turbaszek commented on a change in pull request #83:
URL: https://github.com/apache/kibble/pull/83#discussion_r512893016



##########
File path: kibble/configuration.py
##########
@@ -14,22 +14,20 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
+import os
 from configparser import ConfigParser
 
+DEFAULT_KIBBLE_CONFIG_LOCATION = os.path.join(
+    os.path.dirname(os.path.realpath(__file__)), os.pardir, "kibble.ini"
+)
+
 
 class KibbleConfigParser(ConfigParser):
+    """Custom Kibble config parser"""
+
     def __init__(self):
         super().__init__()
 
-    def get_int(self, section: str, key: str) -> int:
-        try:
-            return int(self.get(section, key))
-        except Exception:
-            raise TypeError("Unable to convert value to int")
 
-    def get_bool(self, section: str, key: str) -> bool:
-        try:
-            return bool(self.get(section, key))
-        except Exception:
-            raise TypeError("Unable to convert value to bool")

Review comment:
       @skekre98 unfortunately I had to remove those method as it seems that `ConfigParser` already implements `getint` and `getboolean`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org