Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit51b0871

Browse files
committed
Merge branch 'docfix'
2 parents0051f44 +f7bd228 commit51b0871

File tree

6 files changed

+29
-93
lines changed

6 files changed

+29
-93
lines changed

‎LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
testgres is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
22

3-
Copyright (c) 2016-2017, Postgres Professional
3+
Copyright (c) 2016-2018, Postgres Professional
44

55
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
66

‎docs/source/testgres.rst‎

Lines changed: 5 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@ testgres.backup
1717
:undoc-members:
1818
:show-inheritance:
1919

20-
testgres.cache
21-
--------------
22-
23-
..automodule::testgres.cache
24-
:members:
25-
:undoc-members:
26-
:show-inheritance:
27-
28-
testgres.config
29-
---------------
30-
31-
..automodule::testgres.config
32-
:members:
33-
:undoc-members:
34-
:show-inheritance:
35-
3620
testgres.connection
3721
-------------------
3822

@@ -41,30 +25,6 @@ testgres.connection
4125
:undoc-members:
4226
:show-inheritance:
4327

44-
testgres.consts
45-
---------------
46-
47-
..automodule::testgres.consts
48-
:members:
49-
:undoc-members:
50-
:show-inheritance:
51-
52-
testgres.decorators
53-
-------------------
54-
55-
..automodule::testgres.decorators
56-
:members:
57-
:undoc-members:
58-
:show-inheritance:
59-
60-
testgres.defaults
61-
-----------------
62-
63-
..automodule::testgres.defaults
64-
:members:
65-
:undoc-members:
66-
:show-inheritance:
67-
6828
testgres.enums
6929
--------------
7030

@@ -81,35 +41,13 @@ testgres.exceptions
8141
:undoc-members:
8242
:show-inheritance:
8343

84-
testgres.logger
85-
---------------
86-
87-
..automodule::testgres.logger
88-
:members:
89-
:undoc-members:
90-
:show-inheritance:
91-
9244
testgres.node
9345
-------------
9446

95-
..automodule::testgres.node
96-
:members:
97-
:undoc-members:
98-
:show-inheritance:
99-
100-
testgres.utils
101-
--------------
102-
103-
..automodule::testgres.utils
104-
:members:
105-
:undoc-members:
106-
:show-inheritance:
107-
47+
..autoclass::testgres.node.PostgresNode
48+
:members:
10849

109-
Module contents
110-
---------------
50+
..automethod::__init__
11151

112-
..automodule::testgres
113-
:members:
114-
:undoc-members:
115-
:show-inheritance:
52+
..autoclass::testgres.node.ProcessProxy
53+
:members:

‎testgres/api.py‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@
2929
... print(replica.execute('postgres', 'select count(*) from test'))
3030
PostgresNode(name='...', port=..., base_dir='...')
3131
[(3,)]
32-
33-
Copyright (c) 2016, Postgres Professional
3432
"""
35-
36-
fromfunctoolsimportwraps
37-
3833
from .nodeimportPostgresNode
3934

4035

41-
@wraps(PostgresNode.__init__)
4236
defget_new_node(name=None,base_dir=None,**kwargs):
37+
"""
38+
Simply a wrapper around :class:`.PostgresNode` constructor.
39+
See :meth:`.PostgresNode.__init__` for details.
40+
"""
4341
# NOTE: leave explicit 'name' and 'base_dir' for compatibility
4442
returnPostgresNode(name=name,base_dir=base_dir,**kwargs)

‎testgres/backup.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self,
4343
Create a new backup.
4444
4545
Args:
46-
node: PostgresNode we're going to backup.
46+
node::class:`.PostgresNode` we're going to backup.
4747
base_dir: where should we store it?
4848
username: database user name.
4949
xlog_method: none | fetch | stream (see docs)
@@ -136,7 +136,7 @@ def spawn_primary(self, name=None, destroy=True):
136136
destroy: should we convert this backup into a node?
137137
138138
Returns:
139-
New instance of PostgresNode.
139+
New instance of:class:`.PostgresNode`.
140140
"""
141141

