Skip to content

Commit 70e4435

Browse files
authored
Python string cleanup
* Python string cleanup * Fix line lengths * Further Python string fixes.
1 parent ec3b508 commit 70e4435

File tree

18 files changed

+84
-87
lines changed

18 files changed

+84
-87
lines changed

web/pgadmin/authenticate/mfa/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def _mfa_registration_view(
172172

173173
if form_data[mfa.name] == 'SETUP':
174174
if supported_mfa['registered'] is True:
175-
flash(_("'{}' is already registered'").format(mfa.label),
175+
flash(_("'{}' is already registered.").format(mfa.label),
176176
MessageType.SUCCESS)
177177
return None
178178

web/pgadmin/browser/register_browser_preferences.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def register_browser_preferences(self):
5555
gettext("Hide shared servers?"), 'boolean', False,
5656
category_label=gettext('Display'),
5757
help_str=gettext(
58-
'If set to True, then all shared servers will be '
59-
'hidden from browser tree'
58+
'If set to True, all shared servers will be '
59+
'hidden from the browser tree.'
6060
)
6161
)
6262

@@ -75,8 +75,8 @@ def register_browser_preferences(self):
7575
gettext("Confirm on close or refresh?"), 'boolean',
7676
True, category_label=PREF_LABEL_DISPLAY,
7777
help_str=gettext(
78-
'Confirm closure or refresh of the browser or browser tab is '
79-
'intended before proceeding.'
78+
'Confirm that closure or refresh of the browser or browser tab '
79+
'is intended before proceeding.'
8080
)
8181
)
8282

@@ -114,7 +114,7 @@ def register_browser_preferences(self):
114114
min_val=1, max_val=9999,
115115
help_str=gettext(
116116
'The maximum number of history rows to show on '
117-
'the Statistics tab for pgAgent jobs'
117+
'the Statistics tab for pgAgent jobs.'
118118
)
119119
)
120120

@@ -410,8 +410,8 @@ def register_browser_preferences(self):
410410
gettext("Dynamic tab size"), 'boolean', False,
411411
category_label=PREF_LABEL_TABS_SETTINGS,
412412
help_str=gettext(
413-
'If set to True, the tabs will take full size as per the title, '
414-
'it will also applicable for already opened tabs')
413+
'If set to True, the tabs will take full size as per the title. '
414+
'This will also apply to already opened tabs.')
415415
)
416416

417417
self.qt_tab_title = self.preference.register(
@@ -422,8 +422,7 @@ def register_browser_preferences(self):
422422
help_str=gettext(
423423
'Supported placeholders are %DATABASE%, %USERNAME%, and %SERVER%. '
424424
'Users can provide any string with or without placeholders of'
425-
' their choice. The blank title will be revert back to the'
426-
' default title with placeholders.'
425+
' their choice. A blank title will revert to the default.'
427426
)
428427
)
429428

@@ -435,8 +434,8 @@ def register_browser_preferences(self):
435434
help_str=gettext(
436435
'Supported placeholders are %SCHEMA%, %TABLE%, %DATABASE%, '
437436
'%USERNAME%, and %SERVER%. Users can provide any string with or '
438-
'without placeholders of their choice. The blank title will be '
439-
'revert back to the default title with placeholders.'
437+
'without placeholders of their choice. A blank title will revert '
438+
'to the default.'
440439
)
441440
)
442441

@@ -448,8 +447,8 @@ def register_browser_preferences(self):
448447
help_str=gettext(
449448
'Supported placeholders are %FUNCTION%, %ARGS%, %SCHEMA% and'
450449
' %DATABASE%. Users can provide any string with or '
451-
'without placeholders of their choice. The blank title will be'
452-
' revert back to the default title with placeholders.'
450+
'without placeholders of their choice. A blank title will revert '
451+
'to the default.'
453452
)
454453
)
455454

