Exemple #1
0
    db = os.environ['FREPPLE_DATABASE'] or DEFAULT_DB_ALIAS
  except:
    db = DEFAULT_DB_ALIAS

  # Use the test database if we are running the test suite
  if 'FREPPLE_TEST' in os.environ:
    settings.DATABASES[db]['NAME'] = settings.DATABASES[db]['TEST']['NAME']

  printWelcome(database=db)
  logProgress(1, db)
  from freppledb.execute.load import loadData
  frepple.printsize()
  if 'odoo_read' in os.environ:
    # Use input data from the frePPLe database and Odoo
    print("\nStart loading data from the database with filter \"source <> 'odoo'\" at", datetime.now().strftime("%H:%M:%S"))
    loadData(database=db, filter="source is null or source<>'odoo'").run()
    frepple.printsize()
    logProgress(10, db)
    print("\nStart loading data from odoo at", datetime.now().strftime("%H:%M:%S"))
    odoo_read(db)
    frepple.printsize()
  else:
    # Use input data from the frePPLe database
    print("\nStart loading data from the database at", datetime.now().strftime("%H:%M:%S"))
    loadData(database=db, filter=None).run()
    frepple.printsize()
  logProgress(33, db)

  if 'odoo_read' in os.environ:
    print("\nStart exporting static model to the database with filter \"source = 'odoo'\" at", datetime.now().strftime("%H:%M:%S"))
    from freppledb.execute.export_database_static import exportStaticModel
Exemple #2
0
    try:
        db = os.environ['FREPPLE_DATABASE'] or DEFAULT_DB_ALIAS
    except:
        db = DEFAULT_DB_ALIAS

    # Use the test database if we are running the test suite
    if 'FREPPLE_TEST' in os.environ:
        settings.DATABASES[db]['NAME'] = settings.DATABASES[db]['TEST']['NAME']

    printWelcome(database=db)
    logProgress(1, db)
    frepple.printsize()
    print("\nStart loading data from the database at",
          datetime.now().strftime("%H:%M:%S"))
    from freppledb.execute.load import loadData
    loadData(database=db, filter=None).run()
    frepple.printsize()
    logProgress(33, db)
    print("\nStart plan generation at", datetime.now().strftime("%H:%M:%S"))
    createPlan(db)
    frepple.printsize()
    logProgress(66, db)

    #print("\nStart exporting static model to the database at", datetime.now().strftime("%H:%M:%S"))
    #from freppledb.execute.export_database_static import exportStaticModel
    #exportStaticModel(database=db, source=None).run()

    print("\nStart exporting plan to the database at",
          datetime.now().strftime("%H:%M:%S"))
    exportPlan(db)
Exemple #3
0
  # Select database
  try:
    db = os.environ['FREPPLE_DATABASE'] or DEFAULT_DB_ALIAS
  except:
    db = DEFAULT_DB_ALIAS

  # Use the test database if we are running the test suite
  if 'FREPPLE_TEST' in os.environ:
    settings.DATABASES[db]['NAME'] = settings.DATABASES[db]['TEST']['NAME']

  printWelcome(database=db)
  logProgress(1, db)
  frepple.printsize()
  print("\nStart loading data from the database at", datetime.now().strftime("%H:%M:%S"))
  from freppledb.execute.load import loadData
  loadData(database=db, filter=None).run()
  frepple.printsize()
  logProgress(33, db)
  print("\nStart plan generation at", datetime.now().strftime("%H:%M:%S"))
  createPlan(db)
  frepple.printsize()
  logProgress(66, db)

  #print("\nStart exporting static model to the database at", datetime.now().strftime("%H:%M:%S"))
  #from freppledb.execute.export_database_static import exportStaticModel
  #exportStaticModel(database=db, source=None).run()

  print("\nStart exporting plan to the database at", datetime.now().strftime("%H:%M:%S"))
  exportPlan(db)

  #print("\nStart saving the plan to flat files at", datetime.now().strftime("%H:%M:%S"))
Exemple #4
0
    db = os.environ['FREPPLE_DATABASE'] or DEFAULT_DB_ALIAS
  except:
    db = DEFAULT_DB_ALIAS

  # Use the test database if we are running the test suite
  if 'FREPPLE_TEST' in os.environ:
    settings.DATABASES[db]['NAME'] = settings.DATABASES[db]['TEST']['NAME']

  printWelcome(database=db)
  logProgress(1, db)
  from freppledb.execute.load import loadData
  frepple.printsize()
  if 'odoo_read' in os.environ:
    # Use input data from the frePPLe database and Odoo
    print("\nStart loading data from the database with filter \"source <> 'odoo'\" at", datetime.now().strftime("%H:%M:%S"))
    loadData(database=db, filter="source is null or source<>'odoo'").run()
    frepple.printsize()
    logProgress(10, db)
    print("\nStart loading data from odoo at", datetime.now().strftime("%H:%M:%S"))
    odoo_read(db)
    frepple.printsize()
  else:
    # Use input data from the frePPLe database
    print("\nStart loading data from the database at", datetime.now().strftime("%H:%M:%S"))
    loadData(database=db, filter=None).run()
    frepple.printsize()
  logProgress(33, db)

  if 'odoo_read' in os.environ:
    print("\nStart exporting static model to the database with filter \"source = 'odoo'\" at", datetime.now().strftime("%H:%M:%S"))
    from freppledb.execute.export_database_static import exportStaticModel
Exemple #5
0
 def run(cls, database=DEFAULT_DB_ALIAS, **kwargs):
     import frepple
     from freppledb.execute.load import loadData
     loadData(database=database, filter=cls.filter).runDynamic()
     frepple.printsize()
Exemple #6
0
 def run(cls, database=DEFAULT_DB_ALIAS, **kwargs):
   import frepple
   from freppledb.execute.load import loadData
   loadData(database=database, filter=cls.filter).runDynamic()
   frepple.printsize()