Mercurial > piecrust2
comparison piecrust/importing/base.py @ 63:28958565a17b
In-place upgrade for PieCrust 1 sites.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 28 Aug 2014 16:48:31 -0700 |
parents | 52e4d9a1f917 |
children | 2823ea40cfac |
comparison
equal
deleted
inserted
replaced
62:52e4d9a1f917 | 63:28958565a17b |
---|---|
10 | 10 |
11 class Importer(object): | 11 class Importer(object): |
12 def __init__(self): | 12 def __init__(self): |
13 self.name = None | 13 self.name = None |
14 self.description = None | 14 self.description = None |
15 self.requires_website = True | |
15 | 16 |
16 def setupParser(self, parser, app): | 17 def setupParser(self, parser, app): |
17 raise NotImplementedError() | 18 raise NotImplementedError() |
18 | 19 |
19 def importWebsite(self, app, args): | 20 def importWebsite(self, app, args): |
20 raise NotImplementedError() | 21 raise NotImplementedError() |
21 | 22 |
22 def checkedImportWebsite(self, ctx): | 23 def checkedImportWebsite(self, ctx): |
23 if ctx.app.root_dir is None: | 24 if ctx.app.root_dir is None and self.requires_website: |
24 raise SiteNotFoundError() | 25 raise SiteNotFoundError() |
25 self.importWebsite(ctx.app, ctx.args) | 26 self.importWebsite(ctx.app, ctx.args) |
26 return 0 | 27 return 0 |
27 | 28 |
28 | 29 |