Skip to content

Commit f1acc07

Browse files
committed
Release 1.0.1
1 parent 133245f commit f1acc07

File tree

19 files changed

+10814
-1007
lines changed

19 files changed

+10814
-1007
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ dmypy.json
128128
# Pyre type checker
129129
.pyre/
130130

131-
# WingIDE project files
131+
# WingIDE
132132
*.wpr
133133
*.wpu
134+
135+
# Sphinx build
136+
docs/_build

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include LICENSE
2+
include test/*
3+
include docs/*

docs/changelog.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
Changelog
33
#########
44

5+
Version 1.0.1
6+
=============
7+
8+
* Build scheme changed to `PEP 517`.
9+
* Various changes to documentation and type hint adjustments.
10+
* trace: New `has_statement_free` parsing option indicating that parsed trace contains
11+
`FREE_STATEMENT` events.
12+
* trace: Adjustments to seen items cache management.
13+
514
Version 1.0.0
615
=============
716

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
# -- Project information -----------------------------------------------------
2020

2121
project = 'firebird-lib'
22-
copyright = '2020, The Firebird Project'
22+
copyright = '2020-2021, The Firebird Project'
2323
author = 'Pavel Císař'
2424

2525
# The short X.Y version
26-
version = '1.0.0'
26+
version = '1.0.1'
2727

2828
# The full version, including alpha/beta/rc tags
29-
release = '1.0.0'
29+
release = '1.0.1'
3030

3131

3232
# -- General configuration ---------------------------------------------------
@@ -37,7 +37,7 @@
3737
extensions = [
3838
'sphinx.ext.autodoc',
3939
'sphinx.ext.intersphinx',
40-
'sphinxcontrib.napoleon',
40+
'sphinx.ext.napoleon',
4141
'sphinx_autodoc_typehints',
4242
'sphinx.ext.todo',
4343
]

firebird/lib/gstat.py

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
"""firebird.lib.gstat - Module for work with Firebird gstat output
3535
36-
3736
"""
3837

3938
from __future__ import annotations
@@ -124,7 +123,8 @@
124123
items_fill = ['0 - 19%', '20 - 39%', '40 - 59%', '60 - 79%', '80 - 99%']
125124

126125
class DbAttribute(Enum):
127-
"Database attributes stored in header page clumplets."
126+
"""Database attributes stored in header page clumplets.
127+
"""
128128
WRITE = 'force write'
129129
NO_RESERVE = 'no reserve'
130130
NO_SHARED_CACHE = 'shared cache disabled'
@@ -139,7 +139,8 @@ class DbAttribute(Enum):
139139

140140
@dataclass(frozen=True)
141141
class FillDistribution:
142-
"Data/Index page fill distribution"
142+
"""Data/Index page fill distribution.
143+
"""
143144
d20: int
144145
d40: int
145146
d60: int
@@ -148,7 +149,8 @@ class FillDistribution:
148149

149150
@dataclass(frozen=True)
150151
class Encryption:
151-
"Page encryption status"
152+
"""Page encryption status.
153+
"""
152154
pages: int
153155
encrypted: int
154156
unencrypted: int
@@ -163,11 +165,13 @@ class _ParserState:
163165
step: int = 0
164166

165167
def empty_str(value: str) -> bool:
166-
"Return True if string is empty (whitespace don't count) or None"
168+
"""Return True if string is empty (whitespace don't count) or None.
169+
"""
167170
return True if value is None else value.strip() == ''
168171

169172
class StatTable:
170-
"Statisctics for single database table."
173+
"""Statisctics for single database table.
174+
"""
171175
def __init__(self):
172176
#: Table name
173177
self.name: str = None
@@ -237,7 +241,8 @@ def __init__(self):
237241
self.level_2: int = None
238242

239243
class StatIndex:
240-
"Statisctics for single database index."
244+
"""Statisctics for single database index.
245+
"""
241246
def __init__(self, table):
242247
#: wekref.proxy: Proxy to parent `.StatTable`
243248
self.table: weakref.ProxyType = weakref.proxy(table)
@@ -276,7 +281,8 @@ def __init__(self, table):
276281
self.ratio: float = None
277282

278283
class StatDatabase:
279-
"""Firebird database statistics (produced by gstat)."""
284+
"""Firebird database statistics (produced by gstat).
285+
"""
280286
def __init__(self):
281287
#: GSTAT version
282288
self.gstat_version: int = None
@@ -552,26 +558,30 @@ def __parse_encryption(self, line: str) -> None:
552558
else:
553559
raise Error(f'Unknown encryption information (line {self.__line_no})')
554560
def has_table_stats(self) -> bool:
555-
"""Return True if instance contains information about tables.
561+
"""Returns True if instance contains information about tables.
556562
557563
.. important::
558564
559-
This is not the same as check for empty :data:`tables` list. When gstat is run with `-i` without
560-
`-d` option, :data:`tables` list contains instances that does not have any other information about table
561-
but table name and its indices.
562-
"""
565+
This is not the same as check for empty :data:`tables` list. When gstat is run
566+
with `-i` without `-d` option, :data:`tables` list contains instances that does
567+
not have any other information about table but table name and its indices.
568+
"""
563569
return self.tables[0].primary_pointer_page is not None if len(self.tables) > 0 else False
564570
def has_row_stats(self) -> bool:
565-
"Return True if instance contains information about table rows."
571+
"""Returns True if instance contains information about table rows.
572+
"""
566573
return self.has_table_stats() and self.tables[0].avg_version_length is not None
567574
def has_index_stats(self) -> bool:
568-
"Return True if instance contains information about indices."
575+
"""Returns True if instance contains information about indices.
576+
"""
569577
return self.indices[0].depth is not None if len(self.indices) > 0 else False
570578
def has_encryption_stats(self) -> bool:
571-
"Return True if instance contains information about database encryption."
579+
"""Returns True if instance contains information about database encryption.
580+
"""
572581
return self.encrypted_data_pages is not None
573582
def has_system(self) -> bool:
574-
"Return True if instance contains information about system tables."
583+
"""Returns True if instance contains information about system tables.
584+
"""
575585
return self.tables.contains("item.name.startswith('RDB$DATABASE')")
576586
def parse(self, lines: Iterable[str]) -> None:
577587
"""Parses gstat output.
@@ -666,9 +676,11 @@ def push(self, line: Union[str, Sentinel]) -> None:
666676
self.__parse_index(line)
667677
@property
668678
def tables(self) -> DataList[StatTable]:
669-
"`~firebird.base.collections.DataList` of `.StatTable` instances"
679+
"""`~firebird.base.collections.DataList` of `.StatTable` instances.
680+
"""
670681
return self.__tables
671682
@property
672683
def indices(self) -> DataList[StatIndex]:
673-
"`~firebird.base.collections.DataList` of `StatIndex` instances"
684+
"""`~firebird.base.collections.DataList` of `StatIndex` instances.
685+
"""
674686
return self.__indices

firebird/lib/log.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545

4646
@dataclass(order=True, frozen=True)
4747
class LogMessage:
48-
"Firebird log message."
48+
"""Firebird log message.
49+
"""
4950
#: Firebird server identification
5051
origin: str
5152
#: Date and time when message was written to log
@@ -63,7 +64,8 @@ class LogMessage:
6364
params: Dict[str, Any]
6465

6566
class LogParser:
66-
""""""
67+
"""Parser for firebird.log files.
68+
"""
6769
def __init__(self):
6870
self.__buffer: List[str] = []
6971
def push(self, line: Union[str, Sentinel]) -> Optional[LogMessage]:
@@ -136,7 +138,7 @@ def parse(self, lines: Iterable):
136138
137139
Raises:
138140
firebird.base.types.Error: When any problem is found in input stream.
139-
"""
141+
"""
140142
for line in lines:
141143
result = self.push(line)
142144
if result is not None:

0 commit comments

Comments
 (0)