forked from openlp/openlp
Fix duplicate tags in strings
This commit is contained in:
parent
403df406df
commit
8cc6f1dbcb
@ -68,9 +68,11 @@ def get_db_path(plugin_name, db_file_name=None):
|
|||||||
:return: The path to the database as type str
|
:return: The path to the database as type str
|
||||||
"""
|
"""
|
||||||
if db_file_name is None:
|
if db_file_name is None:
|
||||||
return 'sqlite:///%s/%s.sqlite' % (AppLocation.get_section_data_path(plugin_name), plugin_name)
|
return 'sqlite:///{path}/{plugin}.sqlite'.format(path=AppLocation.get_section_data_path(plugin_name),
|
||||||
|
plugin=plugin_name)
|
||||||
else:
|
else:
|
||||||
return 'sqlite:///%s/%s' % (AppLocation.get_section_data_path(plugin_name), db_file_name)
|
return 'sqlite:///{path}/{name}'.format(path=AppLocation.get_section_data_path(plugin_name),
|
||||||
|
name=db_file_name)
|
||||||
|
|
||||||
|
|
||||||
def handle_db_error(plugin_name, db_file_name):
|
def handle_db_error(plugin_name, db_file_name):
|
||||||
@ -101,10 +103,11 @@ def init_url(plugin_name, db_file_name=None):
|
|||||||
if db_type == 'sqlite':
|
if db_type == 'sqlite':
|
||||||
db_url = get_db_path(plugin_name, db_file_name)
|
db_url = get_db_path(plugin_name, db_file_name)
|
||||||
else:
|
else:
|
||||||
db_url = '%s://%s:%s@%s/%s' % (db_type, urlquote(settings.value('db username')),
|
db_url = '{type}://{user}:{password}@{host}/{db}'.format(type=db_type,
|
||||||
urlquote(settings.value('db password')),
|
user=urlquote(settings.value('db username')),
|
||||||
urlquote(settings.value('db hostname')),
|
password=urlquote(settings.value('db password')),
|
||||||
urlquote(settings.value('db database')))
|
host=urlquote(settings.value('db hostname')),
|
||||||
|
db=urlquote(settings.value('db database')))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
return db_url
|
return db_url
|
||||||
|
|
||||||
|
@ -637,8 +637,8 @@ def build_background_css(item, width):
|
|||||||
background = 'background: -webkit-gradient(linear, left top, right top, from({start}), to({end})) ' \
|
background = 'background: -webkit-gradient(linear, left top, right top, from({start}), to({end})) ' \
|
||||||
'fixed'.format(start=theme.background_start_color, end=theme.background_end_color)
|
'fixed'.format(start=theme.background_start_color, end=theme.background_end_color)
|
||||||
else:
|
else:
|
||||||
background = 'background: -webkit-gradient(radial, {width1} 50%, 100, {width2} 50%, {width3}, ' \
|
background = 'background: -webkit-gradient(radial, {width} 50%, 100, {width} 50%, {width}, ' \
|
||||||
'from({start}), to({end})) fixed'.format(width1=width, width2=width, width3=width,
|
'from({start}), to({end})) fixed'.format(width=width,
|
||||||
start=theme.background_start_color,
|
start=theme.background_start_color,
|
||||||
end=theme.background_end_color)
|
end=theme.background_end_color)
|
||||||
return background
|
return background
|
||||||
@ -677,10 +677,9 @@ def build_lyrics_css(item):
|
|||||||
lyrics = build_lyrics_format_css(theme_data, item.main.width(), item.main.height())
|
lyrics = build_lyrics_format_css(theme_data, item.main.width(), item.main.height())
|
||||||
lyricsmain += build_lyrics_outline_css(theme_data)
|
lyricsmain += build_lyrics_outline_css(theme_data)
|
||||||
if theme_data.font_main_shadow:
|
if theme_data.font_main_shadow:
|
||||||
lyricsmain += ' text-shadow: {theme} {shadow1}px ' \
|
lyricsmain += ' text-shadow: {theme} {shadow}px ' \
|
||||||
'{shadow2}px;'.format(theme=theme_data.font_main_shadow_color,
|
'{shadow}px;'.format(theme=teme_data.font_main_shadow_color,
|
||||||
shadow1=theme_data.font_main_shadow_size,
|
shadow=theme_data.font_main_shadow_size)
|
||||||
shadow2=theme_data.font_main_shadow_size)
|
|
||||||
lyrics_css = style % (lyricstable, lyrics, lyricsmain)
|
lyrics_css = style % (lyricstable, lyrics, lyricsmain)
|
||||||
return lyrics_css
|
return lyrics_css
|
||||||
|
|
||||||
|
@ -380,8 +380,7 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties):
|
|||||||
self.load_list(full_list, target_group)
|
self.load_list(full_list, target_group)
|
||||||
last_dir = os.path.split(files[0])[0]
|
last_dir = os.path.split(files[0])[0]
|
||||||
Settings().setValue(self.settings_section + '/last directory', last_dir)
|
Settings().setValue(self.settings_section + '/last directory', last_dir)
|
||||||
Settings().setValue('{section1}/{section2} files'.format(section1=self.settings_section,
|
Settings().setValue('{section}/{section} files'.format(section=self.settings_section),
|
||||||
section2=self.settings_section),
|
|
||||||
self.get_file_list())
|
self.get_file_list())
|
||||||
if duplicates_found:
|
if duplicates_found:
|
||||||
critical_error_message_box(UiStrings().Duplicate,
|
critical_error_message_box(UiStrings().Duplicate,
|
||||||
|
Loading…
Reference in New Issue
Block a user