This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from flask import Flask | |
>>> from flaskext.sqlalchemy import SQLAlchemy | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/usr/local/lib/python2.6/dist-packages/flaskext/sqlalchemy.py", line 22, in <module> | |
from sqlalchemy import orm | |
ImportError: cannot import name orm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "index.py", line 18, in init_db | |
with closing(connect_db()) as db: | |
File "index.py", line 15, in connect_db | |
return sqlite3.connect(app.config['config.DATABASE']) | |
KeyError: 'config.DATABASE' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#imports | |
from __future__ import with_statement | |
import sqlite3 | |
from flask import Flask, request,session, g, redirect, url_for, \ | |
abort, render_template, flash | |
from contextlib import closing | |
import config | |
#initialize application | |
app = Flask(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#imports | |
DATABASE = 'pronoy.db' | |
USERNAME = 'admin' | |
PASSWORD = 'default' | |
SECRET_KEY = 'development key' | |
DEBUG = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATABASE = 'pronoy.db' | |
#initialize application | |
app = Flask(__name__) | |
def connect_db(): | |
return sqlite3.connect(app.config['DATABASE']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pysvn | |
client = pysvn.Client() | |
entry_list = client.ls('.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ogre::Entity* OgreEntity = mSceneMgr->createEntity("OgreHead","ogrehead.mesh"); | |
mSceneMgr->GetRootSceneNode()->attachObject(OgreEntity); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ogre::Entity OgreEnt = mSceneMgr->createEntity("Ogre","ogrehead.mesh"); | |
Ogre::SceneNode* node = mSceneMgr->createSceneNode("Node1") | |
mSceneMgr->GetRootSceneNode()->addChildNode(node); | |
node->attachObject(OgreEnt); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create entities | |
Ogre::Entity* ent1 = mSceneMgr->createEntity("Ogre1","ogrehead.mesh"); | |
Ogre::Entity* ent2 = mSceneMgr->createEntity("Ninja1","ninja.mesh"); | |
//create nodes | |
Ogre::SceneNode* childnode1 = mSceneMgr->createSceneNode("Node1"); | |
Ogre::SceneNode* childnode2 = mSceneMgr->createSceneNode("Node2"); | |
//attach to RSN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create entities | |
Ogre::Entity* ent1 = mSceneMgr->createEntity("Ogre1","ogrehead.mesh"); | |
Ogre::Entity* ent2 = mSceneMgr->createEntity("Ninja1","ninja.mesh"); | |
//create nodes | |
Ogre::SceneNode* childnode1 = mSceneMgr->createSceneNode("Node1"); | |
//Ogre::SceneNode* childnode2 = mSceneMgr->createSceneNode("Node2"); | |
//attach to RSN |
OlderNewer