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

Commit8430468

Browse files
committed
remove all kinds of mangling
1 parentac75f15 commit8430468

File tree

4 files changed

+78
-77
lines changed

4 files changed

+78
-77
lines changed

‎testgres/backup.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
fromsiximportraise_from
88

99
from .constsimport \
10-
DATA_DIRas_DATA_DIR, \
11-
PG_CONF_FILEas_PG_CONF_FILE, \
12-
BACKUP_LOG_FILEas_BACKUP_LOG_FILE, \
13-
DEFAULT_XLOG_METHODas_DEFAULT_XLOG_METHOD
10+
DATA_DIR, \
11+
PG_CONF_FILE, \
12+
BACKUP_LOG_FILE, \
13+
DEFAULT_XLOG_METHOD
1414

1515
from .exceptionsimportBackupException
1616

1717
from .utilsimport \
1818
get_bin_path, \
19-
default_usernameas_default_username, \
20-
execute_utilityas_execute_utility
19+
default_username, \
20+
execute_utility
2121

2222

2323
classNodeBackup(object):
@@ -27,13 +27,13 @@ class NodeBackup(object):
2727

2828
@property
2929
deflog_file(self):
30-
returnos.path.join(self.base_dir,_BACKUP_LOG_FILE)
30+
returnos.path.join(self.base_dir,BACKUP_LOG_FILE)
3131

3232
def__init__(self,
3333
node,
3434
base_dir=None,
3535
username=None,
36-
xlog_method=_DEFAULT_XLOG_METHOD):
36+
xlog_method=DEFAULT_XLOG_METHOD):
3737
"""
3838
Create a new backup.
3939
@@ -48,7 +48,7 @@ def __init__(self,
4848
raiseBackupException('Node must be running')
4949

5050
# Set default arguments
51-
username=usernameor_default_username()
51+
username=usernameordefault_username()
5252
base_dir=base_dirortempfile.mkdtemp()
5353

5454
# public
@@ -59,7 +59,7 @@ def __init__(self,
5959
# private
6060
self._available=True
6161

62-
data_dir=os.path.join(self.base_dir,_DATA_DIR)
62+
data_dir=os.path.join(self.base_dir,DATA_DIR)
6363

6464
# yapf: disable
6565
_params= [
@@ -70,7 +70,7 @@ def __init__(self,
7070
"-D",data_dir,
7171
"-X",xlog_method
7272
]
73-
_execute_utility(_params,self.log_file)
73+
execute_utility(_params,self.log_file)
7474

7575
def__enter__(self):
7676
returnself
@@ -98,8 +98,8 @@ def _prepare_dir(self, destroy):
9898
ifavailable:
9999
dest_base_dir=tempfile.mkdtemp()
100100

101-
data1=os.path.join(self.base_dir,_DATA_DIR)
102-
data2=os.path.join(dest_base_dir,_DATA_DIR)
101+
data1=os.path.join(self.base_dir,DATA_DIR)
102+
data2=os.path.join(dest_base_dir,DATA_DIR)
103103

104104
try:
105105
# Copy backup to new data dir
@@ -140,8 +140,8 @@ def spawn_primary(self, name=None, destroy=True, use_logging=False):
140140
# New nodes should always remove dir tree
141141
node._should_rm_dirs=True
142142

143-
node.append_conf(_PG_CONF_FILE,"\n")
144-
node.append_conf(_PG_CONF_FILE,"port = {}".format(node.port))
143+
node.append_conf(PG_CONF_FILE,"\n")
144+
node.append_conf(PG_CONF_FILE,"port = {}".format(node.port))
145145

146146
returnnode
147147

‎testgres/cache.py

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

1616
from .utilsimport \
1717
get_bin_path, \
18-
execute_utilityas_execute_utility
18+
execute_utility
1919

2020

2121
defcached_initdb(data_dir,initdb_logfile,initdb_params=[]):
@@ -26,7 +26,7 @@ def cached_initdb(data_dir, initdb_logfile, initdb_params=[]):
2626
defcall_initdb(initdb_dir):
2727
try:
2828
_params= [get_bin_path("initdb"),"-D",initdb_dir,"-N"]
29-
_execute_utility(_params+initdb_params,initdb_logfile)
29+
execute_utility(_params+initdb_params,initdb_logfile)
3030
exceptExecUtilExceptionase:
3131
raise_from(InitNodeException("Failed to run initdb"),e)
3232

‎testgres/connection.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
from .exceptionsimportQueryException
1515

1616
from .utilsimport \
17-
default_dbnameas_default_dbname, \
18-
default_usernameas_default_username
17+
default_dbname, \
18+
default_username
19+
1920

2021
# export these exceptions
2122
InternalError=pglib.InternalError
@@ -37,9 +38,9 @@ class NodeConnection(object):
3738

3839
def__init__(self,node,dbname=None,username=None,password=None):
3940

40-
#Use defaultuser if not specified
41-
dbname=dbnameor_default_dbname()
42-
username=usernameor_default_username()
41+
#Set defaultarguments
42+
dbname=dbnameordefault_dbname()
43+
username=usernameordefault_username()
4344

4445
self._node=node
4546

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp