added improved scripts/setup-web2py-nginx-uwsgi-ubuntu.sh, thanks Niphlod

This commit is contained in:
mdipierro
2012-12-20 09:22:24 -06:00
parent dcf0a7ccc9
commit 95b3ca839a
14 changed files with 60 additions and 53 deletions
+1
View File
@@ -0,0 +1 @@
+2 -2
View File
@@ -3487,7 +3487,7 @@ def _parse_date_rfc822(dt):
# If the year is 2 digits, assume everything in the 90's is the 1990's
if m['year'] < 100:
m['year'] += (1900, 2000)[m['year'] < 90]
stamp = datetime.datetime(*[m[i] for i in
stamp = datetime.datetime(*[m[i] for i in
('year', 'month', 'day', 'hour', 'minute', 'second')])
# Use the timezone information to calculate the difference between
@@ -3699,7 +3699,7 @@ def convert_to_utf8(http_headers, data):
u'application/xml-external-parsed-entity')
text_content_types = (u'text/xml', u'text/xml-external-parsed-entity')
if (http_content_type in application_content_types) or \
(http_content_type.startswith(u'application/') and
(http_content_type.startswith(u'application/') and
http_content_type.endswith(u'+xml')):
acceptable_content_type = 1
rfc3023_encoding = http_encoding or xml_encoding or u'utf-8'
+1 -1
View File
@@ -17,7 +17,7 @@ ADAPTERS['postgres'] = HerokuPostgresAdapter
def get_db(name = None, pool_size=10):
if not name:
names = [n for n in os.environ.keys()
names = [n for n in os.environ.keys()
if n[:18]+n[-4:]=='HEROKU_POSTGRESQL__URL']
if names:
name = names[0]
+5 -7
View File
@@ -70,7 +70,7 @@ class PaymenTech(object):
#################################################################
# Notes for web2py implementations #
#################################################################
#################################################################
# A recommended model for handling payments
@@ -87,7 +87,7 @@ class PaymenTech(object):
PAYMENTECH_TARGET = <str>
PAYMENTECH_HOST = <str>
PAYMENTECH_API_URL = <str>
# The following table would allow passing data with web2py and to
# update records with the webservice authorization output by using
# the DAL
@@ -102,10 +102,10 @@ class PaymenTech(object):
#
# # Send the authorization request to the webservice
# result = mypaymentech.charge(myrow.as_dict())
#
#
# # Update the db record with the webservice response
# myrow.update_record(**result)
db.define_table("paymentech",
Field("account"),
Field("exp", comment="Must be of the mmyyyy form"),
@@ -302,7 +302,7 @@ class PaymenTech(object):
tx_ref_num = order_id = None
conn = httplib.HTTPS(self.host)
conn.putrequest('POST', self.api_url)
if self.development:
content_type = "PTI56"
else:
@@ -340,5 +340,3 @@ class PaymenTech(object):
dom.getElementsByTagName('CustomerRefNum')[0].firstChild.data
return result
+4 -4
View File
@@ -6853,7 +6853,7 @@ class DAL(object):
self._adapter = ADAPTERS[self._dbname](**kwargs)
types = ADAPTERS[self._dbname].types
# copy so multiple DAL() possible
self._adapter.types = copy.copy(types)
self._adapter.types = copy.copy(types)
if bigint_id:
if 'big-id' in types and 'reference' in types:
self._adapter.types['id'] = types['big-id']
@@ -7200,7 +7200,7 @@ def index():
fields = list(fields) + list(common_fields)
table_class = args_get('table_class',Table)
table = table_class(self, tablename, *fields, **args)
table = table_class(self, tablename, *fields, **args)
table._actual = True
self[tablename] = table
# must follow above line to handle self references
@@ -7747,10 +7747,10 @@ class Table(object):
def __call__(self, key=DEFAULT, **kwargs):
for_update = kwargs.get('_for_update',False)
if '_for_update' in kwargs: del kwargs['_for_update']
orderby = kwargs.get('_orderby',None)
if '_orderby' in kwargs: del kwargs['_orderby']
if not key is DEFAULT:
if isinstance(key, Query):
record = self._db(key).select(
+2 -2
View File
@@ -520,7 +520,7 @@ class XmlComponent(object):
c = self['_class']
classes = (set(c.split()) if c else set()) - set(name.split())
self['_class'] = ' '.join(classes) if classes else None
return self
return self
class XML(XmlComponent):
"""
@@ -1487,7 +1487,7 @@ class A(DIV):
(self['callback'], self['target'] or '', d)
self['_href'] = self['_href'] or '#null'
elif self['cid']:
pre = self['pre_call'] + ';' if self['pre_call'] else ''
pre = self['pre_call'] + ';' if self['pre_call'] else ''
self['_onclick'] = '%sweb2py_component("%s","%s");%sreturn false;' % \
(pre,self['_href'], self['cid'], d)
return DIV.xml(self)
-1
View File
@@ -154,4 +154,3 @@ def redirect(location='', how=303, client_side=False):
from gluon import current
if client_side and current.request.ajax:
raise HTTP(200, **{'web2py-component-command': 'window.location.reload(true)'})
+3 -3
View File
@@ -269,7 +269,7 @@ jQuery.fn.grow_input = function() {
function pe(ul, e) {
var new_line = ml(ul);
rel(ul);
new_line.appendTo(ul);
new_line.appendTo(ul);
new_line.find(":text").focus();
return false;
}
@@ -761,7 +761,7 @@ def formstyle_bootstrap(form, fields):
# For password fields, which are wrapped in a CAT object.
if isinstance(controls, CAT) and isinstance(controls[0], INPUT):
controls[0].add_class('input-xlarge')
if isinstance(controls, SELECT):
controls.add_class('input-xlarge')
@@ -1789,7 +1789,7 @@ class SQLFORM(FORM):
if not (
'/'.join(str(a) for a in args) == '/'.join(request.args) or
URL.verify(request,user_signature=user_signature,
hash_vars=False) or
hash_vars=False) or
(request.args(len(args))=='view' and not logged)):
session.flash = T('not authorized')
redirect(referrer)
+6 -6
View File
@@ -1959,9 +1959,9 @@ class Auth(object):
onaccept = self.settings.login_onaccept
if log is DEFAULT:
log = self.messages.login_log
onfail = self.settings.login_onfail
user = None # default
# do we use our own login form, or from a central source?
@@ -2117,7 +2117,7 @@ class Auth(object):
session._auth_next = None
next = replace_id(next, form)
redirect(next, client_side=True)
table_user[username].requires = old_requires
return form
elif user:
@@ -3016,7 +3016,7 @@ class Auth(object):
if user_id:
user = self.table_user()[user_id]
else:
user = self.user
user = self.user
return self.settings.create_user_groups % user
def has_membership(self, group_id=None, user_id=None, role=None):
@@ -4690,7 +4690,7 @@ class Wiki(object):
rows_page = 25
def markmin_render(self, page):
html = MARKMIN(page.body, extra=self.extra,
html = MARKMIN(page.body, extra=self.extra,
url=True, environment=self.env,
autolinks=lambda link: expand_one(link, {})).xml()
html += DIV(_class='w2p_wiki_tags',
@@ -5053,7 +5053,7 @@ class Wiki(object):
return self.not_authorized()
db = self.auth.db
slugs=db(db.wiki_page.id>0).select(db.wiki_page.id,db.wiki_page.slug)
options=[OPTION(row.slug,_value=row.id) for row in slugs]
options=[OPTION(row.slug,_value=row.id) for row in slugs]
options.insert(0, OPTION('',_value=''))
form = SQLFORM.factory(Field("slug", default=current.request.args(1),
requires=(IS_SLUG(),
+1 -1
View File
@@ -171,7 +171,7 @@ class Web2pyCronService(Web2pyService):
opt_mod = self._exe_args_
options = __import__(opt_mod, [], [], '')
global_settings.global_settings.web2py_crontype = 'external'
if options.scheduler: # -K
if options.scheduler: # -K
apps = [app.strip() for app in options.scheduler.split(
',') if check_existent_app(options, app.strip())]
else: