1
|
|
|
# -*- coding: utf-8 -*- |
2
|
|
|
# |
3
|
|
|
# Copyright (c) 2016 dotzero <[email protected]> |
4
|
|
|
# |
5
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy |
6
|
|
|
# of this software and associated documentation files (the "Software"), to deal |
7
|
|
|
# in the Software without restriction, including without limitation the rights |
8
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
9
|
|
|
# copies of the Software, and to permit persons to whom the Software is |
10
|
|
|
# furnished to do so, subject to the following conditions: |
11
|
|
|
# |
12
|
|
|
# The above copyright notice and this permission notice shall be included |
13
|
|
|
# in all copies or substantial portions of the Software. |
14
|
|
|
# |
15
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
16
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
17
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
18
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
19
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
20
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
21
|
|
|
# SOFTWARE. |
22
|
|
|
|
23
|
1 |
|
from tilda.base import TildaBase |
24
|
|
|
|
25
|
|
|
|
26
|
1 |
|
class TildaProject(TildaBase): |
27
|
1 |
|
def __init__(self, *args, **kwargs): |
28
|
|
|
# Basic fields |
29
|
1 |
|
self.id = int(kwargs.get('id', 0)) |
30
|
1 |
|
self.title = kwargs.get('title', '') |
31
|
1 |
|
self.descr = kwargs.get('descr', '') |
32
|
1 |
|
self.customdomain = kwargs.get('customdomain', '') |
33
|
1 |
|
self.css = kwargs.get('css', list()) |
34
|
1 |
|
self.js = kwargs.get('js', list()) |
35
|
|
|
# Export fields |
36
|
1 |
|
self.export_csspath = kwargs.get('export_csspath', '') |
37
|
1 |
|
self.export_jspath = kwargs.get('export_jspath', '') |
38
|
1 |
|
self.export_imgpath = kwargs.get('export_imgpath', '') |
39
|
1 |
|
self.indexpageid = int(kwargs.get('indexpageid', 0)) |
40
|
1 |
|
self.images = kwargs.get('images', list()) |
41
|
1 |
|
self.htaccess = kwargs.get('htaccess', '') |
42
|
|
|
|
43
|
1 |
|
def __str__(self): |
44
|
1 |
|
return '(%d) %s' % (self.id, self.title) |
45
|
|
|
|
46
|
1 |
|
def __repr__(self): |
47
|
|
|
return '%s(%r)' % (self.__class__, self.__dict__) |
48
|
|
|
|