aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2023-02-20 01:13:52 -0800
committerclarkzjw <[email protected]>2023-02-20 01:13:52 -0800
commitb41ed0201c80e3de0078dbacd766f5ef62819363 (patch)
treead38edd21883cc06f0aa357c0f49cb1435cb9bc2
parenta099e6cf153ae7155957bb16bc56233d2420288c (diff)
downloadswarm2fediverse-b41ed0201c80e3de0078dbacd766f5ef62819363.tar.gz
add python ini config example
-rw-r--r--Dockerfile1
-rw-r--r--config.ini12
-rw-r--r--config.py28
3 files changed, 41 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..2d13273
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1 @@
FROM python:3
diff --git a/config.ini b/config.ini
new file mode 100644
index 0000000..8b4f7bf
--- /dev/null
+++ b/config.ini
@@ -0,0 +1,12 @@
1; [DEFAULT]
2; ServerAliveInterval = 45
3; Compression = yes
4; CompressionLevel = 9
5; ForwardX11 = yes
6
7; [forge.example]
8; User = hg
9
10; [topsecret.server.example]
11; Port = 50022
12; ForwardX11 = no
diff --git a/config.py b/config.py
new file mode 100644
index 0000000..7f8e2f0
--- /dev/null
+++ b/config.py
@@ -0,0 +1,28 @@
1# https://docs.python.org/3/library/configparser.html
2
3# import configparser
4# config = configparser.ConfigParser()
5# config['DEFAULT'] = {'ServerAliveInterval': '45',
6# 'Compression': 'yes',
7# 'CompressionLevel': '9'}
8# config['forge.example'] = {}
9# config['forge.example']['User'] = 'hg'
10# config['topsecret.server.example'] = {}
11# topsecret = config['topsecret.server.example']
12# topsecret['Port'] = '50022' # mutates the parser
13# topsecret['ForwardX11'] = 'no' # same here
14# config['DEFAULT']['ForwardX11'] = 'yes'
15# with open('example.ini', 'w') as configfile:
16# config.write(configfile)
17
18# config = configparser.ConfigParser()
19# config.sections()
20# config.read('example.ini')
21# config.sections()
22# topsecret = config['topsecret.server.example']
23# topsecret['ForwardX11']
24# topsecret['Port']
25# for key in config['forge.example']:
26# print(key)
27
28# config['forge.example']['ForwardX11']
Powered by cgit v1.2.3 (git 2.41.0)