Merge pull request #8 from ChrisTruncer/datatype_

Added datatype module template
resolved_file
ChrisTruncer 2014-12-27 07:53:37 -05:00
commit 818b281fd1
2 changed files with 37 additions and 0 deletions

View File

@ -1,3 +1,6 @@
[12.27.2014]
Added...: Datatype module template has been added to the framework for creating datatype modules.
[12.26.2014]
Added...: Client module template has been added to the framework for creating client modules.

View File

@ -0,0 +1,34 @@
'''
A brief description can be placed up in this comment section.
This is the template that can be used for datatype modules.
All imports should go between this comments section and the
class declaration.
Finally, the module should be renamed to a .py file
'''
class Datatype:
# self.cli, self.description, and self.filetype are required attributes.
# self.cli is what is listed (along with self.description) when running
# --list-datatypes. self.cli is also used in conjunction with --datatype
# to specify the datatype. self.description is just a description of the
# data being generated. self.filetype should be set to text if it is a text
# data being generated (vs. binary).
# The __init__ has full access to all command line parameters passed
# in at runtime.
def __init__(self, cli_object):
self.cli = ""
self.description = ""
self.filetype = "text"
# generate is a required function. This is what is called by the framework
# to generate the data. Any number of "sub functions" can be created, but
# generate should be considered the "main" function. generate must return
# the generated data.
def generate_data(self):
return data