@@ -470,9 +469,9 @@ def register_browser_preferences(self):
470469
category_label=PREF_LABEL_OPTIONS,
471470
options=open_new_tab_options,
472471
help_str=gettext(
473-
'Select Query Tool, Debugger, Schema Diff, ERD Tool '
474-
'or PSQL Tool from the drop-down to set '
475-
'open in new browser tab for that particular module.'
472+
'Select Query Tool, Debugger, Schema Diff, ERD Tool, '
473+
'or PSQL Tool from the drop-down to open that module '
474+
'in a new browser tab.'
476475
),
477476
control_props={
478477
'multiple': True, 'allowClear': False,
@@ -493,8 +492,8 @@ def register_browser_preferences(self):
493492
help_str=gettext(
494493
'Supported placeholders are %DATABASE%, %USERNAME%, '
495494
'and %SERVER%. Users can provide any string with or without'
496-
' placeholders of their choice. The blank title will be revert'
497-
' back to the default title with placeholders.'
495+
' placeholders of their choice. A blank title will revert '
496+
'to the default.'
498497
)
499498
)
500499

web/pgadmin/browser/register_editor_preferences.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ def register_editor_preferences(self):
330330
gettext("Expression Width"), 'integer', 50,
331331
category_label=PREF_LABEL_SQL_FORMATTING,
332332
help_str=gettext(
333-
'maximum number of characters in parenthesized expressions to be '
334-
'kept on single line.'
333+
'Maximum number of characters in parenthesized expressions to be '
334+
'kept on a single line.'
335335
)
336336
)
337337

@@ -355,7 +355,7 @@ def register_editor_preferences(self):
355355
category_label=PREF_LABEL_SQL_FORMATTING,
356356
help_str=gettext(
357357
'Decides how many empty lines to leave between SQL statements. '
358-
'If zero it puts no new line.'
358+
'A value of zero means no empty lines are added.'
359359
)
360360
)
361361

web/pgadmin/browser/server_groups/servers/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -945,8 +945,8 @@ def _server_modify_disallowed_when_connected(
945945
if arg in data:
946946
return forbidden(
947947
errmsg=gettext(
948-
"'{0}' is not allowed to modify, "
949-
"when server is connected."
948+
"'{0}' cannot be modified "
949+
"when the server is connected."
950950
).format(disp_lbl[arg])
951951
)
952952

@@ -1968,7 +1968,7 @@ def wal_replay(self, sid, pause=True):
19681968
info=msg,
19691969
data={'in_recovery': True, 'wal_pause': pause}
19701970
)
1971-
return gone(errormsg=gettext('Please connect the server.'))
1971+
return gone(errormsg=gettext('Please connect to the server.'))
19721972
except Exception as e:
19731973
current_app.logger.error(
19741974
'WAL replay pause/resume failed'
@@ -2026,7 +2026,7 @@ def check_pgpass(self, gid, sid):
20262026
conn = manager.connection()
20272027
if not conn.connected():
20282028
return gone(
2029-
errormsg=gettext('Please connect the server.')
2029+
errormsg=gettext('Please connect to the server.')
20302030
)
20312031

20322032
if (not server.password or not manager.password) and \
@@ -2042,7 +2042,7 @@ def check_pgpass(self, gid, sid):
20422042
)
20432043
except Exception as e:
20442044
current_app.logger.error(
2045-
'Cannot able to fetch pgpass status'
2045+
'Unable to fetch pgpass status'
20462046
)
20472047
return internal_server_error(errormsg=str(e))
20482048

@@ -2147,7 +2147,7 @@ def clear_saved_password(self, gid, sid):
21472147

21482148
return make_json_response(
21492149
success=1,
2150-
info=gettext("The saved password cleared successfully."),
2150+
info=gettext("The saved password was cleared successfully."),
21512151
data={'is_password_saved': False}
21522152
)
21532153

@@ -2179,7 +2179,7 @@ def clear_sshtunnel_password(self, gid, sid):
21792179

21802180
return make_json_response(
21812181
success=1,
2182-
info=gettext("The saved password cleared successfully."),
2182+
info=gettext("The saved password was cleared successfully."),
21832183
data={'is_tunnel_password_saved': False}
21842184
)
21852185

web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,12 +713,12 @@ def sql(self, gid, sid, did, cid, json_resp=True):
713713
status, res = self.conn.execute_scalar(sql)
714714
if not status:
715715
return internal_server_error(gettext(
716-
"Could not generate reversed engineered SQL for the cast."
716+
"Could not generate reverse-engineered SQL for the cast."
717717
) + "\n\n{0}".format(res))
718718

