Skip to content

Commit fcffa9f

Browse files
committed
Add description to server and database configs, change option descriptions
1 parent 4685feb commit fcffa9f

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

firebird/driver/config.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
class ServerConfig(Config):
4848
"""Server configuration.
4949
"""
50-
def __init__(self, name: str, *, optional: bool=False):
51-
super().__init__(name, optional=optional)
50+
def __init__(self, name: str, *, optional: bool=False, description: str=None):
51+
super().__init__(name, optional=optional, description=description)
5252
#: Server host machine specification
5353
self.host: StrOption = \
5454
StrOption('host', "Server host machine specification")
@@ -75,8 +75,8 @@ def __init__(self, name: str, *, optional: bool=False):
7575
class DatabaseConfig(Config):
7676
"""Database configuration.
7777
"""
78-
def __init__(self, name: str, *, optional: bool=False):
79-
super().__init__(name, optional=optional)
78+
def __init__(self, name: str, *, optional: bool=False, description: str=None):
79+
super().__init__(name, optional=optional, description=description)
8080
#: Name of server where database is located
8181
self.server: StrOption = \
8282
StrOption('server', "Name of server where database is located")
@@ -88,7 +88,7 @@ def __init__(self, name: str, *, optional: bool=False):
8888
StrOption('database', "Database file specification or alias")
8989
#: Database filename should be passed in UTF8
9090
self.utf8filename: BoolOption = \
91-
BoolOption('utf8filename', "Database filename should passed in UTF8")
91+
BoolOption('utf8filename', "Database filename should be passed in UTF8")
9292
#: Protocol to be used for database
9393
self.protocol: EnumOption = \
9494
EnumOption('protocol', NetProtocol, "Protocol to be used for database")
@@ -116,14 +116,14 @@ def __init__(self, name: str, *, optional: bool=False):
116116
IntOption('timeout', "Connection timeout")
117117
#: Do not use linger for database connection
118118
self.no_linger: BoolOption = \
119-
BoolOption('no_linger', "Do not use linger for database connections")
119+
BoolOption('no_linger', "Do not use linger for database connection")
120120
#: Page cache size override for database connection
121121
self.cache_size: IntOption = \
122-
IntOption('cache_size', "Page cache size override for database connections")
122+
IntOption('cache_size', "Page cache size override for database connection")
123123
#: Dummy packet interval for this database connection
124124
self.dummy_packet_interval: IntOption = \
125125
IntOption('dummy_packet_interval',
126-
"Dummy packet interval for this database connections")
126+
"Dummy packet interval")
127127
#: Configuration override
128128
self.config: StrOption = \
129129
StrOption('config', "Configuration override")
@@ -133,29 +133,29 @@ def __init__(self, name: str, *, optional: bool=False):
133133
# Create options
134134
#: Database create option. Page size to be used.
135135
self.page_size: IntOption = \
136-
IntOption('page_size', "Page size to be used")
136+
IntOption('page_size', "Page size to be used for created database.")
137137
#: Database create option. Write mode (True = sync/False = async).
138138
self.forced_writes: BoolOption = \
139-
BoolOption('forced_writes', "Write mode (True = sync/False = async)")
139+
BoolOption('forced_writes', "Write mode for created database (True = sync, False = async)")
140140
#: Database create option. Character set for the database.
141141
self.db_charset: StrOption = \
142-
StrOption('db_charset', "Character set for the database")
142+
StrOption('db_charset', "Character set for created database")
143143
#: Database create option. SQL dialect for the database.
144144
self.db_sql_dialect: IntOption = \
145-
IntOption('db_sql_dialect', "SQL dialect for the database")
145+
IntOption('db_sql_dialect', "SQL dialect for created database")
146146
#: Database create option. Page cache size override for database.
147147
self.db_cache_size: IntOption = \
148-
IntOption('db_cache_size', "Page cache size override for database")
148+
IntOption('db_cache_size', "Page cache size override for created database")
149149
#: Database create option. Sweep interval for the database.
150150
self.sweep_interval: IntOption = \
151-
IntOption('sweep_interval', "Sweep interval for the database")
151+
IntOption('sweep_interval', "Sweep interval for created database")
152152
#: Database create option. Data page space usage (True = reserve space, False = Use all space).
153153
self.reserve_space: BoolOption = \
154154
BoolOption('reserve_space',
155-
"Data page space usage (True = reserve space, False = Use all space)")
155+
"Data page space usage for created database (True = reserve space, False = Use all space)")
156156

157157
class DriverConfig(Config):
158-
"""Driver configuration.
158+
"""Firebird driver configuration.
159159
"""
160160
def __init__(self, name: str):
161161
super().__init__(name)
@@ -169,10 +169,12 @@ def __init__(self, name: str):
169169
default=65536)
170170
#: Default database configuration ('firebird.db.defaults')
171171
self.db_defaults: DatabaseConfig = DatabaseConfig('firebird.db.defaults',
172-
optional=True)
172+
optional=True,
173+
description="Default database configuration.")
173174
#: Default server configuration ('firebird.server.defaults')
174175
self.server_defaults: ServerConfig = ServerConfig('firebird.server.defaults',
175-
optional=True)
176+
optional=True,
177+
description="Default server configuration.")
176178
#: Registered servers
177179
self.servers: ConfigListOption = \
178180
ConfigListOption('servers', "Registered servers", ServerConfig)

0 commit comments

Comments
 (0)