コード例 #1
0
ファイル: sprlwidgets.py プロジェクト: MaxTyutyunnikov/lino
	def writeLeftMargin(self):
		wr = self.write
		#row = self.target

		sess = self.getSession()
		frm = sess.forms.get('login',None)
		if frm is None:
			usr = sess.getUser()
			if usr is None:
				wr( "wie kann das?")
			else:
				wr("""Logged in as %s.
				<a href="logout">(log out)</a>""" % usr.getLabel())
		else:
			self.renderForm(frm)
			wr("""<br><a href="%s">register</a>""" % \
				self.contextURI("register"))

		msgs = sess.popMessages()
		if len(msgs) > 0:
			wr("""<p style="padding:5px;border:1px solid black;
				background-colr:gold;">""")
			for msg in msgs:
				wr("""<br><font color="red">%s</font>""" % txt2html(msg))
			wr('</p>')
			
			
		
		ContextedResponse.writeLeftMargin(self)
		#self.write('<p><a href="add">add row</a>')
		#self.write('<br><a href="delete">delete row</a></p>')
		self.writeContextMenu()
コード例 #2
0
	def writeLeftMargin(self):
		wr = self.write
		#row = self.target

		sess = self.getSession()
		frm = sess.forms.get('login',None)
		if frm is None:
			usr = sess.getUser()
			if usr is None:
				wr( "wie kann das?")
			else:
				wr("""Logged in as %s.
				<a href="logout">(log out)</a>""" % usr.getLabel())
		else:
			self.renderForm(frm)
			wr("""<br><a href="%s">register</a>""" % \
				self.contextURI("register"))

		msgs = sess.popMessages()
		if len(msgs) > 0:
			wr("""<p style="padding:5px;border:1px solid black;
				background-colr:gold;">""")
			for msg in msgs:
				wr("""<br><font color="red">%s</font>""" % txt2html(msg))
			wr('</p>')
			
			
		
		ContextedResponse.writeLeftMargin(self)
		#self.write('<p><a href="add">add row</a>')
		#self.write('<br><a href="delete">delete row</a></p>')
		self.writeContextMenu()
コード例 #3
0
def htmltext(s):
    s = escape(s)
    # s = s.replace('<','&lt;')
    # s = s.replace('>','&gt;')
    # s = s.replace('&','&amp;')
    return txt2html(s)
コード例 #4
0
ファイル: response.py プロジェクト: MaxTyutyunnikov/lino
def htmltext(s):
    s = escape(s)
    # s = s.replace('<','&lt;')
    # s = s.replace('>','&gt;')
    # s = s.replace('&','&amp;')
    return txt2html(s)