rescalante-lilly / ruffus

Automatically exported from code.google.com/p/ruffus
MIT License
0 stars 0 forks source link

Code template does not run #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There is a problem with the code_template (both the version included with the 
source, and the version displayed on the website).

1.  The template download link is broken: 
http://ruffus.org.uk/_downloads/ruffus_template.py

2. The template included with the src (and presented for Display on the ruffus 
website) does not run.  This error is thrown:

Traceback (most recent call last):
  File "ruffus_template.py", line 210, in <module>
    logger = logging.getLogger(module_name)
NameError: name 'module_name' is not defined

It is not clear what 'module_name' should be set to, or where.

Please advice.

Thanks-
John

Original issue reported on code.google.com by john.ma...@locusdev.net on 23 Jan 2012 at 7:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The code template has been replaced by functionality from the ruffus.cmdline 
module.
This provides a wrapper around the standard python argparse and the deprecated 
2.6 optparse.

The following 5 lines of code allow your script to support the usual set of 
Ruffus functionality, including printing out the pipeline status in text or 
graphical format, running parts or the entirety of the pipeline, using a named 
rather than the default automatic history file, etc.

    from ruffus import *

    parser = cmdline.get_argparse(description='WHAT DOES THIS PIPELINE DO?')

    #   <<<---- add your own command line options like --input_file here
    #parser.add_argument("--input_file")

    options = parser.parse_args()

    #  logger which can be passed to multiprocessing ruffus tasks
    logger, logger_mutex = cmdline.setup_logging (__name__, options.log_file, options.verbose)

    #   <<<----  pipelined functions go here

    cmdline.run (options)

Provides these predefined options:

        --verbose
        --version
        --log_file

    -T, --target_tasks
    -j, --jobs
    -n, --just_print
        --flowchart
        --key_legend_in_graph
        --draw_graph_horizontally
        --flowchart_format
        --forced_tasks
        --touch_files_only
        --checksum_file_name
        --recreate_database

Original comment by bunbu...@gmail.com on 16 Dec 2013 at 7:35