예제 #1
0
# End file header

# Install our primary dependancies
subprocess.call( "apt-get install python-mysqldb",   shell=True )
subprocess.call( "apt-get install python-bs4",       shell=True )

# Install web dependancies
subprocess.call( "apt-get install python-cherrypy3", shell=True )
subprocess.call( "apt-get install python-jinja2",    shell=True )

# Install our data download

# Install our data manipulation dependancies
subprocess.call( "apt-get install python-numpy",       shell=True )

Mysql = MVC.loadDriver('Mysql' )
Mysql.ex( 'CREATE DATABASE IF NOT EXISTS `%s`;' % MVC.db['name'] )

if( len( sys.argv ) > 1 and sys.argv[1] == 'cleanup' ):
  dropTable_options               = "DROP TABLE IF EXISTS `%s`.`options`; "               % MVC.db['name']
  dropTable_users                 = "DROP TABLE IF EXISTS `%s`.`users`; "                 % MVC.db['name']
  dropTable_usermeta              = "DROP TABLE IF EXISTS `%s`.`usermeta`; "              % MVC.db['name']
  dropTable_acl_roles             = "DROP TABLE IF EXISTS `%s`.`acl_roles`; "             % MVC.db['name']
  dropTable_acl_permissions       = "DROP TABLE IF EXISTS `%s`.`acl_permissions`; "       % MVC.db['name']
  dropTable_acl_role_perms        = "DROP TABLE IF EXISTS `%s`.`acl_role_perms`; "        % MVC.db['name']
  dropTable_acl_user_perms        = "DROP TABLE IF EXISTS `%s`.`acl_user_perms`; "        % MVC.db['name']
  dropTable_acl_user_roles        = "DROP TABLE IF EXISTS `%s`.`acl_user_roles`; "        % MVC.db['name']
  dropTable_companies             = "DROP TABLE IF EXISTS `%s`.`companies`; "             % MVC.db['name']
  dropTable_companies_meta        = "DROP TABLE IF EXISTS `%s`.`companies_meta`; "        % MVC.db['name']
  dropTable_companies_types       = "DROP TABLE IF EXISTS `%s`.`companies_types`; "       % MVC.db['name']
  dropTable_companies_industry    = "DROP TABLE IF EXISTS `%s`.`companies_industry`;"     % MVC.db['name']
예제 #2
0
#!/usr/bin/python
"""
  UNIT TESTER
"""

import sys
sys.path.append( '../web/' )
import MVC as MVC

MVC               = MVC.MVC()
JobLog            = MVC.loadModel('JobLog')
ModelCompany      = MVC.loadModel('Company')
ModelCompanies    = MVC.loadModel('Companies')
ModelCompanyTypes = MVC.loadModel('CompanyTypes')
ModelNews         = MVC.loadModel('News')
ModelNewsSources  = MVC.loadModel('NewsSources')
ModelPerson       = MVC.loadModel('Person')
Wikipedia         = MVC.loadDriver('Wikipedia')
GoogleNews        = MVC.loadDriver('GoogleNews')

Debugger          = MVC.loadHelper('Debug')

if __name__ == "__main__":
  ModelNewsSources.updateCounts()