
import api as bake
import sys

# This 
def main(args=sys.argv[1:]):
  # Set up command line argument options
  optparser = bake.make_optparser()
  options, arguments = optparser.parse_args()

  bake.process_options(options)

  ## Configuration is stored in the bake.cfg file in the current directory
  config = bake.load_config()

  ## End processing of command line parameters
  ## Prepare for big loop

  # The overwrite command pushes lines onto the top of the bake parameter file
  if options.overwrite:
    lines = options.overwrite
  else:
    lines = []

  # Load bake parameter file
  hin = open(options.file,'r')
  lines += hin.readlines()
  hin.close()

  # This mixIterator object is kind of the core of bake.
  (label, tokens, 
   mixIterator) = bake.make_iterator(config['label']['label_tag'],
                                     config['label']['pattern'], 
                                     lines, options.slice_start, 
                                     options.slice_end)
   
  ## This is the main loop, iterating over each set of values
  bake.default_loop(label, tokens, mixIterator, config, options)

if __name__ == '__main__':
  main()


import api as bake
import sys


def main(args=sys.argv[1:]):
  # Set up command line argument options
  optparser = bake.make_optparser()
  options, arguments = optparser.parse_args()

  bake.process_options(options)

  ## Configuration is stored in the bake.cfg file in the current directory
  config = bake.load_config()

  ## End processing of command line parameters
  ## Prepare for big loop

  # The overwrite command pushes lines onto the top of the bake parameter file
  if options.overwrite:
    lines = options.overwrite
  else:
    lines = []

  # Load bake parameter file
  hin = open(options.file, 'r')
  lines += hin.readlines()
  hin.close()

  # This mixIterator object is kind of the core of bake.
  (label, tokens,
   mixIterator) = bake.make_iterator(config['label']['label_tag'],
                                     config['label']['pattern'],
                                     lines, options.slice_start,
                                     options.slice_end)

  ## This is the main loop, iterating over each set of values
  bake.default_loop(label, tokens, mixIterator, config, options)

if __name__ == '__main__':
  main()

Make pep8 run mostly cleanly
Make pep8 run mostly cleanly

  
  import api as bake
  import sys
  
- # This 
+ 
  def main(args=sys.argv[1:]):
    # Set up command line argument options
    optparser = bake.make_optparser()
    options, arguments = optparser.parse_args()
  
    bake.process_options(options)
  
    ## Configuration is stored in the bake.cfg file in the current directory
    config = bake.load_config()
  
    ## End processing of command line parameters
    ## Prepare for big loop
  
    # The overwrite command pushes lines onto the top of the bake parameter file
    if options.overwrite:
      lines = options.overwrite
    else:
      lines = []
  
    # Load bake parameter file
-   hin = open(options.file,'r')
+   hin = open(options.file, 'r')
    lines += hin.readlines()
    hin.close()
  
    # This mixIterator object is kind of the core of bake.
-   (label, tokens, 
+   (label, tokens,
     mixIterator) = bake.make_iterator(config['label']['label_tag'],
-                                      config['label']['pattern'], 
+                                      config['label']['pattern'],
-                                      lines, options.slice_start, 
+                                      lines, options.slice_start,
                                       options.slice_end)
-    
+ 
    ## This is the main loop, iterating over each set of values
    bake.default_loop(label, tokens, mixIterator, config, options)
  
  if __name__ == '__main__':
    main()
  
Make pep8 run mostly cleanly
## Code Before:

import api as bake
import sys

# This 
def main(args=sys.argv[1:]):
  # Set up command line argument options
  optparser = bake.make_optparser()
  options, arguments = optparser.parse_args()

  bake.process_options(options)

  ## Configuration is stored in the bake.cfg file in the current directory
  config = bake.load_config()

  ## End processing of command line parameters
  ## Prepare for big loop

  # The overwrite command pushes lines onto the top of the bake parameter file
  if options.overwrite:
    lines = options.overwrite
  else:
    lines = []

  # Load bake parameter file
  hin = open(options.file,'r')
  lines += hin.readlines()
  hin.close()

  # This mixIterator object is kind of the core of bake.
  (label, tokens, 
   mixIterator) = bake.make_iterator(config['label']['label_tag'],
                                     config['label']['pattern'], 
                                     lines, options.slice_start, 
                                     options.slice_end)
   
  ## This is the main loop, iterating over each set of values
  bake.default_loop(label, tokens, mixIterator, config, options)

if __name__ == '__main__':
  main()

## Instruction:
Make pep8 run mostly cleanly
## Code After:

import api as bake
import sys


def main(args=sys.argv[1:]):
  # Set up command line argument options
  optparser = bake.make_optparser()
  options, arguments = optparser.parse_args()

  bake.process_options(options)

  ## Configuration is stored in the bake.cfg file in the current directory
  config = bake.load_config()

  ## End processing of command line parameters
  ## Prepare for big loop

  # The overwrite command pushes lines onto the top of the bake parameter file
  if options.overwrite:
    lines = options.overwrite
  else:
    lines = []

  # Load bake parameter file
  hin = open(options.file, 'r')
  lines += hin.readlines()
  hin.close()

  # This mixIterator object is kind of the core of bake.
  (label, tokens,
   mixIterator) = bake.make_iterator(config['label']['label_tag'],
                                     config['label']['pattern'],
                                     lines, options.slice_start,
                                     options.slice_end)

  ## This is the main loop, iterating over each set of values
  bake.default_loop(label, tokens, mixIterator, config, options)

if __name__ == '__main__':
  main()
