def buildDashboardSidebar(player, civilization): sidebar = '' sidebar += '<div id="dashboard_top">' sidebar += '<span>Name » <span class="highlight">%s</span></span>' % player.name sidebar += '<span>Credits » <span class="highlight">%s</span></span>' % civilization.credits sidebar += '<span>Civilization Age » <span class="highlight" id="civilization_age_span">%s</span></span>' % civilization.getAge() sidebar += '<span>Level » <span class="highlight">%s</span></span>' % civilization.level sidebar += '</div>' sidebar += '<div id="dashboard_bottom">' sidebar += '<div id="stream_holder">' sidebar += '<div id="player_stream" class="scroll-pane">' sidebar += helpers.getStream(player) sidebar += '</div></div>' sidebar += '<div id="chat_input">' sidebar += """ <form id="chat_form" action="/process-utilities" method="post"> <div> <input id="chat_text" maxlength="140" class="inputstuff" type="text" name="chat_text" /> <input id="submitButton" class="button" type="submit" value="Submit" /> </div> </form> """ sidebar += '</div>' # end chat_input sidebar += '</div>' # end dashboard_bottom return sidebar
def updateStream(self, player): try: return helpers.getStream(player) except Exception, e: import traceback traceback.print_exc() return '<p>Your stream is not streaming....</p>'