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: if wizard.formatWidgets[format][u'fileListWidget'].count() > 0:
return True return True
else: else:
filepath = wizard.formatWidgets[format][u'filepathEdit'].text() filepath = unicode(
if not filepath.isEmpty(): wizard.formatWidgets[format][u'filepathEdit'].text())
if select_mode == SongFormatSelect.SingleFile \ if filepath:
and os.path.isfile(filepath): if select_mode == SongFormatSelect.SingleFile and \
os.path.isfile(filepath):
return True return True
elif select_mode == SongFormatSelect.SingleFolder \ elif select_mode == SongFormatSelect.SingleFolder and \
and os.path.isdir(filepath): os.path.isdir(filepath):
return True return True
return False 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 = urllib2.Request(url + '?details')
request.add_header('Authorization', auth_header) request.add_header('Authorization', auth_header)
print_verbose(u'Downloading list of languages from: %s' % url) print_verbose(u'Downloading list of languages from: %s' % url)
try:
json_response = urllib2.urlopen(request) json_response = urllib2.urlopen(request)
except urllib2.HTTPError:
print_quiet(u'Username or password incorrect.')
return False
json_dict = json.loads(json_response.read()) json_dict = json.loads(json_response.read())
languages = [lang[u'code'] for lang in json_dict[u'available_languages']] languages = [lang[u'code'] for lang in json_dict[u'available_languages']]
for language in languages: for language in languages:
@ -214,6 +218,7 @@ def download_translations():
fd.write(response.read()) fd.write(response.read())
fd.close() fd.close()
print_quiet(u' Done.') print_quiet(u' Done.')
return True
def prepare_project(): def prepare_project():
""" """
@ -310,7 +315,8 @@ def process_stack(command_stack):
for command in command_stack: for command in command_stack:
print_quiet(u'%d.' % (command_stack.current_index), False) print_quiet(u'%d.' % (command_stack.current_index), False)
if command == Command.Download: if command == Command.Download:
download_translations() if not download_translations():
return
elif command == Command.Prepare: elif command == Command.Prepare:
prepare_project() prepare_project()
elif command == Command.Update: elif command == Command.Update: