witten
/
luminotes
Archived
1
0
Fork 0

Factored out hardcoded support email address from various places.

Now it's configurable in the common settings.
This commit is contained in:
Dan Helfman 2007-08-20 20:28:17 +00:00
parent 082697fe5a
commit 824882a1d8
6 changed files with 11 additions and 9 deletions

View File

@ -19,5 +19,6 @@ settings = {
"luminotes.https_url": "", "luminotes.https_url": "",
"luminotes.http_proxy_ip": "127.0.0.1", "luminotes.http_proxy_ip": "127.0.0.1",
"luminotes.https_proxy_ip": "127.0.0.2", "luminotes.https_proxy_ip": "127.0.0.2",
"luminotes.support_email": "support@luminotes.com",
}, },
} }

View File

@ -77,13 +77,13 @@ class Root( object ):
if status == 404: if status == 404:
cherrypy.response.headerMap[ u"Status" ] = u"404 Not Found" cherrypy.response.headerMap[ u"Status" ] = u"404 Not Found"
cherrypy.response.status = status cherrypy.response.status = status
cherrypy.response.body = [ unicode( Not_found_page() ) ] cherrypy.response.body = [ unicode( Not_found_page( self.__settings[ u"global" ].get( u"luminotes.support_email" ) ) ) ]
return return
import traceback import traceback
traceback.print_exc() traceback.print_exc()
cherrypy.response.body = [ unicode( Error_page() ) ] cherrypy.response.body = [ unicode( Error_page( self.__settings[ u"global" ].get( u"luminotes.support_email" ) ) ) ]
scheduler = property( lambda self: self.__scheduler ) scheduler = property( lambda self: self.__scheduler )
database = property( lambda self: self.__database ) database = property( lambda self: self.__database )

View File

@ -24,7 +24,7 @@ def wait_for_update( function ):
try: try:
return queue.get( block = True, timeout = TIMEOUT_SECONDS ) return queue.get( block = True, timeout = TIMEOUT_SECONDS )
except Empty: except Empty:
return { "error": u"A timeout occurred when processing your request. Please try again or contact support@luminotes.com" } return { "error": u"A timeout occurred when processing your request. Please try again or contact support." }
return get_message return get_message
@ -66,7 +66,7 @@ def update_client( function ):
result = error.to_dict() result = error.to_dict()
queue.put( result ) queue.put( result )
else: else:
queue.put( { "error": u"An error occurred when processing your request. Please try again or contact support@luminotes.com" } ) queue.put( { "error": u"An error occurred when processing your request. Please try again or contact support." } )
raise raise
return put_message return put_message

View File

@ -99,8 +99,9 @@ def fix_note_contents( contents, notebook_id, note_ids ):
LINK_PATTERN = re.compile( '(<a href=")([^"]+?note_id=)([^"]*)("[^>]*>)([^<]*)(</a>)' ) LINK_PATTERN = re.compile( '(<a href=")([^"]+?note_id=)([^"]*)("[^>]*>)([^<]*)(</a>)' )
# plug in the notebook id where appropriate # plug in the notebook id and support email address where appropriate
contents = contents.replace( "%s", notebook_id ) contents = contents.replace( "%s", notebook_id )
contents = contents.replace( "support@luminotes.com", settings[ u"global" ].get( u"luminotes.support_email", u"" ) )
# stitch together note links to use the actual note ids of the referenced notes. # stitch together note links to use the actual note ids of the referenced notes.
# also, use the https URL for certain links if one is configured # also, use the https URL for certain links if one is configured

View File

@ -3,7 +3,7 @@ from Tags import Div, H2, P, A, Ul, Li, Strong
class Error_page( Page ): class Error_page( Page ):
def __init__( self ): def __init__( self, support_email ):
title = u"uh oh" title = u"uh oh"
Page.__init__( Page.__init__(
@ -13,7 +13,7 @@ class Error_page( Page ):
H2( title ), H2( title ),
P( P(
u"Something went wrong! If you care, please", u"Something went wrong! If you care, please",
A( "let us know about it.", href = "mailto:support@luminotes.com" ), A( "let us know about it.", href = "mailto:%s" % support_email ),
u"Be sure to include the following information:", u"Be sure to include the following information:",
), ),
Ul( Ul(

View File

@ -3,7 +3,7 @@ from Tags import Div, H2, P, A
class Not_found_page( Page ): class Not_found_page( Page ):
def __init__( self ): def __init__( self, support_email ):
title = u"404" title = u"404"
Page.__init__( Page.__init__(
@ -13,7 +13,7 @@ class Not_found_page( Page ):
H2( title ), H2( title ),
P( P(
u"This is not the page you're looking for. If you care, please", u"This is not the page you're looking for. If you care, please",
A( "let us know about it.", href = "mailto:support@luminotes.com" ), A( "let us know about it.", href = "mailto:%s" % support_email ),
), ),
P( P(
u"Thanks!", u"Thanks!",