Skip to content

Commit

Permalink
Added a placeholder class.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernardo-MG committed Oct 23, 2016
1 parent b4b8047 commit 110e005
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion {{cookiecutter.package_name}}/docs/source/reports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ Report Description
============ ===

.. _Coveralls: https://coveralls.io/github/{{ cookiecutter.github_username }}/{{ cookiecutter.package_name }}
.. _Landscape: https://landscape.io/github/{{ cookiecutter.github_username }}/{{ cookiecutter.package_name }}/master
.. _Landscape: https://landscape.io/github/{{ cookiecutter.github_username }}/{{ cookiecutter.package_name }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# -*- coding: utf-8 -*-

from abc import ABCMeta, abstractmethod

"""
Placeholder classes.
Replace this module for the actual code.
"""

__author__ = '{{ cookiecutter.developer_name }}'
__license__ = 'MIT'


class AbstractPlaceholder(object):
"""
Placeholde for an abstract class.
"""
__metaclass__ = ABCMeta

def __init__(self):
pass

@abstractmethod
def method(self):
"""
An abstract method.
"""
raise NotImplementedError('The roll method must be implemented')


class Placeholder(AbstractPlaceholder):
"""
An extension of the abstract placeholder.
"""

def __init__(self, data):
super(Placeholder, self).__init__()
self._field = data

def __str__(self):
return '%s' % self.field

def __repr__(self):
return '<class %s>(field=%r)' % \
(self.__class__.__name__, self.field)

@property
def field(self):
"""
A field in the placeholder class.
:return: the field content
"""
return self._field

@field.setter
def field(self, field):
self._field = field

def method(self):
pass

0 comments on commit 110e005

Please sign in to comment.