
import argparse
import logging          # Import standard logging - for levels only

from python_cowbull_server.Configurator import Configurator
from flask import Flask

#
# Step 1 - Check any command line arguments passed
#
parser = argparse.ArgumentParser()
parser.add_argument('--env',
                    dest='showenvvars',
                    default=False,
                    action='store_true',
                    help="Show the environment variables that can be set by this app")

args = parser.parse_args()

# Instantiate the Flask application as app
app = Flask(__name__)
c = Configurator()

# Decide if using ANSI or GUI
if args.showenvvars:
    print('')
    print('The following environment variables may be set to dynamically')
    print('configure the server. Alternately, these can be defined in a ')
    print('file and passed using the env. var. COWBULL_CONFIG.')
    print('')
    print('Please note. Env. Vars can be *ALL* lowercase or *ALL* uppercase.')
    print('')
    for name, desc in c.get_variables():
        print(name, '-->', desc)
    print('')
    exit(0)

c.execute_load(app)

error_handler = c.error_handler
error_handler.log(
    method="__init__",
    module="python_cowbull_server",
    message="Initialization complete.",
    logger=logging.info
)

import logging          # Import standard logging - for levels only

from python_cowbull_server.Configurator import Configurator
from flask import Flask

# Instantiate the Flask application as app
app = Flask(__name__)
c = Configurator()

print('')
print('-'*80)
print('The following environment variables may be set to dynamically')
print('configure the server. Alternately, these can be defined in a ')
print('file and passed using the env. var. COWBULL_CONFIG.')
print('')
print('Please note. Env. Vars can be *ALL* lowercase or *ALL* uppercase.')
print('-'*80)
print('')
for name, desc in c.get_variables():
    print(name, '-->', desc)
print('-'*80)
print('')

c.execute_load(app)

error_handler = c.error_handler
error_handler.log(
    method="__init__",
    module="python_cowbull_server",
    message="Initialization complete.",
    logger=logging.info
)
Remove parameter support (due to unittest module) and modify to print parameters on each run.
Remove parameter support (due to unittest module) and modify to print parameters on each run.

  
- import argparse
  import logging          # Import standard logging - for levels only
  
  from python_cowbull_server.Configurator import Configurator
  from flask import Flask
  
- #
- # Step 1 - Check any command line arguments passed
- #
- parser = argparse.ArgumentParser()
- parser.add_argument('--env',
-                     dest='showenvvars',
-                     default=False,
-                     action='store_true',
-                     help="Show the environment variables that can be set by this app")
- 
- args = parser.parse_args()
- 
  # Instantiate the Flask application as app
  app = Flask(__name__)
  c = Configurator()
  
- # Decide if using ANSI or GUI
- if args.showenvvars:
-     print('')
+ print('')
+ print('-'*80)
-     print('The following environment variables may be set to dynamically')
+ print('The following environment variables may be set to dynamically')
-     print('configure the server. Alternately, these can be defined in a ')
+ print('configure the server. Alternately, these can be defined in a ')
-     print('file and passed using the env. var. COWBULL_CONFIG.')
+ print('file and passed using the env. var. COWBULL_CONFIG.')
-     print('')
+ print('')
-     print('Please note. Env. Vars can be *ALL* lowercase or *ALL* uppercase.')
+ print('Please note. Env. Vars can be *ALL* lowercase or *ALL* uppercase.')
+ print('-'*80)
-     print('')
+ print('')
-     for name, desc in c.get_variables():
+ for name, desc in c.get_variables():
-         print(name, '-->', desc)
+     print(name, '-->', desc)
+ print('-'*80)
-     print('')
+ print('')
-     exit(0)
  
  c.execute_load(app)
  
  error_handler = c.error_handler
  error_handler.log(
      method="__init__",
      module="python_cowbull_server",
      message="Initialization complete.",
      logger=logging.info
  )
Remove parameter support (due to unittest module) and modify to print parameters on each run.
## Code Before:

import argparse
import logging          # Import standard logging - for levels only

from python_cowbull_server.Configurator import Configurator
from flask import Flask

#
# Step 1 - Check any command line arguments passed
#
parser = argparse.ArgumentParser()
parser.add_argument('--env',
                    dest='showenvvars',
                    default=False,
                    action='store_true',
                    help="Show the environment variables that can be set by this app")

args = parser.parse_args()

# Instantiate the Flask application as app
app = Flask(__name__)
c = Configurator()

# Decide if using ANSI or GUI
if args.showenvvars:
    print('')
    print('The following environment variables may be set to dynamically')
    print('configure the server. Alternately, these can be defined in a ')
    print('file and passed using the env. var. COWBULL_CONFIG.')
    print('')
    print('Please note. Env. Vars can be *ALL* lowercase or *ALL* uppercase.')
    print('')
    for name, desc in c.get_variables():
        print(name, '-->', desc)
    print('')
    exit(0)

c.execute_load(app)

error_handler = c.error_handler
error_handler.log(
    method="__init__",
    module="python_cowbull_server",
    message="Initialization complete.",
    logger=logging.info
)
## Instruction:
Remove parameter support (due to unittest module) and modify to print parameters on each run.
## Code After:

import logging          # Import standard logging - for levels only

from python_cowbull_server.Configurator import Configurator
from flask import Flask

# Instantiate the Flask application as app
app = Flask(__name__)
c = Configurator()

print('')
print('-'*80)
print('The following environment variables may be set to dynamically')
print('configure the server. Alternately, these can be defined in a ')
print('file and passed using the env. var. COWBULL_CONFIG.')
print('')
print('Please note. Env. Vars can be *ALL* lowercase or *ALL* uppercase.')
print('-'*80)
print('')
for name, desc in c.get_variables():
    print(name, '-->', desc)
print('-'*80)
print('')

c.execute_load(app)

error_handler = c.error_handler
error_handler.log(
    method="__init__",
    module="python_cowbull_server",
    message="Initialization complete.",
    logger=logging.info
)