File: class.py

package info (click to toggle)
grantlee5 5.3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,004 kB
  • sloc: cpp: 25,617; javascript: 6,043; python: 299; sh: 97; perl: 37; ruby: 24; makefile: 17
file content (34 lines) | stat: -rw-r--r-- 832 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /usr/bin/env python
# -*- coding: utf-8 -*-

{% include licence|append:".py" %}
{% if baseClass %}

from PyQt4.{{ baseClass.module }} import {{ baseClass.type }}
{% endif %}

class {{ className }}({% if baseClass %}{{ baseClass.type }}{% else %}object{% endif %}):

    def __init__(self):
{% if baseClass %}
        {{ baseClass.type }}.__init__(self)
{% endif %}
        pass

{% for property in properties %}
    def {{ property.name }}(self):
        return self._{{ property.name }}
  {% if not property.readonly %}

    def {{ property.name|to_write }}(self, {{ property.name }}):
        self._{{ property.name }} = {{ property.name }}
  {% endif %}

{% endfor %}
{% with "true" as default %}
  {% for method in methods %}
    def {{ method.name }}(self{% include "args.py" %}):
        pass

  {% endfor %}
{% endwith %}