Skip to content

Commit 69f09fb

Browse files
committed
Remove Pylons and other cruft
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 2d1097b commit 69f09fb

File tree

13 files changed

+41
-81
lines changed

13 files changed

+41
-81
lines changed

MANIFEST.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1+
recursive-include scripts/templates *
12
recursive-include scriptspony/public *
2-
include scriptspony/public/favicon.ico
3-
recursive-include scriptspony/i18n *
43
recursive-include scriptspony/templates *

development.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ error_email_from = [email protected]
1717

1818
[server:main]
1919
use = egg:Paste#http
20-
host = b-k.mit.edu
20+
host = 127.0.0.1
2121
port = 8424
2222

2323
[app:main]

scripts/templates/master.mak

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
33

44
<%!
5-
import pylons
65
from socket import gethostname
76
from scripts import auth, log
87
import os
@@ -155,10 +154,10 @@ else:
155154
<div id="hnav">
156155
<ul id="navlist"><li id="pageLogin">
157156
%if not auth.current_user():
158-
<a href="${set_port(pylons.request.application_url,444)}"><span class="fa fa-user"></span> Login with MIT Certificates</a>
157+
<a href="${set_port(request.application_url,444)}"><span class="fa fa-user"></span> Login with MIT Certificates</a>
159158
%else:
160159
Welcome ${auth.first_name()}.
161-
<a href="${set_port(pylons.request.application_url,80)}"><span class="fa fa-sign-out"></span> Logout</a>
160+
<a href="${set_port(request.application_url,80)}"><span class="fa fa-sign-out"></span> Logout</a>
162161
%endif
163162
</li>
164163
%if auth.on_scripts_team():

scriptspony/config/app_cfg.py

+1
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@
4141
base_config.model = scriptspony.model
4242
base_config.DBSession = scriptspony.model.DBSession
4343

44+
base_config.use_toscawidgets = False

scriptspony/controllers/controller.template

-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
from tg import expose
66
#from tg import redirect, validate, flash
77

8-
# third party imports
9-
#from pylons.i18n import ugettext as _
10-
#from repoze.what import predicates
11-
128
# project specific imports
139
from scriptspony.lib.base import BaseController
1410
#from scriptspony.model import DBSession, metadata