142142
# Prepare a data directory for this node
@@ -164,7 +164,7 @@ def spawn_replica(self, name=None, destroy=True, slot=None):
164164
destroy: should we convert this backup into a node?
165165
166166
Returns:
167-
New instance of PostgresNode.
167+
New instance of:class:`.PostgresNode`.
168168
"""
169169

170170
# Build a new PostgresNode

‎testgres/enums.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
classXLogMethod(Enum):
66
"""
7-
Available WAL methods for NodeBackup
7+
Available WAL methods for:class:`.NodeBackup`
88
"""
99

1010
none='none'
@@ -14,7 +14,7 @@ class XLogMethod(Enum):
1414

1515
classIsolationLevel(Enum):
1616
"""
17-
Transaction isolation level for NodeConnection
17+
Transaction isolation level for:class:`.NodeConnection`
1818
"""
1919

2020
ReadUncommitted='read uncommitted'

‎testgres/node.py‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def __repr__(self):
9696
classPostgresNode(object):
9797
def__init__(self,name=None,port=None,base_dir=None):
9898
"""
99-
Create a new node.
99+
PostgresNode constructor.
100100
101101
Args:
102102
name: node's application name.
@@ -181,7 +181,7 @@ def auxiliary_pids(self):
181181
defauxiliary_processes(self):
182182
"""
183183
Returns a list of auxiliary processes.
184-
Each process is represented by ProcessProxy object.
184+
Each process is represented by:class:`.ProcessProxy` object.
185185
"""
186186

187187
defis_aux(process):
@@ -193,7 +193,7 @@ def is_aux(process):
193193
defchild_processes(self):
194194
"""
195195
Returns a list of all child processes.
196-
Each process is represented by ProcessProxy object.
196+
Each process is represented by:class:`.ProcessProxy` object.
197197
"""
198198

199199
# get a list of postmaster's children
@@ -391,7 +391,7 @@ def init(self, initdb_params=None, **kwargs):
391391
allow_streaming: should this node add a hba entry for replication?
392392
393393
Returns:
394-
This instance ofPostgresNode.
394+
This instance of:class:`.PostgresNode`
395395
"""
396396

397397
# initialize this PostgreSQL node
@@ -420,7 +420,7 @@ def default_conf(self,
420420
log_statement: one of ('all', 'off', 'mod', 'ddl').
421421
422422
Returns:
423-
This instance of PostgresNode.
423+
This instance of:class:`.PostgresNode`.
424424
"""
425425

426426
postgres_conf=os.path.join(self.data_dir,PG_CONF_FILE)
@@ -509,7 +509,7 @@ def append_conf(self, line, filename=PG_CONF_FILE):
509509
filename: config file (postgresql.conf by default).
510510
511511
Returns:
512-
This instance of PostgresNode.
512+
This instance of:class:`.PostgresNode`.
513513
"""
514514

515515
config_name=os.path.join(self.data_dir,filename)
@@ -523,7 +523,7 @@ def status(self):
523523
Check this node's status.
524524
525525
Returns:
526-
An instance of NodeStatus.
526+
An instance of:class:`.NodeStatus`.
527527
"""
528528

529529
try:
@@ -572,7 +572,7 @@ def start(self, params=[]):
572572
params: additional arguments for pg_ctl.
573573
574574
Returns:
575-
This instance of PostgresNode.
575+
This instance of:class:`.PostgresNode`.
576576
"""
577577

578578
_params= [
@@ -602,7 +602,7 @@ def stop(self, params=[]):
602602
params: additional arguments for pg_ctl.
603603
604604
Returns:
605-
This instance of PostgresNode.
605+
This instance of:class:`.PostgresNode`.
606606
"""
607607

608608
_params= [
@@ -626,7 +626,7 @@ def restart(self, params=[]):
626626
params: additional arguments for pg_ctl.
627627
628628
Returns:
629-
This instance of PostgresNode.
629+
This instance of:class:`.PostgresNode`.
630630
"""
631631

632632
_params= [
@@ -656,7 +656,7 @@ def reload(self, params=[]):
656656
params: additional arguments for pg_ctl.
657657
658658
Returns:
659-
This instance of PostgresNode.
659+
This instance of:class:`.PostgresNode`.
660660
"""
661661

662662
_params= [
@@ -706,7 +706,7 @@ def cleanup(self, max_attempts=3):
706706
max_attempts: how many times should we try to stop()?
707707
708708
Returns:
709-
This instance of PostgresNode.
709+
This instance of:class:`.PostgresNode`.
710710
"""
711711

712712
self._try_shutdown(max_attempts)
@@ -1053,7 +1053,7 @@ def pgbench_init(self, **kwargs):
10531053
Sets initialize=True.
10541054
10551055
Returns:
1056-
This instance of PostgresNode.
1056+
This instance of:class:`.PostgresNode`.
10571057
"""
10581058

10591059
self.pgbench_run(initialize=True,**kwargs)
@@ -1117,7 +1117,7 @@ def connect(self, dbname=None, username=None, password=None):
11171117
password: user's password.
11181118
11191119
Returns:
1120-
An instance of NodeConnection.
1120+
An instance of:class:`.NodeConnection`.
11211121
"""
11221122

11231123
returnNodeConnection(node=self,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp