Commits

Anonymous committed 14bf796

Updated useragent docs and changed import_string to use str.rsplit internally. (2.3 support was dropped a while ago)

  • Participants
  • Parent commits 68b88b8

Comments (0)

Files changed (4)

docs/datastructures.rst

 
    .. autoattribute:: no_transform
 
-.. autoclass:: UserAgent
-   :members:
-
 .. autoclass:: ETags
    :members:
 
 HTTP Helpers
 ============
 
+.. autoclass:: UserAgent
+   :members:
+
 .. autofunction:: dump_header
    
 .. autofunction:: cookie_date

werkzeug/useragents.py

 
     .. attribute:: platform
 
-       the browser platform
+       the browser platform.  The following platforms are currently
+       recognized:
+
+       -   `aix`
+       -   `amiga`
+       -   `android`
+       -   `bsd`
+       -   `hpux`
+       -   `iphone`
+       -   `irix`
+       -   `linux`
+       -   `macos`
+       -   `sco`
+       -   `solaris`
+       -   `wii`
+       -   `windows`
 
     .. attribute:: browser
 
-        the name of the browser
+        the name of the browser.  The following browsers are currently
+        recognized:
+
+        -   `aol` *
+        -   `ask` *
+        -   `camino`
+        -   `chrome`
+        -   `firefox`
+        -   `galeon`
+        -   `google` *
+        -   `kmeleon`
+        -   `konqueror`
+        -   `links`
+        -   `lynx`
+        -   `msie`
+        -   `msn`
+        -   `netscape`
+        -   `opera`
+        -   `safari`
+        -   `seamonkey`
+        -   `webkit`
+        -   `yahoo` *
+
+        (Browsers maked with a star (``*``) are crawlers.)
 
     .. attribute:: version
 

werkzeug/utils.py

 
 
 def secure_filename(filename):
-    """Pass it a filename and it will return a secure version of it.  This
+    r"""Pass it a filename and it will return a secure version of it.  This
     filename can then savely be stored on a regular file system and passed
     to :func:`os.path.join`.  The filename returned is an ASCII only string
     for maximum portability.
         if ':' in import_name:
             module, obj = import_name.split(':', 1)
         elif '.' in import_name:
-            items = import_name.split('.')
-            module = '.'.join(items[:-1])
-            obj = items[-1]
+            module, obj = import_name.rsplit('.', 1)
         else:
             return __import__(import_name)
         return getattr(__import__(module, None, None, [obj]), obj)