scriptspony/controllers/error.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ErrorController(object):
2121
@expose('scriptspony.templates.error')
2222
def document(self, *args, **kwargs):
2323
"""Render the error document"""
24-
resp = request.environ.get('pylons.original_response')
24+
resp = request.environ.get('tg.original_response')
2525
default_message = ("<p>We're sorry but we weren't able to process "
2626
" this request.</p>")
2727
values = dict(prefix=request.environ.get('SCRIPT_NAME', ''),

scriptspony/controllers/root.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"""Main Controller"""
33

44
from tg import expose, flash, require, url, request, redirect, override_template
5-
from pylons.i18n import ugettext as _, lazy_ugettext as l_
6-
import pylons
75

86
from scriptspony.lib.base import BaseController
97
from scriptspony.model import DBSession, metadata
@@ -51,8 +49,8 @@ class RootController(BaseController):
5149
@expose('scriptspony.templates.index')
5250
def index(self,locker=None,sudo=False):
5351
"""Handle the front-page."""
54-
if locker is not None and pylons.request.response_ext:
55-
locker += pylons.request.response_ext
52+
if locker is not None and request.response_ext:
53+
locker += request.response_ext
5654

5755
olocker = locker
5856
hosts = None
@@ -102,8 +100,8 @@ def index(self,locker=None,sudo=False):
102100

103101
@expose('scriptspony.templates.edit')
104102
def edit(self,locker,hostname,path=None,token=None,alias=''):
105-
if pylons.request.response_ext:
106-
hostname += pylons.request.response_ext
103+
if request.response_ext:
104+
hostname += request.response_ext
107105
if path is not None:
108106
if token != auth.token():
109107
flash("Invalid token!")
@@ -139,8 +137,8 @@ def edit(self,locker,hostname,path=None,token=None,alias=''):
139137

140138
@expose('scriptspony.templates.delete')
141139
def delete(self,locker,hostname,confirm=False,token=None):
142-
if pylons.request.response_ext:
143-
hostname += pylons.request.response_ext
140+
if request.response_ext:
141+
hostname += request.response_ext
144142
if confirm:
145143
if token != auth.token():
146144
flash("Invalid token!")
@@ -170,8 +168,8 @@ def new(self,locker,hostname='',path='',desc='',token=None,
170168
auth.scripts_team_sudo()
171169
else:
172170
requestor = None
173-
if pylons.request.response_ext:
174-
locker += pylons.request.response_ext
171+
if request.response_ext:
172+
locker += request.response_ext
175173
if hostname:
176174
if token != auth.token():
177175
flash("Invalid token!")

scriptspony/lib/base.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
from tg import TGController, tmpl_context
66
from tg.render import render
7-
from pylons.i18n import _, ungettext, N_
8-
from tw.api import WidgetBunch
97
import scriptspony.model as model
108

119
__all__ = ['Controller', 'BaseController']
@@ -24,6 +22,6 @@ def __call__(self, environ, start_response):
2422
"""Invoke the Controller"""
2523
# TGController.__call__ dispatches to the Controller method
2624
# the request is routed to. This routing information is
27-
# available in environ['pylons.routes_dict']
25+
# available in environ['tg.routes_dict']
2826

2927
return TGController.__call__(self, environ, start_response)

scriptspony/lib/helpers.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# -*- coding: utf-8 -*-
22

33
"""WebHelpers used in ScriptsPony."""
4-
5-
from webhelpers import date, feedgenerator, html, number, misc, text

scriptspony/tests/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
def setup_db():
1919
"""Method used to build a database"""
20-
engine = config['pylons.app_globals'].sa_engine
20+
engine = config['tg.app_globals'].sa_engine
2121
model.init_model(engine)
2222
model.metadata.create_all(engine)
2323

2424
def teardown_db():
2525
"""Method used to destroy a database"""
26-
engine = config['pylons.app_globals'].sa_engine
26+
engine = config['tg.app_globals'].sa_engine
2727
model.metadata.drop_all(engine)
2828

2929

scriptspony/websetup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def setup_app(command, conf, vars):
1919
# Load the models
2020
from scriptspony import model
2121
print "Creating tables"
22-
#model.metadata.drop_all(bind=config['pylons.app_globals'].sa_engine)
23-
model.metadata.create_all(bind=config['pylons.app_globals'].sa_engine)
22+
#model.metadata.drop_all(bind=config['tg.app_globals'].sa_engine)
23+
model.metadata.create_all(bind=config['tg.app_globals'].sa_engine)
2424

2525
transaction.commit()
2626
print "Successfully setup"

setup.cfg

-29
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
11
[egg_info]
22
tag_build = dev
33
tag_svn_revision = true
4-
5-
[easy_install]
6-
find_links = http://www.pylonshq.com/download/
7-
8-
[nosetests]
9-
with-pylons=test.ini
10-
11-
# Babel configuration
12-
[compile_catalog]
13-
domain = scriptspony
14-
directory = scriptspony/i18n
15-
statistics = true
16-
17-
[extract_messages]
18-
add_comments = TRANSLATORS:
19-
output_file = scriptspony/i18n/scriptspony.pot
20-
width = 80
21-
keywords = l_
22-
23-
[init_catalog]
24-
domain = scriptspony
25-
input_file = scriptspony/i18n/scriptspony.pot
26-
output_dir = scriptspony/i18n
27-
28-
[update_catalog]
29-
domain = scriptspony
30-
input_file = scriptspony/i18n/scriptspony.pot
31-
output_dir = scriptspony/i18n
32-
previous = true

setup.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,34 @@
99
author_email='',
1010
#url='',
1111
install_requires=[
12+
"decorator >= 3.4",
13+
"dnspython >= 1.11",
14+
"elixir >= 0.7",
15+
"mako >= 1.0",
16+
"nose >= 1.0",
17+
"paste >= 1.7",
18+
"routes >= 1.13",
19+
"python-ldap >= 2.4",
1220
"TurboGears2 >= 2.0b7",
13-
"Catwalk >= 2.0.2",
14-
"Babel >=0.9.4",
15-
#can be removed iif use_toscawidgets = False
16-
"toscawidgets >= 0.9.7.1",
21+
"MySQL-python >= 1.2",
1722
"zope.sqlalchemy >= 0.4 ",
18-
"repoze.tm2 >= 1.0a4",
1923
],
2024
setup_requires=["PasteScript >= 1.7"],
21-
paster_plugins=['PasteScript', 'Pylons', 'TurboGears2', 'tg.devtools'],
25+
paster_plugins=['PasteScript', 'TurboGears2', 'tg.devtools'],
2226
packages=find_packages(),
2327
include_package_data=True,
2428
test_suite='nose.collector',
25-
tests_require=['WebTest', 'BeautifulSoup'],
26-
package_data={'scriptspony': ['i18n/*/LC_MESSAGES/*.mo',
27-
'templates/*/*',
28-
'public/*/*']},
29-
message_extractors={'scriptspony': [
30-
('**.py', 'python', None),
31-
('templates/**.mako', 'mako', None),
32-
('templates/**.html', 'genshi', None),
33-
('public/**', 'ignore', None)]},
29+
tests_require=['WebTest'],
3430

35-
entry_points="""
36-
[paste.app_factory]
37-
main = scriptspony.config.middleware:make_app
38-
39-
[paste.app_install]
40-
main = pylons.util:PylonsInstaller
41-
""",
31+
entry_points={
32+
'paste.app_factory': [
33+
'main = scriptspony.config.middleware:make_app',
34+
],
35+
'paste.app_install': [
36+
'main = paste.script.appinstall:Installer',
37+
],
38+
'gearbox.plugins': [
39+
'turbogears-devtools = tg.devtools',
40+
],
41+
},
4242
)

0 commit comments

Comments
 (0)