Konstantine Rybnikov  committed 4b8b57d Merge

merge pull request #6

  • Participants
  • Parent commits 58e3e97, 0da665e

Comments (0)

Files changed (3)

 Join me on jabber conference
-I am working on homepage at .
+I am working on homepage at ``_.
-Right now I am working on 0.1 release.
+It's in status of ideal suitability for "use and help polishing it",
+since some obvious improvements could be done.
-Main (and right now is the only) author is Kostya Rybnikov
-(`homepage in russian <>`_).
+Original author is `Konstantine Rybnikov
+<>`_. Current main developer is `Alexander
+Shorin <>`_
-You could be the next one.
+Great thanks to contributors:
+* `Brendan McCollam <>`_
+Feel free to be the next one.
 Where to go next?
-Go to the introduction page!
+Go to the `docs <>`_.

File examples/pirate_weather/

     'Amsterdam': u"+23 sunny. ARRRGH!!",
 def get_weather_for_city(city):
-	return (
+    return (
             u"Weather for %(city)s unknown. ARHG!!" % dict(city=city)))
 def get_weather_cities():
     return weather_dict.keys()
 def ping():
     return 'pong'
 def help():
     return (u'Type "weather in <city_name>" to get weather in that city.\n'
             u'Type "cities" to get list of cities.')
 def cities():
     return u', '.join(get_weather_cities())
 @app.route('weather in <city>')
 def weather(city):
-	return get_weather_for_city(city)
+    return get_weather_for_city(city)

File xmppflask/

         self.type = type
         self.greediness = 0
         self.redirect_to = redirect_to
         self._trace = None
         self._weights = None
         self._converters = None
         self._regex = None
         if defaults is not None:
             self.arguments = set(map(str, defaults))
             if self.defaults is not None:
             return result
     def build(self, values):
                     return False
         return True
     def __repr__(self):
         if is None:
             return u'<%s (unbound)>' % self.__class__.__name__
     def match_compare(self, other):
         """Compare this object with another one for matching.
-        Needed to match "hello world" rule before "hello" rule ("hello" 
+        Needed to match "hello world" rule before "hello" rule ("hello"
         must be later in search/match order).
 class Map(object):
     """Map of routes and their handlers"""
     #: for more on converters see
     default_converters = ImmutableDict(DEFAULT_CONVERTERS)
     def __init__(self, rules=None, converters=None):
         self._rules = []
         self._rules_by_endpoint = {}
         self._remap = True
         self.converters = self.default_converters.copy()
         if converters:
         for rulefactory in rules or ():
     def add(self, rulefactory):
         """Add a new rule to the map and bind it.
         :param rule: a :class:`Rule`
         for rule in rulefactory.get_rules(self):
                          message=environ.get('MESSAGE', ''),
     def update(self):
         if self._remap:
             self._rules.sort(lambda a, b: a.match_compare(b))
             for rules in self._rules_by_endpoint.itervalues():
-                rules.sort(lambda a, b: a.build_compare(b))
+                rules.sort(lambda a, b: a.match_compare(b))
             self._remap = False
 class MapAdapter(object):
         self.from_jid = from_jid
         self.type = type = map_
     def match(self, message=None, return_rule=False,
               event_type=None, from_jid=None, type=None):
         """The actual match func that is used to get endpoint (or rule) and
                 return rule.endpoint, rv
         raise NotFound()
     def build(self, endpoint, values=None):
         """Building messages that suite certain endpoint with valutes (params).
-        In XMPP world it might be not as must-have feature, but still it's 
+        In XMPP world it might be not as must-have feature, but still it's
         needed and nice.
                               if v is not None)
             values = {}
         rv = self._partial_build(endpoint, values)
         if rv is None:
             raise BuildError(endpoint, values)