Changeset 696

Show
Ignore:
Timestamp:
06/19/08 13:39:00 (6 months ago)
Author:
sylvain
Message:

added help page handler

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • oss/headstock/headstock/example/microblog/design/default/css/style.css

    r692 r696  
    153153#footerrights { 
    154154} 
     155 
     156a { 
     157  color: #BBBBB5; 
     158  text-decoration: none; 
     159} 
     160 
     161a:hover { 
     162  text-decoration: underline; 
     163} 
  • oss/headstock/headstock/example/microblog/design/default/templates/welcome.mako

    r684 r696  
    99            Welcome to Speak Up! 
    1010 
    11             This small demo offers some possibilities about enhancing user experience over the web by integrating regular web applications with instant messaging applications. This means a greater interactivity for users. 
     11            This small demo offers some possibilities about enhancing user experience over the web by integrating regular web applications with instant messaging applications (<a href="/help" title="speak up commands">see the available commands</a>). This means a greater interactivity for users. 
    1212        </div>   
    1313 
     
    3030            <img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/80x15.png"/> 
    3131          </a> 
     32        <br /> 
    3233          2008 Sylvain Hellegouarch 
    3334        </span> 
  • oss/headstock/headstock/example/microblog/launcher.py

    r682 r696  
    4848        d.add('/service[/]', GET=self.atompubapp.service_get,  
    4949              HEAD=self.atompubapp.service_head) 
     50        d.add('/help[/]', GET=self.webapp.help) 
    5051 
    5152        # OpenID controllers 
  • oss/headstock/headstock/example/microblog/microblog/jabber/client.py

    r693 r696  
    189189                    for body in m.bodies: 
    190190                        message = remove_BOM(body.plain_body).strip() 
    191                         if message == 'help': 
    192                             m = Message(self.from_jid, m.from_jid) 
    193                             b = """<ul> 
    194                                         <li>PI text</li> 
    195                                         <li>PI text</li> 
    196                                         <li>DI text</li> 
    197                                         <li>CN text</li> 
    198                                         <li>DN text</li> 
    199                                         <li>PN text</li> 
    200                                         <li>SN text</li> 
    201                                         <li>UN text</li> 
    202                                    </ul>""" 
    203                             b = E.load(b).xml_root 
    204                             m.bodies.append(XHTMLBody(b)) 
    205                             self.send(m, 'outbox') 
    206                         else: 
    207                             print "Received message: %s" % repr(message) 
    208                             try: 
    209                                 action, data = message.split(' ', 1) 
    210                             except ValueError: 
    211                                 action = 'PI' 
    212                                 data = message 
    213                                  
    214                             if action in self.outboxes: 
    215                                 self.send(data, action)  
     191                        print "Received message: %s" % repr(message) 
     192                        try: 
     193                            action, data = message.split(' ', 1) 
     194                        except ValueError: 
     195                            action = 'PI' 
     196                            data = message 
     197                             
     198                        if action in self.outboxes: 
     199                            self.send(data, action)  
    216200 
    217201            if not self.anyReady(): 
  • oss/headstock/headstock/example/microblog/microblog/jabber/pubsub.py

    r695 r696  
    313313              attributes={u'term': unicode(tag)}, parent=entry) 
    314314         
    315         print entry.xml() 
    316315        return uuid, entry 
    317316         
     
    359358                node_id = self.recv("topurge") 
    360359                p = Node(unicode(self.from_jid), u'pubsub.%s' % self.xmpphost, 
    361                          node_name=self.pubsub_top_level_node
     360                         node_name=node_id
    362361                self.send(p, "purge") 
    363362 
  • oss/headstock/headstock/example/microblog/microblog/web/application.py

    r695 r696  
    3030        return tpl.render(profile=profile) 
    3131 
     32    def help(self): 
     33        tpl = self.tpl_lookup.get_template('help.mako') 
     34        return tpl.render() 
     35     
    3236    def signin(self): 
    3337        tpl = self.tpl_lookup.get_template('signin.mako') 
     
    9195 
    9296        controller = CollectionPagingHandler(c) 
    93         d.add('%s/paging' % route, GET=controller.GET) 
     97        d.add('%s/paging[/{start:digits}]' % route, GET=controller.GET) 
    9498 
    9599        controller = CollectionTagingHandler(c) 
  • oss/headstock/headstock/example/microblog/microblog/web/atompub.py

    r695 r696  
    208208        self.collection = collection 
    209209 
    210     def GET(self, start=0): 
     210    def GET(self, start): 
     211        if not start: start = 0 
    211212        start = int(start) 
    212213