db-sync-tool-kmi 2.11.9__py3-none-any.whl → 2.11.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of db-sync-tool-kmi might be problematic. Click here for more details.

db_sync_tool/info.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """
2
2
  Info script
3
3
  """
4
- __version__ = "2.11.9"
4
+ __version__ = "2.11.11"
5
5
  __pypi_package_url__ = "https://pypi.org/pypi/db-sync-tool-kmi"
6
6
  __homepage__ = "https://github.com/jackd248/db-sync-tool"
@@ -96,12 +96,7 @@ def get_database_setting_from_additional_configuration(client, name, file):
96
96
  :param file: String
97
97
  :return:
98
98
  """
99
- return mode.run_command(
100
- helper.get_command(client, 'sed') +
101
- f' -nE "s/\'{name}\'.*=>.*\'(.*)\'.*$/\\1/p" {file}',
102
- client,
103
- True
104
- ).replace('\n', '').strip()
99
+ return helper.run_sed_command(client, f'"s/\'{name}\'.*=>.*\'(.*)\'.*$/\\1/p" {file}')
105
100
 
106
101
  def get_database_setting_from_env(client, name, file):
107
102
  """
@@ -112,9 +107,4 @@ def get_database_setting_from_env(client, name, file):
112
107
  :param file: String
113
108
  :return:
114
109
  """
115
- return mode.run_command(
116
- helper.get_command(client, 'sed') +
117
- f' -nE "s/{name}=(.*).*$/\\1/p" {file}',
118
- client,
119
- True
120
- ).replace('\n', '').strip()
110
+ return helper.run_sed_command(client, f'"s/{name}=(.*).*$/\\1/p" {file}')
@@ -351,3 +351,28 @@ def remove_surrounding_quotes(s):
351
351
  elif s.startswith("'") and s.endswith("'"):
352
352
  return s[1:-1]
353
353
  return s
354
+
355
+
356
+ def run_sed_command(client, command):
357
+ """
358
+ Executes a sed command on the specified client, trying -E first and falling back to -r if -E fails.
359
+
360
+ :param client: The client on which the sed command should be executed.
361
+ :param command: The sed command to execute (excluding the sed options).
362
+ :return: The result of the sed command as a cleaned string (with newlines removed).
363
+ """
364
+ # Check if the client supports -E or -r option for sed
365
+ option = mode.run_command(
366
+ f"echo | {get_command(client, 'sed')} -E '' >/dev/null 2>&1 && echo -E || (echo | {get_command(client, 'sed')} -r '' >/dev/null 2>&1 && echo -r)",
367
+ client,
368
+ True
369
+ )
370
+ # If neither option is supported, default to -E
371
+ if option == '':
372
+ option = '-E'
373
+
374
+ return mode.run_command(
375
+ f"{get_command(client, 'sed')} -n {option} {command}",
376
+ client,
377
+ True
378
+ ).strip().replace('\n', '')
@@ -145,7 +145,7 @@ class SyncMode:
145
145
 
146
146
  :return: boolean
147
147
  """
148
- return SyncMode.is_same_configuration('host') and SyncMode.is_same_configuration('port')
148
+ return SyncMode.is_same_configuration('host') and SyncMode.is_same_configuration('port') and SyncMode.is_same_configuration('user')
149
149
 
150
150
  @staticmethod
151
151
  def is_available_configuration(key):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: db_sync_tool-kmi
3
- Version: 2.11.9
3
+ Version: 2.11.11
4
4
  Summary: Synchronize a database from and to host systems.
5
5
  Home-page: https://github.com/jackd248/db-sync-tool
6
6
  Author: Konrad Michalik
@@ -1,6 +1,6 @@
1
1
  db_sync_tool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  db_sync_tool/__main__.py,sha256=-pD13j2oYcKLhPprLy-LQeDCapj-FKrV3CDFHuYJu3g,11541
3
- db_sync_tool/info.py,sha256=lQSxNR2x67MTkUq0QcILVpQ7TTKZeUbjVY-U0Ws_skk,165
3
+ db_sync_tool/info.py,sha256=JIaORX73FkfwAe5aOfqF_7rRSl_w_Jp346ZX2jTUt2I,166
4
4
  db_sync_tool/sync.py,sha256=WMfMts0M8z3oecI-HL07xG9ktbba8D8h7_U-8tBwizY,2087
5
5
  db_sync_tool/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  db_sync_tool/database/process.py,sha256=djOnNnwEswkmPbnJVsI3SvPSwzcZgAapighh3Ew5heE,8069
@@ -9,7 +9,7 @@ db_sync_tool/recipes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
9
9
  db_sync_tool/recipes/drupal.py,sha256=jAo1d3vxZ4UZ4Vzk308Dsmn1--ORmVO2g87l8OpQoPw,1505
10
10
  db_sync_tool/recipes/laravel.py,sha256=kp_gnKG0iyX_rzM0GW7Ca9ZPV3oGfEgGsLvJR_0pVDo,1175
11
11
  db_sync_tool/recipes/symfony.py,sha256=8ObIRXdoBG1MbWD7pd1TxUQboz5LUWbfzz3TX6F9G5w,2517
