Permalink
Browse files

Changed the import script.

  • Loading branch information...
Poromenos.org Server
Poromenos.org Server committed May 23, 2010
1 parent 31cf389 commit 554ba4a4657eb5627684e574978b87449b18cd0d
Showing with 11 additions and 5 deletions.
  1. +2 −2 database.py
  2. +4 −3 importer.py
  3. +5 −0 index.tpl
View
@@ -55,10 +55,10 @@ def __repr__(self):
return "<Stats('%s','%s')>" % (self.key, self.value)
-def init_db():
+def init_db(transactional=False):
engine = sqlalchemy.create_engine(CONNECTION_STRING)
Base.metadata.create_all(engine)
- Session = sessionmaker(bind=engine, transactional=False)
+ Session = sessionmaker(bind=engine, transactional=transactional)
session = Session()
return session
View
@@ -7,7 +7,7 @@
import re
import sqlalchemy
-session = init_db()
+session = init_db(transactional=True)
def import_data(filename):
"""Import episode names and ratings from a file."""
@@ -36,7 +36,8 @@ def import_data(filename):
episode = Episode(show, episode["episode_name"], episode["season_no"], episode["episode_no"])
session.add(episode)
- session.commit()
+ #session.commit()
-import_data("movies.list")
+if __name__ == "__main__":
+ import_data("movies.list")
View
@@ -46,5 +46,10 @@
<p>
Have fun!
</p>
+ <script type="text/javascript">
+ var flattr_url = 'http://imdbapi.poromenos.org/';
+ </script>
+ <script src="http://api.flattr.com/button/load.js" type="text/javascript"></script>
+
</body>
</html>

0 comments on commit 554ba4a

Please sign in to comment.