This commit is contained in:
Samuel Findlay 2012-07-08 18:25:20 +10:00
commit 4b5a346d20
27 changed files with 33369 additions and 33221 deletions

View File

@ -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

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

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

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

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

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

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

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

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

File diff suppressed because it is too large Load Diff

View File

@ -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: