Rename filenames in boilerplate
This commit is contained in:
parent
0b08f614a1
commit
0b58c9a26b
3 changed files with 2 additions and 2 deletions
|
|
@ -193,7 +193,7 @@ class CapRecipe(Recipe):
|
|||
self.methods_code = self.methods_code(cap)
|
||||
|
||||
self.write('__init__.py', self.template('init'))
|
||||
self.write('module.py', self.template('cap_backend'))
|
||||
self.write('module.py', self.template('cap_module'))
|
||||
self.write('browser.py', self.template('base_browser'))
|
||||
self.write('pages.py', self.template('base_pages'))
|
||||
self.write('test.py', self.template('base_test'))
|
||||
|
|
@ -204,7 +204,7 @@ class ComicRecipe(Recipe):
|
|||
|
||||
def generate(self):
|
||||
self.write('__init__.py', self.template('init'))
|
||||
self.write('module.py', self.template('comic_backend'))
|
||||
self.write('module.py', self.template('comic_module'))
|
||||
|
||||
|
||||
class ComicTestRecipe(Recipe):
|
||||
|
|
|
|||
21
tools/boilerplate_data/cap_module.py
Normal file
21
tools/boilerplate_data/cap_module.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<%inherit file="layout.py"/>
|
||||
from weboob.tools.backend import Module
|
||||
from ${r.capmodulename} import ${r.capname}
|
||||
|
||||
from .browser import ${r.classname}Browser
|
||||
|
||||
|
||||
__all__ = ['${r.classname}Module']
|
||||
|
||||
|
||||
class ${r.classname}Module(Module, ${r.capname}):
|
||||
NAME = '${r.name}'
|
||||
DESCRIPTION = u'${r.name} website'
|
||||
MAINTAINER = u'${r.author}'
|
||||
EMAIL = '${r.email}'
|
||||
LICENSE = 'AGPLv3+'
|
||||
VERSION = '${r.version}'
|
||||
|
||||
BROWSER = ${r.classname}Browser
|
||||
|
||||
${r.methods_code}
|
||||
23
tools/boilerplate_data/comic_module.py
Normal file
23
tools/boilerplate_data/comic_module.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<%inherit file="layout.py"/>
|
||||
from weboob.tools.capabilities.gallery.genericcomicreader import GenericComicReaderModule, DisplayPage
|
||||
|
||||
|
||||
__all__ = ['${r.classname}Module']
|
||||
|
||||
|
||||
class ${r.classname}Module(GenericComicReaderModule):
|
||||
NAME = '${r.name}'
|
||||
DESCRIPTION = u'${r.name} manga reading site'
|
||||
MAINTAINER = u'${r.author}'
|
||||
EMAIL = '${r.email}'
|
||||
VERSION = '${r.version}'
|
||||
LICENSE = 'AGPLv3+'
|
||||
|
||||
DOMAIN = 'www.${r.name}.com'
|
||||
BROWSER_PARAMS = dict(
|
||||
img_src_xpath="//img[@id='comic_page']/@src",
|
||||
page_list_xpath="(//select[@id='page_select'])[1]/option/@value")
|
||||
ID_REGEXP = r'[^/]+/[^/]+'
|
||||
URL_REGEXP = r'.+${r.name}.com/(%s).+' % ID_REGEXP
|
||||
ID_TO_URL = 'http://www.${r.name}.com/%s'
|
||||
PAGES = {URL_REGEXP: DisplayPage}
|
||||
Loading…
Reference in a new issue