Anonymous avatar Anonymous committed 0903504 Draft Merge

Merge pull request #1 from mcdonc/master

modernize

Comments (0)

Files changed (7)

+env/
+*.pyc
+*.db
+*.egg-info

src/stage3/birdie/models.py

-import transaction
-
 from sqlalchemy import Column
 from sqlalchemy import TIMESTAMP
 from sqlalchemy import Unicode
 from sqlalchemy import Integer
 from sqlalchemy import ForeignKey
 
-from sqlalchemy.exc import IntegrityError
 from sqlalchemy.ext.declarative import declarative_base
 
 from sqlalchemy.orm import scoped_session
 from sqlalchemy.orm import sessionmaker
-from sqlalchemy.orm import column_property
 from sqlalchemy.orm import relationship
-from sqlalchemy.orm import backref
 from zope.sqlalchemy import ZopeTransactionExtension
 
 from pyramid.security import Authenticated

src/stage3/birdie/tests.py

 import unittest
-from pyramid.config import Configurator
 from pyramid import testing
 
 def _initTestingDB():

src/stage3/birdie/views.py

     matchdict = request.matchdict
     other_userid = matchdict.get('userid')
     other_user = dbsession.query(User).filter_by(userid=other_userid).first()
+    url = route_url('users', request, userid=other_userid)
     if other_user is None:
         return HTTPNotFound(location=url)
-    url = route_url('users', request, userid=other_userid)
     chirps = dbsession.query(Chirp).filter(Chirp.author==other_user)
     chirps = chirps.order_by(Chirp.timestamp.desc()).limit(30)
     follows = dbsession.query(Follower).filter(Follower.follower==other_user.id)
     matchdict = request.matchdict
     other_userid = matchdict.get('userid')
     other_user = dbsession.query(User).filter_by(userid=other_userid).first()
-    url = route_url('users', request, userid=other_userid)
     follower = user.id
     follows = other_user.id
     new_follower = Follower(follower, follows)
     matchdict = request.matchdict
     other_userid = matchdict.get('userid')
     other_user = dbsession.query(User).filter_by(userid=other_userid).first()
-    url = route_url('users', request, userid=other_userid)
     follower = user.id
     follows = other_user.id
     dbsession.query(Follower).filter(Follower.follower==follower).filter(Follower.follows==follows).delete()
     return HTTPFound(location = '/')
-    return HTTPFound(location = user_url)
 

src/stage3/development.ini

-[app:birdie]
+[app:main]
 use = egg:birdie
 reload_templates = true
 debug_authorization = false
 debug_templates = true
 default_locale_name = en
 sqlalchemy.url = sqlite:///%(here)s/birdie.db
-
-[pipeline:main]
-pipeline =
-    egg:WebError#evalerror
-    tm
-    birdie
-
-[filter:tm]
-use = egg:repoze.tm2#tm
-commit_veto = repoze.tm:default_commit_veto
+pyramid.includes = pyramid_tm
+                   pyramid_debugtoolbar
 
 [server:main]
-use = egg:Paste#http
+use = egg:waitress#main
 host = 0.0.0.0
 port = 6543
 

src/stage3/production.ini

-[app:birdie]
+[app:main]
 use = egg:birdie
 reload_templates = false
 debug_authorization = false
 debug_templates = false
 default_locale_name = en
 sqlalchemy.url = sqlite:///%(here)s/birdie.db
-
-[filter:weberror]
-use = egg:WebError#error_catcher
-debug = false
-;error_log = 
-;show_exceptions_in_wsgi_errors = true
-;smtp_server = localhost
-;error_email = janitor@example.com
-;smtp_username = janitor
-;smtp_password = "janitor's password"
-;from_address = paste@localhost
-;error_subject_prefix = "Pyramid Error"
-;smtp_use_tls =
-;error_message =
-
-[filter:tm]
-use = egg:repoze.tm2#tm
-commit_veto = repoze.tm:default_commit_veto
-
-[pipeline:main]
-pipeline =
-    weberror
-    tm
-    birdie
+pyramid.includes = pyramid_tm
+                   pyramid_debugtoolbar
 
 [server:main]
-use = egg:Paste#http
+use = egg:waitress#main
 host = 0.0.0.0
 port = 6543
 

src/stage3/setup.py

 import os
-import sys
 
 from setuptools import setup, find_packages
 
 requires = [
     'pyramid',
     'SQLAlchemy',
-    'transaction',
-    'repoze.tm2>=1.0b1', # default_commit_veto
+    'pyramid_tm',
+    'pyramid_debugtoolbar',
     'zope.sqlalchemy',
     'repoze.timeago',
     'cryptacular',
-    'WebError',
+    'waitress',
     ]
 
-if sys.version_info[:3] < (2,5,0):
-    requires.append('pysqlite')
-
 setup(name='birdie',
       version='0.0',
       description='birdie',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.