forked from openlp/openlp
r2019
This commit is contained in:
commit
4b5a346d20
@ -541,12 +541,13 @@ class SongImportSourcePage(QtGui.QWizardPage):
|
||||
if wizard.formatWidgets[format][u'fileListWidget'].count() > 0:
|
||||
return True
|
||||
else:
|
||||
filepath = wizard.formatWidgets[format][u'filepathEdit'].text()
|
||||
if not filepath.isEmpty():
|
||||
if select_mode == SongFormatSelect.SingleFile \
|
||||
and os.path.isfile(filepath):
|
||||
filepath = unicode(
|
||||
wizard.formatWidgets[format][u'filepathEdit'].text())
|
||||
if filepath:
|
||||
if select_mode == SongFormatSelect.SingleFile and \
|
||||
os.path.isfile(filepath):
|
||||
return True
|
||||
elif select_mode == SongFormatSelect.SingleFolder \
|
||||
and os.path.isdir(filepath):
|
||||
elif select_mode == SongFormatSelect.SingleFolder and \
|
||||
os.path.isdir(filepath):
|
||||
return True
|
||||
return False
|
||||
|
2645
resources/i18n/af.ts
2645
resources/i18n/af.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/cs.ts
2645
resources/i18n/cs.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/da.ts
2645
resources/i18n/da.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/de.ts
2645
resources/i18n/de.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/el.ts
2645
resources/i18n/el.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/en.ts
2645
resources/i18n/en.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2702
resources/i18n/es.ts
2702
resources/i18n/es.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/et.ts
2645
resources/i18n/et.ts
File diff suppressed because it is too large
Load Diff
2653
resources/i18n/fi.ts
2653
resources/i18n/fi.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/fr.ts
2645
resources/i18n/fr.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/hu.ts
2645
resources/i18n/hu.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/id.ts
2645
resources/i18n/id.ts
File diff suppressed because it is too large
Load Diff
2653
resources/i18n/it.ts
2653
resources/i18n/it.ts
File diff suppressed because it is too large
Load Diff
2756
resources/i18n/ja.ts
2756
resources/i18n/ja.ts
File diff suppressed because it is too large
Load Diff
2689
resources/i18n/ko.ts
2689
resources/i18n/ko.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/nb.ts
2645
resources/i18n/nb.ts
File diff suppressed because it is too large
Load Diff
2831
resources/i18n/nl.ts
2831
resources/i18n/nl.ts
File diff suppressed because it is too large
Load Diff
2653
resources/i18n/pl.ts
2653
resources/i18n/pl.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/ru.ts
2645
resources/i18n/ru.ts
File diff suppressed because it is too large
Load Diff
2653
resources/i18n/sq.ts
2653
resources/i18n/sq.ts
File diff suppressed because it is too large
Load Diff
2645
resources/i18n/sv.ts
2645
resources/i18n/sv.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -199,7 +199,11 @@ def download_translations():
|
||||
request = urllib2.Request(url + '?details')
|
||||
request.add_header('Authorization', auth_header)
|
||||
print_verbose(u'Downloading list of languages from: %s' % url)
|
||||
try:
|
||||
json_response = urllib2.urlopen(request)
|
||||
except urllib2.HTTPError:
|
||||
print_quiet(u'Username or password incorrect.')
|
||||
return False
|
||||
json_dict = json.loads(json_response.read())
|
||||
languages = [lang[u'code'] for lang in json_dict[u'available_languages']]
|
||||
for language in languages:
|
||||
@ -214,6 +218,7 @@ def download_translations():
|
||||
fd.write(response.read())
|
||||
fd.close()
|
||||
print_quiet(u' Done.')
|
||||
return True
|
||||
|
||||
def prepare_project():
|
||||
"""
|
||||
@ -310,7 +315,8 @@ def process_stack(command_stack):
|
||||
for command in command_stack:
|
||||
print_quiet(u'%d.' % (command_stack.current_index), False)
|
||||
if command == Command.Download:
|
||||
download_translations()
|
||||
if not download_translations():
|
||||
return
|
||||
elif command == Command.Prepare:
|
||||
prepare_project()
|
||||
elif command == Command.Update:
|
||||
|
Loading…
Reference in New Issue
Block a user