Merge pull request #57 from Clement-Jean/master

Use of export in lang.py
This commit is contained in:
sthoo 2018-09-18 14:53:15 +08:00 committed by GitHub
commit 82fe251d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 21 additions and 22 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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