a tool to create an installer, fix to play audios using sndup and uploading audios to TwUp

This commit is contained in:
2014-11-07 20:14:06 -06:00
parent 9e79bdfbcb
commit 68036e1715
5 changed files with 433 additions and 7 deletions

View File

@@ -44,13 +44,13 @@ def convert_twup(url):
audio_id = result.group("audio_id")
return 'http://twup.me/%s' % audio_id
@matches_url('http://sndup.net')
def convert_sndup(url):
result = re.match("^http://sndup.net/(?P<audio_id>[a-z0-9]+/?)(|d|l|a)/?$", url, re.I)
if not result or result.group("audio_id") is None:
raise TypeError('%r is not a valid URL' % url)
audio_id = result.group("audio_id")
return 'http://sndup.net/%s/a' % audio_id
#@matches_url('http://sndup.net')
#def convert_sndup(url):
# result = re.match("^http://sndup.net/(?P<audio_id>[a-z0-9]+/?)(|d|l|a)/?$", url, re.I)
# if not result or result.group("audio_id") is None:
# raise TypeError('%r is not a valid URL' % url)
# audio_id = result.group("audio_id")
# return 'http://sndup.net/%s/a' % audio_id
def convert_generic_audio(url):
return url

View File

@@ -68,6 +68,7 @@ class audioDialog(wx.Dialog):
services = []
if config.main["services"]["dropbox_token"] != "":
services.append("Dropbox")
services.append("TwUp")
services.append("SNDUp")
return services

View File

@@ -85,6 +85,9 @@ class textLimited(wx.Dialog):
else:
url = base_url
self.uploader = transfer.Upload(field='file', url=url, filename=self.recording.file, completed_callback=self.upload_completed, wxDialog=self.uploaderDialog)
elif self.recording.services.GetValue() == "TwUp":
url = 'http://api.twup.me/post.json'
self.uploader = transfer.Upload(field='file', url=url, filename=self.recording.file, completed_callback=self.upload_completed, wxDialog=self.uploaderDialog)
self.uploaderDialog.Show()
self.uploader.perform_threaded()