File: constants.py

package info (click to toggle)
termsaver 0.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 284 kB
  • sloc: python: 1,446; makefile: 4
file content (109 lines) | stat: -rw-r--r-- 3,332 bytes parent folder | download
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
###############################################################################
#
# file:     constants.py
#
# Purpose:  refer to module documentation for details
#
# Note:     This file is part of Termsaver application, and should not be used
#           or executed separately.
#
###############################################################################
#
# Copyright 2012 Termsaver
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
###############################################################################
"""
Holds constant values used throughout termsaver application.
"""


class PropertyClass:
    """
    A base class that defines a class as a holder for properties only, not to
    be instantiated in any circumstances.
    """

    def __init__(self):
        """
        This class (and sub-classes) should not be instantiated.
        """
        raise NotImplementedError("This class cannot be instantiated!")


class App(PropertyClass):
    """
    Holds application related properties used by termsaver screens.
    Refer to each of the available properties for detailed documentation.
    """

    VERSION = "0.1.1"
    """
    Defines the version of termsaver application. This is accessed during
    install process, and to any help and usage messages informed by it.

    Refer to CHANGELOG file for a complete history about this project.
    """

    NAME = 'termsaver'
    """
    Defines the termsaver application, as it is executed from command-line.
    """

    TITLE = 'TermSaver'
    """
    Defines the termsaver application's official name as it should appear
    in documentation.
    """

    DESCRIPTION = 'A simple text-based terminal screensaver'
    """
    Defines the main description of the termsaver application.
    """

    URL = 'http://termsaver.info'
    """
    Defines the termsaver official website address.
    """

    SOURCE_URL = 'http://github.com/brunobraga/termsaver'
    """
    Defines the termsaver official source-code control site, hosted on GitHub.
    """

    AUTHORS = ['Bruno Braga <bruno.braga@gmail.com>']
    """
    Defines a list of all authors contributing to the termsaver application.
    """


class Settings(PropertyClass):
    """
    Holds configuration settings used by termsaver application. Refer to each
    of the available properties for detailed documentation.
    """

    CHAR_DELAY_SECONDS = 0.003
    """
    Defines basically the speed in which the text will be displayed, character
    by character, giving a cool impression of an automated type writing machine
    Default value is 0.003 seconds (3 milliseconds). It is advised to use
    values between 0.01 and 0.001.
    """

    FETCH_INTERVAL_SECONDS = 3600
    """
    Defines the interval between each fetching of data over the Internet.
    Default value is 1 hour.
    """