12
- db_sync_tool/recipes/typo3.py,sha256=6KLOgetCRe7cY60p0KqsP9Rq2DKRZVfnna4onritfy4,5067
12
+ db_sync_tool/recipes/typo3.py,sha256=6vTulkViqbx_4ZyJV5kAHbSqifJK82uRKUTwRI5SqhU,4857
13
13
  db_sync_tool/recipes/wordpress.py,sha256=KN3HTzDbs5p2GD7vvTEhBl7xNOiy2YHrXhVLmiF_y_A,1468
14
14
  db_sync_tool/remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  db_sync_tool/remote/client.py,sha256=wjcoQ1jp9i8PMO_6XX2XMXZCoLXy-ySA38seZtY-Sns,6553
@@ -18,17 +18,17 @@ db_sync_tool/remote/system.py,sha256=A9OIaypETMYx7frTKpXBgja-kXj7vSD6gJs8pUNpL_I
18
18
  db_sync_tool/remote/transfer.py,sha256=pYVsad4SKkJ0TgZHcyLc17Z9xK6exdyO7R8TBe4qQcQ,5872
19
19
  db_sync_tool/remote/utility.py,sha256=knTfzFKLdw2QsirvTfTz76XmckagKURKVBhjyREsQIo,3580
20
20
  db_sync_tool/utility/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
- db_sync_tool/utility/helper.py,sha256=zf1dPKgb5loLcOUtinjHdY9D_E6Gp5kLjbS8R-bRrxw,8905
21
+ db_sync_tool/utility/helper.py,sha256=--bUFgvLhHutqS__1B8nTZKjFnLZ0H8ZSmfnGlUy7n8,9837
22
22
  db_sync_tool/utility/info.py,sha256=8VdUMi3fsyykfMKKrmgUVoW9WEHPXbzPkVNHOIsNAMo,2976
23
23
  db_sync_tool/utility/log.py,sha256=OdJsVKyvJqQYl5NUzb5bIg1uhUJ9kj7c7kT9oKbGvo8,869
24
- db_sync_tool/utility/mode.py,sha256=DAkt-N5sYr6r2iTL_1sWu7_WHq04DNO4YjvBLkU3LeA,8588
24
+ db_sync_tool/utility/mode.py,sha256=ibhV2cSY5VjA-kH1Pkk7VXlqNiFkv4IVeKRDNAtd09k,8631
25
25
  db_sync_tool/utility/output.py,sha256=uoiWE7Pm8qv1a3vrBupZHE545d1uZSQHiLAUgkHofLM,4758
26
26
  db_sync_tool/utility/parser.py,sha256=DIdWVGyiltyH8akoWyyXLvUmFPR-nvBrnzDctPJzgKw,6624
27
27
  db_sync_tool/utility/system.py,sha256=G74lWGFcJNmLr0l6-GkZWmkk7q3icv4MccuHFKP_Vsw,18539
28
28
  db_sync_tool/utility/validation.py,sha256=qZNPgkTwV_kJTNtFh0OXb2FHrsWPnDA2W_fftWs5hZc,3530
29
- db_sync_tool_kmi-2.11.9.dist-info/licenses/LICENSE,sha256=o_R9gPKBRl4PQVcGCrWuTYsJQJ7uuQDcDaq-wapBUaw,1082
30
- db_sync_tool_kmi-2.11.9.dist-info/METADATA,sha256=CYfLbv50QzlHvm2Z81LWcGqux7iu4VtyCUpFaXL6D0M,12876
31
- db_sync_tool_kmi-2.11.9.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
32
- db_sync_tool_kmi-2.11.9.dist-info/entry_points.txt,sha256=bVk6UR_ejpfY2oSCoOii7uKQivwV9MtA6Tdqpjg4Yvo,60
33
- db_sync_tool_kmi-2.11.9.dist-info/top_level.txt,sha256=Uj5hJLhmdynFrBE0VnX0PfgIBC8_n7h2vgldqUQ-xfw,13
34
- db_sync_tool_kmi-2.11.9.dist-info/RECORD,,
29
+ db_sync_tool_kmi-2.11.11.dist-info/licenses/LICENSE,sha256=o_R9gPKBRl4PQVcGCrWuTYsJQJ7uuQDcDaq-wapBUaw,1082
30
+ db_sync_tool_kmi-2.11.11.dist-info/METADATA,sha256=PdStOCtb9DUHk1A6g0lTAvPzBsAoE5Crch7W96RMuUg,12877
31
+ db_sync_tool_kmi-2.11.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
+ db_sync_tool_kmi-2.11.11.dist-info/entry_points.txt,sha256=bVk6UR_ejpfY2oSCoOii7uKQivwV9MtA6Tdqpjg4Yvo,60
33
+ db_sync_tool_kmi-2.11.11.dist-info/top_level.txt,sha256=Uj5hJLhmdynFrBE0VnX0PfgIBC8_n7h2vgldqUQ-xfw,13
34
+ db_sync_tool_kmi-2.11.11.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5