Merge pull request #57 from Clement-Jean/master
Use of export in lang.py
This commit is contained in:
commit
82fe251d90
@ -65,7 +65,7 @@ class Esdict(WebService):
|
||||
return self.get_anki_label(filename, 'audio')
|
||||
return ''
|
||||
|
||||
@export([u'音标', u'Phonetic symbols'])
|
||||
@export('PHON')
|
||||
def fld_phonetic(self):
|
||||
return self._get_field('phonitic')
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ class Frdic(WebService):
|
||||
return self.get_anki_label(filename, 'audio')
|
||||
return ''
|
||||
|
||||
@export([u'音标', u'Phonetic symbol'])
|
||||
@export('PHON')
|
||||
def fld_phonetic(self):
|
||||
return self._get_field('phonitic')
|
||||
|
||||
|
||||
@ -39,19 +39,19 @@ class ICIBA(WebService):
|
||||
# return resp
|
||||
|
||||
@ignore_exception
|
||||
@export([u'美式音标', u'Phonetic symbols (US)'])
|
||||
@export('AME_PHON')
|
||||
def fld_phonetic_us(self):
|
||||
seg = self._get_field('baesInfo')
|
||||
return '/' + seg['symbols'][0]['ph_am'] + '/'
|
||||
|
||||
@ignore_exception
|
||||
@export([u'英式音标', u'Phonetic symbols (UK)'])
|
||||
@export('BRE_PHON')
|
||||
def fld_phonetic_uk(self):
|
||||
seg = self._get_field('baesInfo')
|
||||
return '/' + seg['symbols'][0]['ph_en'] + '/'
|
||||
|
||||
@ignore_exception
|
||||
@export([u'美式发音', u'American pronounciation'])
|
||||
@export('AME_PRON')
|
||||
def fld_mp3_us(self):
|
||||
seg = self._get_field('baesInfo')
|
||||
audio_url, t = seg['symbols'][0]['ph_am_mp3'], 'am'
|
||||
@ -64,7 +64,7 @@ class ICIBA(WebService):
|
||||
return audio_url
|
||||
|
||||
@ignore_exception
|
||||
@export([u'英式发音', u'British pronounciation'])
|
||||
@export('BRE_PRON')
|
||||
def fld_mp3_uk(self):
|
||||
seg = self._get_field('baesInfo')
|
||||
audio_url, t = seg['symbols'][0]['ph_en_mp3'], 'en'
|
||||
|
||||
@ -44,8 +44,8 @@ class MiniDict(WebService):
|
||||
tag.decompose()
|
||||
|
||||
return self.cache_this(result)
|
||||
|
||||
@export([u'音标', u'Phonetic symbol'])
|
||||
|
||||
@export('PHON')
|
||||
def fld_phonetic(self):
|
||||
return self._get_field('phonetic')
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class Youdao(WebService):
|
||||
pass
|
||||
return self.cache_this(result)
|
||||
|
||||
@export([u'音标', u'Phonetic symbols'])
|
||||
@export('PHON')
|
||||
def fld_phonetic(self):
|
||||
return self._get_field('phonetic')
|
||||
|
||||
@ -93,7 +93,7 @@ class Youdao(WebService):
|
||||
except:
|
||||
return ''
|
||||
|
||||
@export([u'英式发音', u'British pronounciation'])
|
||||
@export('BRE_PRON')
|
||||
def fld_british_audio(self):
|
||||
audio_url = u'http://dict.youdao.com/dictvoice?audio={}&type=1'.format(self.quote_word)
|
||||
if youdao_download_mp3:
|
||||
@ -102,7 +102,7 @@ class Youdao(WebService):
|
||||
return self.get_anki_label(filename, 'audio')
|
||||
return audio_url
|
||||
|
||||
@export([u'美式发音', u'American pronounciation'])
|
||||
@export('AME_PRON')
|
||||
def fld_american_audio(self):
|
||||
audio_url = u'http://dict.youdao.com/dictvoice?audio={}&type=2'.format(self.quote_word)
|
||||
if youdao_download_mp3:
|
||||
|
||||
@ -65,7 +65,7 @@ class Esdict(WebService):
|
||||
return self.get_anki_label(filename, 'audio')
|
||||
return ''
|
||||
|
||||
@export([u'音标', u'Phonetic symbols'])
|
||||
@export('PHON')
|
||||
def fld_phonetic(self):
|
||||
return self._get_field('phonitic')
|
||||
|
||||
|
||||
@ -64,8 +64,7 @@ class Frdic(WebService):
|
||||
if os.path.exists(filename) or self.net_download(filename, url):
|
||||
return self.get_anki_label(filename, 'audio')
|
||||
return ''
|
||||
|
||||
@export([u'音标', u'Phonetic symbols'])
|
||||
@export('PHON')
|
||||
def fld_phonetic(self):
|
||||
return self._get_field('phonitic')
|
||||
|
||||
|
||||
@ -39,19 +39,19 @@ class ICIBA(WebService):
|
||||
# return resp
|
||||
|
||||
@ignore_exception
|
||||
@export([u'美式音标', u'Phonetic symbols (US)'])
|
||||
@export('AME_PHON')
|
||||
def fld_phonetic_us(self):
|
||||
seg = self._get_field('baesInfo')
|
||||
return '/' + seg['symbols'][0]['ph_am'] + '/'
|
||||
|
||||
@ignore_exception
|
||||
@export([u'英式音标', u'Phonetic symbols (UK)'])
|
||||
@export('BRE_PHON')
|
||||
def fld_phonetic_uk(self):
|
||||
seg = self._get_field('baesInfo')
|
||||
return '/' + seg['symbols'][0]['ph_en'] + '/'
|
||||
|
||||
@ignore_exception
|
||||
@export([u'美式发音', u'American pronounciation')
|
||||
@export('AME_PRON')
|
||||
def fld_mp3_us(self):
|
||||
seg = self._get_field('baesInfo')
|
||||
audio_url, t = seg['symbols'][0]['ph_am_mp3'], 'am'
|
||||
@ -64,7 +64,7 @@ class ICIBA(WebService):
|
||||
return audio_url
|
||||
|
||||
@ignore_exception
|
||||
@export([u'英式发音', u'British pronounciation'])
|
||||
@export('BRE_PRON')
|
||||
def fld_mp3_uk(self):
|
||||
seg = self._get_field('baesInfo')
|
||||
audio_url, t = seg['symbols'][0]['ph_en_mp3'], 'en'
|
||||
|
||||
@ -45,7 +45,7 @@ class MiniDict(WebService):
|
||||
|
||||
return self.cache_this(result)
|
||||
|
||||
@export([u'音标', u'Phonetic symbols'])
|
||||
@export('PHON')
|
||||
def fld_phonetic(self):
|
||||
return self._get_field('phonetic')
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class Youdao(WebService):
|
||||
pass
|
||||
return self.cache_this(result)
|
||||
|
||||
@export([u'音标', u'Phonetic symbols'])
|
||||
@export('PHON')
|
||||
def fld_phonetic(self):
|
||||
return self._get_field('phonetic')
|
||||
|
||||
@ -93,7 +93,7 @@ class Youdao(WebService):
|
||||
except:
|
||||
return ''
|
||||
|
||||
@export([u'英式发音', u'British pronounciation'])
|
||||
@export('BRE_PRON')
|
||||
def fld_british_audio(self):
|
||||
audio_url = u'http://dict.youdao.com/dictvoice?audio={}&type=1'.format(self.quote_word)
|
||||
if youdao_download_mp3:
|
||||
@ -102,7 +102,7 @@ class Youdao(WebService):
|
||||
return self.get_anki_label(filename, 'audio')
|
||||
return audio_url
|
||||
|
||||
@export([u'美式发音', u'Americation pronounciation'])
|
||||
@export('AME_PRON')
|
||||
def fld_american_audio(self):
|
||||
audio_url = u'http://dict.youdao.com/dictvoice?audio={}&type=2'.format(self.quote_word)
|
||||
if youdao_download_mp3:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user