summaryrefslogtreecommitdiff
path: root/effitool
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-01-23 09:41:47 +0200
committerLars Wirzenius <liw@liw.fi>2019-01-23 09:41:47 +0200
commit95491de0c6c5377107a8a7eb6ce4b665e7e0f1d2 (patch)
treedbf8dcff7c9d60655243a5ccfe64d8b36377d4fe /effitool
parent64fa50994b1e74e3ce72fe4702a6f6dcda7c8560 (diff)
downloadeffitool-95491de0c6c5377107a8a7eb6ce4b665e7e0f1d2.tar.gz
Add: read config file
Diffstat (limited to 'effitool')
-rwxr-xr-xeffitool25
1 files changed, 24 insertions, 1 deletions
diff --git a/effitool b/effitool
index 071cc7f..6a42885 100755
--- a/effitool
+++ b/effitool
@@ -16,8 +16,31 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import configparser
+import os
+import sys
+
+
+CONFIG_FILENAME = os.path.expanduser('~/.config/effitool/credentials.conf')
+
+
+class Config:
+
+ def __init__(self):
+ self._cp = configparser.ConfigParser()
+
+ def read(self, filename):
+ with open(filename) as f:
+ self._cp.read_file(f)
+
+ def dump(self, f):
+ self._cp.write(f)
+
+
def main():
- print('hello from effitool')
+ config = Config()
+ config.read(CONFIG_FILENAME)
+ config.dump(sys.stdout)
if __name__ == '__main__':