719719
if res is None:
720720
return gone(gettext(
721-
"Could not generate reversed engineered SQL for the "
721+
"Could not generate reverse-engineered SQL for the "
722722
"cast node."
723723
))
724724

web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,15 +942,15 @@ def sql(self, gid, sid, did, scid, cfgid, **kwargs):
942942
if not status:
943943
return internal_server_error(
944944
_(
945-
"Could not generate reversed engineered query for the "
945+
"Could not generate reverse-engineered query for the "
946946
"FTS Configuration.\n{0}"
947947
).format(res)
948948
)
949949

950950
if res is None:
951951
return gone(
952952
_(
953-
"Could not generate reversed engineered query for "
953+
"Could not generate reverse-engineered query for "
954954
"FTS Configuration node.")
955955
)
956956

web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,15 +883,15 @@ def sql(self, gid, sid, did, scid, pid, **kwargs):
883883
if not status:
884884
return internal_server_error(
885885
_(
886-
"Could not generate reversed engineered query for the "
886+
"Could not generate reverse-engineered query for the "
887887
"FTS Parser.\n{0}"
888888
).format(res)
889889
)
890890

891891
if res is None:
892892
return gone(
893893
_(
894-
"Could not generate reversed engineered query for "
894+
"Could not generate reverse-engineered query for "
895895
"FTS Parser node."
896896
)
897897
)

web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,14 +755,14 @@ def sql(self, gid, sid, did, scid, tid, **kwargs):
755755
if not status:
756756
return internal_server_error(
757757
gettext(
758-
"Could not generate reversed engineered query for the "
758+
"Could not generate reverse-engineered query for the "
759759
"FTS Template.\n{0}").format(res)
760760
)
761761

762762
if res is None:
763763
return gone(
764764
gettext(
765-
"Could not generate reversed engineered query for "
765+
"Could not generate reverse-engineered query for "
766766
"FTS Template node.")
767767
)
768768

web/pgadmin/browser/server_groups/servers/roles/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,15 +904,15 @@ def sql(self, gid, sid, rid):
904904

905905
if not status:
906906
return internal_server_error(
907-
_("Could not generate reversed engineered query for the "
907+
_("Could not generate reverse-engineered query for the "
908908
"role.\n{0}").format(
909909
res
910910
)
911911
)
912912

913913
if res is None or (len(res) == 0):
914914
return gone(
915-
_("Could not generate reversed engineered query for the role.")
915+
_("Could not generate reverse-engineered query for the role.")
916916
)
917917

918918
return ajax_response(response=res.strip('\n'))

web/pgadmin/dashboard/__init__.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,8 @@ def register_preferences(self):
9999

100100
self.cpu_stats_refresh = self.dashboard_preference.register(
101101
'dashboards', 'cpu_stats_refresh',
102-
gettext(
103-
"Percentage of CPU time used by different process \
104-
modes statistics refresh rate"
105-
), 'integer', 5, min_val=1, max_val=999999,
102+
gettext("CPU usage by process mode refresh rate"),
103+
'integer', 5, min_val=1, max_val=999999,
106104
category_label=PREF_LABEL_REFRESH_RATES,
107105
help_str=help_string
108106
)
@@ -198,16 +196,16 @@ def register_preferences(self):
198196
gettext("Use different data point styles?"), 'boolean', False,
199197
category_label=PREF_LABEL_DISPLAY,
200198
help_str=gettext('If set to True, data points will be visible '
201-
'in a different style on each graph lines.')
199+
'in a different style on each graph line.')
202200
)
203201

204202
self.graph_mouse_track = self.graphs_preference.register(
205203
'graphs', 'graph_mouse_track',
206204
gettext("Show mouse hover tooltip?"), 'boolean', True,
207205
category_label=PREF_LABEL_DISPLAY,
208-
help_str=gettext('If set to True, tooltip will appear on mouse '
209-
'hover on the graph lines giving the data point '
210-
'details')
206+
help_str=gettext('If set to True, a tooltip will appear on mouse '
207+
'hover on the graph lines showing the data point '
208+
'details.')
211209
)
212210

213211
self.graph_line_border_width = self.graphs_preference.register(

0 commit comments

Comments
 (0)