
from os import environ
from flask import Flask
from flask.ext.mail import Mail
from flask.ext.assets import Environment, Bundle
from coaster import configureapp

# First, make an app and config it

app = Flask(__name__, instance_relative_config=True)
configureapp(app, 'HASJOB_ENV')
mail = Mail()
mail.init_app(app)
assets = Environment(app)
from uploads import configure
from search import configure
uploads.configure()
search.configure()
# Second, setup assets

assets = Environment(app)

js = Bundle('js/libs/jquery-1.5.1.min.js',
            'js/libs/jquery.textarea-expander.js',
            'js/libs/tiny_mce/jquery.tinymce.js',
            'js/libs/jquery.form.js',
            'js/scripts.js',
            filters='jsmin', output='js/packed.js')

assets.register('js_all', js)

# Third, after config, import the models and views

import hasjob.models
import hasjob.views
from uploads import configure
from search import configure
uploads.configure()
search.configure()
if environ.get('HASJOB_ENV') == 'prod':
    import hasjob.loghandler


from os import environ
from flask import Flask
from flask.ext.mail import Mail
from flask.ext.assets import Environment, Bundle
from coaster import configureapp

# First, make an app and config it

app = Flask(__name__, instance_relative_config=True)
configureapp(app, 'HASJOB_ENV')
mail = Mail()
mail.init_app(app)
assets = Environment(app)
# Imported here to prevent circular imports
from uploads import configure
from search import configure
uploads.configure()
search.configure()
# Second, setup assets

assets = Environment(app)

js = Bundle('js/libs/jquery-1.5.1.min.js',
            'js/libs/jquery.textarea-expander.js',
            'js/libs/tiny_mce/jquery.tinymce.js',
            'js/libs/jquery.form.js',
            'js/scripts.js',
            filters='jsmin', output='js/packed.js')

assets.register('js_all', js)

# Third, after config, import the models and views

import hasjob.models
import hasjob.views
if environ.get('HASJOB_ENV') == 'prod':
    import hasjob.loghandler

Remove duplicate code, leave comment about circular imports
Remove duplicate code, leave comment about circular imports

  
  from os import environ
  from flask import Flask
  from flask.ext.mail import Mail
  from flask.ext.assets import Environment, Bundle
  from coaster import configureapp
  
  # First, make an app and config it
  
  app = Flask(__name__, instance_relative_config=True)
  configureapp(app, 'HASJOB_ENV')
  mail = Mail()
  mail.init_app(app)
  assets = Environment(app)
+ # Imported here to prevent circular imports
  from uploads import configure
  from search import configure
  uploads.configure()
  search.configure()
  # Second, setup assets
  
  assets = Environment(app)
  
  js = Bundle('js/libs/jquery-1.5.1.min.js',
              'js/libs/jquery.textarea-expander.js',
              'js/libs/tiny_mce/jquery.tinymce.js',
              'js/libs/jquery.form.js',
              'js/scripts.js',
              filters='jsmin', output='js/packed.js')
  
  assets.register('js_all', js)
  
  # Third, after config, import the models and views
  
  import hasjob.models
  import hasjob.views
- from uploads import configure
- from search import configure
- uploads.configure()
- search.configure()
  if environ.get('HASJOB_ENV') == 'prod':
      import hasjob.loghandler
  
Remove duplicate code, leave comment about circular imports
## Code Before:

from os import environ
from flask import Flask
from flask.ext.mail import Mail
from flask.ext.assets import Environment, Bundle
from coaster import configureapp

# First, make an app and config it

app = Flask(__name__, instance_relative_config=True)
configureapp(app, 'HASJOB_ENV')
mail = Mail()
mail.init_app(app)
assets = Environment(app)
from uploads import configure
from search import configure
uploads.configure()
search.configure()
# Second, setup assets

assets = Environment(app)

js = Bundle('js/libs/jquery-1.5.1.min.js',
            'js/libs/jquery.textarea-expander.js',
            'js/libs/tiny_mce/jquery.tinymce.js',
            'js/libs/jquery.form.js',
            'js/scripts.js',
            filters='jsmin', output='js/packed.js')

assets.register('js_all', js)

# Third, after config, import the models and views

import hasjob.models
import hasjob.views
from uploads import configure
from search import configure
uploads.configure()
search.configure()
if environ.get('HASJOB_ENV') == 'prod':
    import hasjob.loghandler

## Instruction:
Remove duplicate code, leave comment about circular imports
## Code After:

from os import environ
from flask import Flask
from flask.ext.mail import Mail
from flask.ext.assets import Environment, Bundle
from coaster import configureapp

# First, make an app and config it

app = Flask(__name__, instance_relative_config=True)
configureapp(app, 'HASJOB_ENV')
mail = Mail()
mail.init_app(app)
assets = Environment(app)
# Imported here to prevent circular imports
from uploads import configure
from search import configure
uploads.configure()
search.configure()
# Second, setup assets

assets = Environment(app)

js = Bundle('js/libs/jquery-1.5.1.min.js',
            'js/libs/jquery.textarea-expander.js',
            'js/libs/tiny_mce/jquery.tinymce.js',
            'js/libs/jquery.form.js',
            'js/scripts.js',
            filters='jsmin', output='js/packed.js')

assets.register('js_all', js)

# Third, after config, import the models and views

import hasjob.models
import hasjob.views
if environ.get('HASJOB_ENV') == 'prod':
    import hasjob.loghandler
