| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,10 @@ | |||
| 1 | 1 | #!/usr/bin/env python | |
| 2 | - ''' | ||
| 2 | + """ | ||
| 3 | 3 | This file is part of python-webuntis | |
| 4 | 4 | ||
| 5 | 5 | :copyright: (c) 2012 by Markus Unterwaditzer. | |
| 6 | 6 | :license: BSD, see LICENSE for more details. | |
| 7 | - ''' | ||
| 7 | + """ | ||
| 8 | 8 | ||
| 9 | 9 | from setuptools import setup, find_packages | |
| 10 | 10 | from sys import version_info | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,9 @@ | |||
| 1 | - ''' | ||
| 1 | + """ | ||
| 2 | 2 | This file is part of python-webuntis | |
| 3 | 3 | ||
| 4 | 4 | :copyright: (c) 2012 by Markus Unterwaditzer. | |
| 5 | 5 | :license: BSD, see LICENSE for more details. | |
| 6 | - ''' | ||
| 6 | + """ | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | import re | |
@@ -54,8 +54,8 @@ def assertRaisesRegex(self, exc, regexp, callback, *a, **kw): | |||
| 54 | 54 | assert re.search(regexp, repr(excinfo.value)), excinfo.value | |
| 55 | 55 | ||
| 56 | 56 | def assert_strict_equal(self, x, *args): | |
| 57 | - '''Stricter version of assert_equal that doesn't do implicit conversion | ||
| 58 | - between unicode and strings''' | ||
| 57 | + """Stricter version of assert_equal that doesn't do implicit conversion | ||
| 58 | + between unicode and strings""" | ||
| 59 | 59 | for y in args: | |
| 60 | 60 | self._assert_strict_equal_impl(x, y) | |
| 61 | 61 | ||
@@ -115,15 +115,15 @@ def tearDown(self): | |||
| 115 | 115 | ||
| 116 | 116 | ||
| 117 | 117 | def mock_results(methods, swallow_not_found=False): | |
| 118 | - '''Mock API methods more easily. | ||
| 118 | + """Mock API methods more easily. | ||
| 119 | 119 | ||
| 120 | 120 | :type methods: dict | |
| 121 | 121 | :param methods: A dictionary containing one callable for each API method. | |
| 122 | 122 | ||
| 123 | 123 | :type swallow_not_found: bool | |
| 124 | 124 | :param swallow_not_found: Whether to return {'result': {}} on unmocked API | |
| 125 | 125 | methods. | |
| 126 | - ''' | ||
| 126 | + """ | ||
| 127 | 127 | def new(url, jsondata, headers, http_session): | |
| 128 | 128 | method = jsondata['method'] | |
| 129 | 129 | try: | |
@@ -148,8 +148,8 @@ def new(url, jsondata, headers, http_session): | |||
| 148 | 148 | ||
| 149 | 149 | ||
| 150 | 150 | def raw_vs_object(jsondata, result): | |
| 151 | - '''zip json data and results, but grouped by id instead of order. Also runs | ||
| 152 | - some checks that hashes are unique.''' | ||
| 151 | + """zip json data and results, but grouped by id instead of order. Also runs | ||
| 152 | + some checks that hashes are unique.""" | ||
| 153 | 153 | raw_lookup = dict((x['id'], x) for x in jsondata) | |
| 154 | 154 | known_hashes = set() | |
| 155 | 155 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,8 @@ | |||
| 1 | - ''' | ||
| 1 | + """ | ||
| 2 | 2 | This file is part of python-webuntis | |
| 3 | 3 | ||
| 4 | 4 | :copyright: (c) 2012 by Markus Unterwaditzer. | |
| 5 | 5 | :license: BSD, see LICENSE for more details. | |
| 6 | - ''' | ||
| 6 | + """ | ||
| 7 | 7 | __version__ = '0.1.9' | |
| 8 | 8 | from webuntis.session import Session | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,18 +1,18 @@ | |||
| 1 | - ''' | ||
| 1 | + """ | ||
| 2 | 2 | This file is part of python-webuntis | |
| 3 | 3 | ||
| 4 | 4 | :copyright: (c) 2013 by Markus Unterwaditzer. | |
| 5 | 5 | :license: BSD, see LICENSE for more details. | |
| 6 | - ''' | ||
| 6 | + """ | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | class Error(Exception): | |
| 10 | - '''Superclass for all `python-webuntis`-specific errors, never gets raised | ||
| 11 | - directly.''' | ||
| 10 | + """Superclass for all `python-webuntis`-specific errors, never gets raised | ||
| 11 | + directly.""" | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | class RemoteError(Error, IOError): | |
| 15 | - '''There was some kind of error while interacting with the server.''' | ||
| 15 | + """There was some kind of error while interacting with the server.""" | ||
| 16 | 16 | ||
| 17 | 17 | #: The decoded JSON request which lead to this error, if available. | |
| 18 | 18 | request = None | |
@@ -25,23 +25,23 @@ class RemoteError(Error, IOError): | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | class MethodNotFoundError(RemoteError): | |
| 28 | - '''The JSON-RPC method was not found. This really should not occur.''' | ||
| 28 | + """The JSON-RPC method was not found. This really should not occur.""" | ||
| 29 | 29 | pass | |
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | class AuthError(RemoteError): | |
| 33 | - '''Errors while logging in.''' | ||
| 33 | + """Errors while logging in.""" | ||
| 34 | 34 | pass | |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | 37 | class BadCredentialsError(AuthError, ValueError): | |
| 38 | - '''Invalid or missing username or password.''' | ||
| 38 | + """Invalid or missing username or password.""" | ||
| 39 | 39 | pass | |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | 42 | class NotLoggedInError(AuthError): | |
| 43 | - '''The session expired or we never logged in.''' | ||
| 43 | + """The session expired or we never logged in.""" | ||
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | 46 | class DateNotAllowed(RemoteError): | |
| 47 | - '''The selected date range (for timetable) is not allowed.''' | ||
| 47 | + """The selected date range (for timetable) is not allowed.""" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments