Completed
Push — master ( 487942...c6813c )
by dotzero
01:54
created

TildaProject.__repr__()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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