From: allfro Date: Wed, 10 Oct 2012 16:06:57 +0000 (-0400) Subject: updated templates X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=3b2e6c2077038e96d236b231772ee1ce752ee501;p=get-hack-src.git updated templates --- diff --git a/src/canari/resources/template/README.plate b/src/canari/resources/template/README.plate index c5e30f4..09bfa3b 100644 --- a/src/canari/resources/template/README.plate +++ b/src/canari/resources/template/README.plate @@ -1,28 +1,28 @@ # README - ${project} Welcome to Canari. You might be wondering what all these files are about. Before you can use the power of -```mtginstall``` you needed to create a transform package and that's exactly what you did here! I've given you a +`canari install-package` you needed to create a transform package and that's exactly what you did here! I've given you a directory structure to use in the following manner: -* ```src/${package}``` directory is where all your stuff goes in terms of auxiliary modules that you may need for your +* `src/${package}` directory is where all your stuff goes in terms of auxiliary modules that you may need for your modules -* ```src/${package}/transforms``` directory is where all your transform modules should be placed. An example - ```helloworld``` transform is there for your viewing pleasure. -* ```src/${package}/transforms/common``` directory is where you can put some common code for your transforms like result +* `src/${package}/transforms` directory is where all your transform modules should be placed. An example + `helloworld` transform is there for your viewing pleasure. +* `src/${package}/transforms/common` directory is where you can put some common code for your transforms like result parsing, entities, etc. -* ```src/${package}/transforms/common/entities.py``` is where you define your custom entities. Take a look at the +* `src/${package}/transforms/common/entities.py` is where you define your custom entities. Take a look at the examples provided if you want to play around with custom entities. -* ```maltego/``` is where you can store your Maltego entity exports. +* `maltego/` is where you can store your Maltego entity exports. -If you're going to add a new transform in the transforms directory, remember to update the ```__all__``` variable in -```src/${package}/transforms/__init__.py```. Otherwise, ```mtginstall``` won't attempt to install the transform. -Alternatively, ```mtgtransgen ``` can be used within the ```src/${package}/transforms``` directory to -generate a transform module and have it automatically added to the ```__init__.py``` file, like so: +If you're going to add a new transform in the transforms directory, remember to update the `__all__` variable in +`src/${package}/transforms/__init__.py`. Otherwise, `canari install-package` won't attempt to install the transform. +Alternatively, `canari create-transform ` can be used within the `src/${package}/transforms` directory +to generate a transform module and have it automatically added to the `__init__.py` file, like so: -To test your transform, simply ```cd``` into the src directory and run ```mtgdebug```, like so: +To test your transform, simply `cd` into the src directory and run `canari debug-transform`, like so: ```bash -$$ mtgdebug ${project}.transforms.helloworld Phil +$$ canari debug-transform ${project}.transforms.helloworld Phil %50 D:This was pointless! %100 diff --git a/src/canari/resources/template/__init__.plate b/src/canari/resources/template/__init__.plate index df8dab5..bf37bab 100644 --- a/src/canari/resources/template/__init__.plate +++ b/src/canari/resources/template/__init__.plate @@ -7,5 +7,5 @@ __credits__ = [] __license__ = 'GPL' __version__ = '0.1' __maintainer__ = '${author}' -__email__ = 'whereim@onthe.net' +__email__ = '${email}' __status__ = 'Development' \ No newline at end of file diff --git a/src/canari/resources/template/_canari.plate b/src/canari/resources/template/_canari.plate new file mode 100644 index 0000000..1dfb67d --- /dev/null +++ b/src/canari/resources/template/_canari.plate @@ -0,0 +1,6 @@ +[metadata] + +author = ${author} +project = ${project} +maintainer = ${maintainer} +email = ${email} diff --git a/src/canari/resources/template/entities.plate b/src/canari/resources/template/entities.plate index c863431..c41b2e8 100644 --- a/src/canari/resources/template/entities.plate +++ b/src/canari/resources/template/entities.plate @@ -9,7 +9,7 @@ __credits__ = [] __license__ = 'GPL' __version__ = '0.1' __maintainer__ = '${author}' -__email__ = 'whereim@inthe.net' +__email__ = '${email}' __status__ = 'Development' __all__ = [ diff --git a/src/canari/resources/template/newtransform.plate b/src/canari/resources/template/newtransform.plate index 0ba5919..aa3d7e7 100644 --- a/src/canari/resources/template/newtransform.plate +++ b/src/canari/resources/template/newtransform.plate @@ -4,13 +4,13 @@ from canari.maltego.utils import debug, progress from canari.framework import configure #, superuser __author__ = '${author}' -__copyright__ = 'Copyright ${year}, Project' +__copyright__ = 'Copyright ${year}, ${project} Project' __credits__ = [] __license__ = 'GPL' __version__ = '0.1' -__maintainer__ = '${author}' -__email__ = 'whereim@onthe.net' +__maintainer__ = '${maintainer}' +__email__ = '${email}' __status__ = 'Development' __all__ = [ @@ -18,11 +18,12 @@ __all__ = [ 'onterminate' ] -# Uncomment the line below if the transform needs to run as super-user -#@superuser + """ TODO: set the appropriate configuration parameters for your transform. +TODO: Uncomment the line below if the transform needs to run as super-user """ +#@superuser @configure( label='TODO: To Something [Hello World]', description='TODO: Returns a Something entity with the phrase "Hello Word!"', diff --git a/src/canari/resources/template/setup.plate b/src/canari/resources/template/setup.plate index 0660f34..f8e35cf 100755 --- a/src/canari/resources/template/setup.plate +++ b/src/canari/resources/template/setup.plate @@ -4,8 +4,8 @@ setup( name='${package}', author='${author}', version='1.0', - author_email='whereim@onthe.net', - description='Your description here', + author_email='${email}', + description='${description}', license='GPL', packages=find_packages('src'), package_dir={ '' : 'src' }, diff --git a/src/canari/resources/template/transform.plate b/src/canari/resources/template/transform.plate index 0cdc194..553a407 100644 --- a/src/canari/resources/template/transform.plate +++ b/src/canari/resources/template/transform.plate @@ -12,7 +12,7 @@ __credits__ = [] __license__ = 'GPL' __version__ = '0.1' __maintainer__ = '${author}' -__email__ = 'whereim@onthe.net' +__email__ = '${email}' __status__ = 'Development' __all__ = [