Ejemplo n.º 1
0
def addstaticdata(session):
   import confighelper # have to import it here, otherwise Config table can't be easily
                       # imported inside confighelper, because circular import loop
   confighelper.applydefaults()

   import roles
   roles.addstaticdata()

   import optionshelper
   optionshelper.addstaticdata()

   account = Account("admin","admin" )
   account.passwordinfo = PasswordInfo('admin')
   session.add(account)
   account.addRole( roles.getRole('accountadmin') )
   account.addRole( roles.getRole('aiadmin') )
   account.addRole( roles.getRole('mapadmin') )
   account.addRole( roles.getRole('modadmin') )
   account.addRole( roles.getRole('leagueadmin') )
   account.addRole( roles.getRole('botrunneradmin') )
   account.addRole( roles.getRole('requestadmin') )

   # add a couple of default mods/maps/ais:
   map = Map( 'SmallDivide.smf')
   map.map_url = 'http://spring-portal.com/index.php/docman/doc_download/104-smalldivide'
   session.add(map)

   mod = Mod('Balanced Annihilation V7.04')
   mod.mod_url = 'http://spring-portal.com/index.php/docman/doc_download/314-balanced-annihilation-v704'
   session.add(mod)

   ai = AI('E323AI','2.83')
   ai.ai_download_url = 'http://github.com/Error323/E323AI/tarball/v2.83'
   ai.ai_needscompiling = True
   session.add(ai)
Ejemplo n.º 2
0
def addStaticData():
    import confighelper # have to import it here, otherwise Config table can't be easily
                        # imported inside confighelper, because circular import loop
    confighelper.applydefaults()

    import roles
    roles.addstaticdata()

    account = Account("admin", "admin")
    account.passwordinfo = PasswordInfo('admin')
    Session.add(account)
    account.addRole(roles.getRole('accountadmin'))
    account.addRole(roles.getRole('aiadmin'))
    account.addRole(roles.getRole('mapadmin'))
    account.addRole(roles.getRole('modadmin'))
    account.addRole(roles.getRole('leagueadmin'))
    account.addRole(roles.getRole('botrunneradmin'))
    account.addRole(roles.getRole('requestadmin'))
    Session.commit()