From 4f6b31d14ac2c1e29c97cc5eb2e08fd8067f6759 Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 16 Apr 2013 21:15:38 +0200 Subject: [PATCH 01/48] Add login check to torrentleech. closes #1635 --- couchpotato/core/providers/torrent/torrentleech/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/couchpotato/core/providers/torrent/torrentleech/main.py b/couchpotato/core/providers/torrent/torrentleech/main.py index 6de18fbd..4247c530 100644 --- a/couchpotato/core/providers/torrent/torrentleech/main.py +++ b/couchpotato/core/providers/torrent/torrentleech/main.py @@ -74,3 +74,6 @@ class TorrentLeech(TorrentProvider): 'remember_me': 'on', 'login': 'submit', }) + + def loginSuccess(self, output): + return '/user/account/logout' in output.lower() or 'welcome back' in output.lower() From 185a530b591bdcfcd5a0343be98638c69efefae7 Mon Sep 17 00:00:00 2001 From: mano3m <-> Date: Sat, 13 Apr 2013 12:45:47 +0200 Subject: [PATCH 02/48] only link for torrents not nzbs --- couchpotato/core/downloaders/base.py | 7 +++++++ couchpotato/core/plugins/renamer/__init__.py | 4 ++-- couchpotato/core/plugins/renamer/main.py | 13 ++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/couchpotato/core/downloaders/base.py b/couchpotato/core/downloaders/base.py index 8ccc1369..a78e0b18 100644 --- a/couchpotato/core/downloaders/base.py +++ b/couchpotato/core/downloaders/base.py @@ -39,6 +39,13 @@ class Downloader(Provider): addEvent('download.enabled_types', self.getEnabledDownloadType) addEvent('download.status', self._getAllDownloadStatus) addEvent('download.remove_failed', self._removeFailed) + addEvent('download.downloader_type', self.getDownloaderType) + + def getDownloaderType(self, downloader): + if self.getName() == downloader: + return self.type + + return [] def getEnabledDownloadType(self): for download_type in self.type: diff --git a/couchpotato/core/plugins/renamer/__init__.py b/couchpotato/core/plugins/renamer/__init__.py index 90f5c980..f3f7f66c 100644 --- a/couchpotato/core/plugins/renamer/__init__.py +++ b/couchpotato/core/plugins/renamer/__init__.py @@ -114,11 +114,11 @@ config = [{ }, { 'name': 'file_action', - 'label': 'File Action', + 'label': 'Torrent File Action', 'default': 'move', 'type': 'dropdown', 'values': [('Move', 'move'), ('Copy', 'copy'), ('Hard link', 'hardlink'), ('Sym link', 'symlink'), ('Move & Sym link', 'move_symlink')], - 'description': 'Define which kind of file operation you want to use. Before you start using hard links or sym links, PLEASE read about their possible drawbacks.', + 'description': 'Define which kind of file operation you want to use for torrents. Before you start using hard links or sym links, PLEASE read about their possible drawbacks.', 'advanced': True, }, { diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 87d9aaf3..807ee04c 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -118,7 +118,7 @@ class Renamer(Plugin): db = get_session() - # Get the release with the downloader ID that was downloded by the downloader + # Get the release with the downloader ID that was downloaded by the downloader download_info = None if download_id and downloader: rls = None @@ -137,6 +137,7 @@ class Renamer(Plugin): download_info = { 'imdb_id': rls.movie.library.identifier, 'quality': rls.quality.identifier, + 'is_torrent': any(downloader_type in fireEvent('download.downloader_type', downloader = downloader) for downloader_type in ['torrent', 'torrent_magnet']) } else: log.error('Download ID %s from downloader %s not found in releases', (download_id, downloader)) @@ -446,13 +447,13 @@ class Renamer(Plugin): self.makeDir(os.path.dirname(dst)) try: - self.moveFile(src, dst) + self.moveFile(src, dst, forcemove = not (download_info and download_info.get('is_torrent'))) group['renamed_files'].append(dst) except: log.error('Failed moving the file "%s" : %s', (os.path.basename(src), traceback.format_exc())) self.tagDir(group, 'failed_rename') - if self.conf('file_action') != 'move': + if self.conf('file_action') != 'move' and download_info and download_info.get('is_torrent'): self.tagDir(group, 'renamed already') # Remove matching releases @@ -518,10 +519,12 @@ Remove it if you want it to be renamed (again, or at least let it try again) self.createFile(ignore_file, text) - def moveFile(self, old, dest): + def moveFile(self, old, dest, forcemove = False): dest = ss(dest) try: - if self.conf('file_action') == 'hardlink': + if forcemove: + shutil.move(old, dest) + elif self.conf('file_action') == 'hardlink': link(old, dest) elif self.conf('file_action') == 'symlink': symlink(old, dest) From 0e90739786dd55a8cd7c719674973977f335ed5a Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 19 Apr 2013 14:49:27 +0200 Subject: [PATCH 03/48] Update to Tornado 3.0 --- couchpotato/core/_base/_core/main.py | 6 +- couchpotato/runner.py | 3 +- libs/tornado/__init__.py | 8 +- libs/tornado/auth.py | 472 ++++++++++++++----------- libs/tornado/autoreload.py | 31 +- libs/tornado/concurrent.py | 115 ++++-- libs/tornado/curl_httpclient.py | 18 +- libs/tornado/escape.py | 31 +- libs/tornado/gen.py | 204 +++++++++-- libs/tornado/httpclient.py | 177 +++++----- libs/tornado/httpserver.py | 162 +++++---- libs/tornado/httputil.py | 46 ++- libs/tornado/ioloop.py | 241 ++++++++----- libs/tornado/iostream.py | 102 +++--- libs/tornado/locale.py | 80 +++-- libs/tornado/netutil.py | 123 +++++-- libs/tornado/options.py | 64 ++-- libs/tornado/platform/caresresolver.py | 75 ++++ libs/tornado/platform/twisted.py | 102 +++++- libs/tornado/process.py | 16 +- libs/tornado/simple_httpclient.py | 65 ++-- libs/tornado/stack_context.py | 220 ++++++------ libs/tornado/tcpserver.py | 24 +- libs/tornado/template.py | 25 +- libs/tornado/testing.py | 222 +++++++----- libs/tornado/util.py | 50 ++- libs/tornado/web.py | 280 ++++++++------- libs/tornado/websocket.py | 108 +++--- libs/tornado/wsgi.py | 28 +- 29 files changed, 1932 insertions(+), 1166 deletions(-) create mode 100755 libs/tornado/platform/caresresolver.py diff --git a/couchpotato/core/_base/_core/main.py b/couchpotato/core/_base/_core/main.py index c91140fa..d2b6e2d3 100644 --- a/couchpotato/core/_base/_core/main.py +++ b/couchpotato/core/_base/_core/main.py @@ -79,7 +79,7 @@ class Core(Plugin): def shutdown(): self.initShutdown() - IOLoop.instance().add_callback(shutdown) + IOLoop.current().add_callback(shutdown) return 'shutdown' @@ -89,7 +89,7 @@ class Core(Plugin): def restart(): self.initShutdown(restart = True) - IOLoop.instance().add_callback(restart) + IOLoop.current().add_callback(restart) return 'restarting' @@ -128,7 +128,7 @@ class Core(Plugin): log.debug('Save to shutdown/restart') try: - IOLoop.instance().stop() + IOLoop.current().stop() except RuntimeError: pass except: diff --git a/couchpotato/runner.py b/couchpotato/runner.py index 0ae14ce0..26522178 100644 --- a/couchpotato/runner.py +++ b/couchpotato/runner.py @@ -241,7 +241,8 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En from tornado.ioloop import IOLoop web_container = WSGIContainer(app) web_container._log = _log - loop = IOLoop.instance() + loop = IOLoop.current() + application = Application([ (r'%s/api/%s/nonblock/(.*)/' % (url_base, api_key), NonBlockHandler), diff --git a/libs/tornado/__init__.py b/libs/tornado/__init__.py index 609e2c05..68434e18 100755 --- a/libs/tornado/__init__.py +++ b/libs/tornado/__init__.py @@ -23,7 +23,7 @@ from __future__ import absolute_import, division, print_function, with_statement # version_info is a four-tuple for programmatic comparison. The first # three numbers are the components of the version number. The fourth # is zero for an official release, positive for a development branch, -# or negative for a release candidate (after the base version number -# has been incremented) -version = "2.4.post3" -version_info = (2, 4, 0, 3) +# or negative for a release candidate or beta (after the base version +# number has been incremented) +version = "3.1.dev2" +version_info = (3, 1, 0, -99) diff --git a/libs/tornado/auth.py b/libs/tornado/auth.py index 0ff32cb2..df95884b 100755 --- a/libs/tornado/auth.py +++ b/libs/tornado/auth.py @@ -14,15 +14,19 @@ # License for the specific language governing permissions and limitations # under the License. -"""Implementations of various third-party authentication schemes. +"""This module contains implementations of various third-party +authentication schemes. -All the classes in this file are class Mixins designed to be used with -web.py RequestHandler classes. The primary methods for each service are -authenticate_redirect(), authorize_redirect(), and get_authenticated_user(). -The former should be called to redirect the user to, e.g., the OpenID -authentication page on the third party service, and the latter should -be called upon return to get the user data from the data returned by -the third party service. +All the classes in this file are class mixins designed to be used with +the `tornado.web.RequestHandler` class. They are used in two ways: + +* On a login handler, use methods such as ``authenticate_redirect()``, + ``authorize_redirect()``, and ``get_authenticated_user()`` to + establish the user's identity and store authentication tokens to your + database and/or cookies. +* In non-login handlers, use methods such as ``facebook_request()`` + or ``twitter_request()`` to use the authentication tokens to make + requests to the respective services. They all take slightly different arguments due to the fact all these services implement authentication and authorization slightly differently. @@ -30,18 +34,16 @@ See the individual service classes below for complete documentation. Example usage for Google OpenID:: - class GoogleHandler(tornado.web.RequestHandler, tornado.auth.GoogleMixin): + class GoogleLoginHandler(tornado.web.RequestHandler, + tornado.auth.GoogleMixin): @tornado.web.asynchronous + @tornado.gen.coroutine def get(self): if self.get_argument("openid.mode", None): - self.get_authenticated_user(self.async_callback(self._on_auth)) - return - self.authenticate_redirect() - - def _on_auth(self, user): - if not user: - raise tornado.web.HTTPError(500, "Google auth failed") - # Save the user with, e.g., set_secure_cookie() + user = yield self.get_authenticated_user() + # Save the user with e.g. set_secure_cookie() + else: + self.authenticate_redirect() """ from __future__ import absolute_import, division, print_function, with_statement @@ -72,9 +74,11 @@ try: except ImportError: import urllib as urllib_parse # py2 + class AuthError(Exception): pass + def _auth_future_to_callback(callback, future): try: result = future.result() @@ -83,6 +87,7 @@ def _auth_future_to_callback(callback, future): result = None callback(result) + def _auth_return_future(f): """Similar to tornado.concurrent.return_future, but uses the auth module's legacy callback interface. @@ -91,6 +96,7 @@ def _auth_return_future(f): inside the function will actually be a future. """ replacer = ArgReplacer(f, 'callback') + @functools.wraps(f) def wrapper(*args, **kwargs): future = Future() @@ -102,17 +108,23 @@ def _auth_return_future(f): return future return wrapper + class OpenIdMixin(object): """Abstract implementation of OpenID and Attribute Exchange. - See GoogleMixin below for example implementations. + See `GoogleMixin` below for a customized example (which also + includes OAuth support). + + Class attributes: + + * ``_OPENID_ENDPOINT``: the identity provider's URI. """ def authenticate_redirect(self, callback_uri=None, ax_attrs=["name", "email", "language", "username"]): - """Returns the authentication URL for this service. + """Redirects to the authentication URL for this service. After authentication, the service will redirect back to the given - callback URI. + callback URI with additional parameters including ``openid.mode``. We request the given attributes for the authenticated user by default (name, email, language, and username). If you don't need @@ -128,8 +140,12 @@ class OpenIdMixin(object): """Fetches the authenticated user data upon redirect. This method should be called by the handler that receives the - redirect from the authenticate_redirect() or authorize_redirect() - methods. + redirect from the `authenticate_redirect()` method (which is + often the same as the one that calls it; in that case you would + call `get_authenticated_user` if the ``openid.mode`` parameter + is present and `authenticate_redirect` if it is not). + + The result of this method will generally be used to set a cookie. """ # Verify the OpenID response via direct request to the OP args = dict((k, v[-1]) for k, v in self.request.arguments.items()) @@ -192,8 +208,8 @@ class OpenIdMixin(object): def _on_authentication_verified(self, future, response): if response.error or b"is_valid:true" not in response.body: future.set_exception(AuthError( - "Invalid OpenID response: %s" % (response.error or - response.body))) + "Invalid OpenID response: %s" % (response.error or + response.body))) return # Make sure we got back at least an email from attribute exchange @@ -250,32 +266,44 @@ class OpenIdMixin(object): future.set_result(user) def get_auth_http_client(self): - """Returns the AsyncHTTPClient instance to be used for auth requests. + """Returns the `.AsyncHTTPClient` instance to be used for auth requests. - May be overridden by subclasses to use an http client other than + May be overridden by subclasses to use an HTTP client other than the default. """ return httpclient.AsyncHTTPClient() class OAuthMixin(object): - """Abstract implementation of OAuth. + """Abstract implementation of OAuth 1.0 and 1.0a. - See TwitterMixin and FriendFeedMixin below for example implementations. + See `TwitterMixin` and `FriendFeedMixin` below for example implementations, + or `GoogleMixin` for an OAuth/OpenID hybrid. + + Class attributes: + + * ``_OAUTH_AUTHORIZE_URL``: The service's OAuth authorization url. + * ``_OAUTH_ACCESS_TOKEN_URL``: The service's OAuth access token url. + * ``_OAUTH_VERSION``: May be either "1.0" or "1.0a". + * ``_OAUTH_NO_CALLBACKS``: Set this to True if the service requires + advance registration of callbacks. + + Subclasses must also override the `_oauth_get_user_future` and + `_oauth_consumer_token` methods. """ def authorize_redirect(self, callback_uri=None, extra_params=None, http_client=None): """Redirects the user to obtain OAuth authorization for this service. - Twitter and FriendFeed both require that you register a Callback - URL with your application. You should call this method to log the - user in, and then call get_authenticated_user() in the handler - you registered as your Callback URL to complete the authorization - process. + The ``callback_uri`` may be omitted if you have previously + registered a callback URI with the third-party service. For some + sevices (including Twitter and Friendfeed), you must use a + previously-registered callback URI and cannot specify a callback + via this method. - This method sets a cookie called _oauth_request_token which is - subsequently used (and cleared) in get_authenticated_user for + This method sets a cookie called ``_oauth_request_token`` which is + subsequently used (and cleared) in `get_authenticated_user` for security purposes. """ if callback_uri and getattr(self, "_OAUTH_NO_CALLBACKS", False): @@ -299,15 +327,15 @@ class OAuthMixin(object): @_auth_return_future def get_authenticated_user(self, callback, http_client=None): - """Gets the OAuth authorized user and access token on callback. - - This method should be called from the handler for your registered - OAuth Callback URL to complete the registration process. We call - callback with the authenticated user, which in addition to standard - attributes like 'name' includes the 'access_key' attribute, which - contains the OAuth access you can use to make authorized requests - to this service on behalf of the user. + """Gets the OAuth authorized user and access token. + This method should be called from the handler for your + OAuth callback URL to complete the registration process. We run the + callback with the authenticated user dictionary. This dictionary + will contain an ``access_key`` which can be used to make authorized + requests to this service on behalf of the user. The dictionary will + also contain other fields such as ``name``, depending on the service + used. """ future = callback request_key = escape.utf8(self.get_argument("oauth_token")) @@ -315,13 +343,13 @@ class OAuthMixin(object): request_cookie = self.get_cookie("_oauth_request_token") if not request_cookie: future.set_exception(AuthError( - "Missing OAuth request token cookie")) + "Missing OAuth request token cookie")) return self.clear_cookie("_oauth_request_token") cookie_key, cookie_secret = [base64.b64decode(escape.utf8(i)) for i in request_cookie.split("|")] if cookie_key != request_key: future.set_exception(AuthError( - "Request token does not match cookie")) + "Request token does not match cookie")) return token = dict(key=cookie_key, secret=cookie_secret) if oauth_verifier: @@ -339,7 +367,7 @@ class OAuthMixin(object): oauth_signature_method="HMAC-SHA1", oauth_timestamp=str(int(time.time())), oauth_nonce=escape.to_basestring(binascii.b2a_hex(uuid.uuid4().bytes)), - oauth_version=getattr(self, "_OAUTH_VERSION", "1.0a"), + oauth_version="1.0", ) if getattr(self, "_OAUTH_VERSION", "1.0a") == "1.0a": if callback_uri == "oob": @@ -360,8 +388,8 @@ class OAuthMixin(object): if response.error: raise Exception("Could not get request token") request_token = _oauth_parse_response(response.body) - data = (base64.b64encode(request_token["key"]) + b"|" + - base64.b64encode(request_token["secret"])) + data = (base64.b64encode(escape.utf8(request_token["key"])) + b"|" + + base64.b64encode(escape.utf8(request_token["secret"]))) self.set_cookie("_oauth_request_token", data) args = dict(oauth_token=request_token["key"]) if callback_uri == "oob": @@ -381,7 +409,7 @@ class OAuthMixin(object): oauth_signature_method="HMAC-SHA1", oauth_timestamp=str(int(time.time())), oauth_nonce=escape.to_basestring(binascii.b2a_hex(uuid.uuid4().bytes)), - oauth_version=getattr(self, "_OAUTH_VERSION", "1.0a"), + oauth_version="1.0", ) if "verifier" in request_token: args["oauth_verifier"] = request_token["verifier"] @@ -405,8 +433,29 @@ class OAuthMixin(object): self._oauth_get_user_future(access_token).add_done_callback( self.async_callback(self._on_oauth_get_user, access_token, future)) + def _oauth_consumer_token(self): + """Subclasses must override this to return their OAuth consumer keys. + + The return value should be a `dict` with keys ``key`` and ``secret``. + """ + raise NotImplementedError() + @return_future def _oauth_get_user_future(self, access_token, callback): + """Subclasses must override this to get basic information about the + user. + + Should return a `.Future` whose result is a dictionary + containing information about the user, which may have been + retrieved by using ``access_token`` to make a request to the + service. + + The access token will be added to the returned dictionary to make + the result of `get_authenticated_user`. + + For backwards compatibility, the callback-based ``_oauth_get_user`` + method is also supported. + """ # By default, call the old-style _oauth_get_user, but new code # should override this method instead. self._oauth_get_user(access_token, callback) @@ -439,7 +488,7 @@ class OAuthMixin(object): oauth_signature_method="HMAC-SHA1", oauth_timestamp=str(int(time.time())), oauth_nonce=escape.to_basestring(binascii.b2a_hex(uuid.uuid4().bytes)), - oauth_version=getattr(self, "_OAUTH_VERSION", "1.0a"), + oauth_version="1.0", ) args = {} args.update(base_args) @@ -450,30 +499,38 @@ class OAuthMixin(object): else: signature = _oauth_signature(consumer_token, method, url, args, access_token) - base_args["oauth_signature"] = signature + base_args["oauth_signature"] = escape.to_basestring(signature) return base_args def get_auth_http_client(self): - """Returns the AsyncHTTPClient instance to be used for auth requests. + """Returns the `.AsyncHTTPClient` instance to be used for auth requests. - May be overridden by subclasses to use an http client other than + May be overridden by subclasses to use an HTTP client other than the default. """ return httpclient.AsyncHTTPClient() class OAuth2Mixin(object): - """Abstract implementation of OAuth v 2.""" + """Abstract implementation of OAuth 2.0. + + See `FacebookGraphMixin` below for an example implementation. + + Class attributes: + + * ``_OAUTH_AUTHORIZE_URL``: The service's authorization url. + * ``_OAUTH_ACCESS_TOKEN_URL``: The service's access token url. + """ def authorize_redirect(self, redirect_uri=None, client_id=None, client_secret=None, extra_params=None): """Redirects the user to obtain OAuth authorization for this service. - Some providers require that you register a Callback - URL with your application. You should call this method to log the - user in, and then call get_authenticated_user() in the handler - you registered as your Callback URL to complete the authorization - process. + Some providers require that you register a redirect URL with + your application instead of passing one via this method. You + should call this method to log the user in, and then call + ``get_authenticated_user`` in the handler for your + redirect URL to complete the authorization process. """ args = { "redirect_uri": redirect_uri, @@ -503,35 +560,30 @@ class TwitterMixin(OAuthMixin): """Twitter OAuth authentication. To authenticate with Twitter, register your application with - Twitter at http://twitter.com/apps. Then copy your Consumer Key and - Consumer Secret to the application settings 'twitter_consumer_key' and - 'twitter_consumer_secret'. Use this Mixin on the handler for the URL - you registered as your application's Callback URL. + Twitter at http://twitter.com/apps. Then copy your Consumer Key + and Consumer Secret to the application + `~tornado.web.Application.settings` ``twitter_consumer_key`` and + ``twitter_consumer_secret``. Use this mixin on the handler for the + URL you registered as your application's callback URL. - When your application is set up, you can use this Mixin like this + When your application is set up, you can use this mixin like this to authenticate the user with Twitter and get access to their stream:: - class TwitterHandler(tornado.web.RequestHandler, - tornado.auth.TwitterMixin): + class TwitterLoginHandler(tornado.web.RequestHandler, + tornado.auth.TwitterMixin): @tornado.web.asynchronous + @tornado.gen.coroutine def get(self): if self.get_argument("oauth_token", None): - self.get_authenticated_user(self.async_callback(self._on_auth)) - return - self.authorize_redirect() + user = yield self.get_authenticated_user() + # Save the user using e.g. set_secure_cookie() + else: + self.authorize_redirect() - def _on_auth(self, user): - if not user: - raise tornado.web.HTTPError(500, "Twitter auth failed") - # Save the user using, e.g., set_secure_cookie() - - The user object returned by get_authenticated_user() includes the - attributes 'username', 'name', and all of the custom Twitter user - attributes describe at - http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-users%C2%A0show - in addition to 'access_token'. You should save the access token with - the user; it is required to make requests on behalf of the user later - with twitter_request(). + The user object returned by `~OAuthMixin.get_authenticated_user` + includes the attributes ``username``, ``name``, ``access_token``, + and all of the custom Twitter user attributes described at + https://dev.twitter.com/docs/api/1.1/get/users/show """ _OAUTH_REQUEST_TOKEN_URL = "http://api.twitter.com/oauth/request_token" _OAUTH_ACCESS_TOKEN_URL = "http://api.twitter.com/oauth/access_token" @@ -541,7 +593,8 @@ class TwitterMixin(OAuthMixin): _TWITTER_BASE_URL = "http://api.twitter.com/1" def authenticate_redirect(self, callback_uri=None): - """Just like authorize_redirect(), but auto-redirects if authorized. + """Just like `~OAuthMixin.authorize_redirect`, but + auto-redirects if authorized. This is generally the right interface to use if you are using Twitter for single-sign on. @@ -553,35 +606,33 @@ class TwitterMixin(OAuthMixin): @_auth_return_future def twitter_request(self, path, callback=None, access_token=None, post_args=None, **args): - """Fetches the given API path, e.g., "/statuses/user_timeline/btaylor" + """Fetches the given API path, e.g., ``/statuses/user_timeline/btaylor`` - The path should not include the format (we automatically append - ".json" and parse the JSON output). + The path should not include the format or API version number. + (we automatically use JSON format and API version 1). - If the request is a POST, post_args should be provided. Query + If the request is a POST, ``post_args`` should be provided. Query string arguments should be given as keyword arguments. - All the Twitter methods are documented at - http://apiwiki.twitter.com/Twitter-API-Documentation. + All the Twitter methods are documented at http://dev.twitter.com/ - Many methods require an OAuth access token which you can obtain - through authorize_redirect() and get_authenticated_user(). The - user returned through that process includes an 'access_token' - attribute that can be used to make authenticated requests via - this method. Example usage:: + Many methods require an OAuth access token which you can + obtain through `~OAuthMixin.authorize_redirect` and + `~OAuthMixin.get_authenticated_user`. The user returned through that + process includes an 'access_token' attribute that can be used + to make authenticated requests via this method. Example + usage:: class MainHandler(tornado.web.RequestHandler, tornado.auth.TwitterMixin): @tornado.web.authenticated @tornado.web.asynchronous + @tornado.gen.coroutine def get(self): - self.twitter_request( + new_entry = yield self.twitter_request( "/statuses/update", post_args={"status": "Testing Tornado Web Server"}, - access_token=user["access_token"], - callback=self.async_callback(self._on_post)) - - def _on_post(self, new_entry): + access_token=self.current_user["access_token"]) if not new_entry: # Call failed; perhaps missing permission? self.authorize_redirect() @@ -617,8 +668,8 @@ class TwitterMixin(OAuthMixin): def _on_twitter_request(self, future, response): if response.error: future.set_exception(AuthError( - "Error response %s fetching %s" % (response.error, - response.request.url))) + "Error response %s fetching %s" % (response.error, + response.request.url))) return future.set_result(escape.json_decode(response.body)) @@ -629,49 +680,45 @@ class TwitterMixin(OAuthMixin): key=self.settings["twitter_consumer_key"], secret=self.settings["twitter_consumer_secret"]) - @return_future - @gen.engine - def _oauth_get_user_future(self, access_token, callback): + @gen.coroutine + def _oauth_get_user_future(self, access_token): user = yield self.twitter_request( - "/users/show/" + escape.native_str(access_token[b"screen_name"]), + "/users/show/" + escape.native_str(access_token["screen_name"]), access_token=access_token) if user: user["username"] = user["screen_name"] - callback(user) + raise gen.Return(user) class FriendFeedMixin(OAuthMixin): """FriendFeed OAuth authentication. To authenticate with FriendFeed, register your application with - FriendFeed at http://friendfeed.com/api/applications. Then - copy your Consumer Key and Consumer Secret to the application settings - 'friendfeed_consumer_key' and 'friendfeed_consumer_secret'. Use - this Mixin on the handler for the URL you registered as your - application's Callback URL. + FriendFeed at http://friendfeed.com/api/applications. Then copy + your Consumer Key and Consumer Secret to the application + `~tornado.web.Application.settings` ``friendfeed_consumer_key`` + and ``friendfeed_consumer_secret``. Use this mixin on the handler + for the URL you registered as your application's Callback URL. - When your application is set up, you can use this Mixin like this + When your application is set up, you can use this mixin like this to authenticate the user with FriendFeed and get access to their feed:: - class FriendFeedHandler(tornado.web.RequestHandler, - tornado.auth.FriendFeedMixin): + class FriendFeedLoginHandler(tornado.web.RequestHandler, + tornado.auth.FriendFeedMixin): @tornado.web.asynchronous + @tornado.gen.coroutine def get(self): if self.get_argument("oauth_token", None): - self.get_authenticated_user(self.async_callback(self._on_auth)) - return - self.authorize_redirect() + user = yield self.get_authenticated_user() + # Save the user using e.g. set_secure_cookie() + else: + self.authorize_redirect() - def _on_auth(self, user): - if not user: - raise tornado.web.HTTPError(500, "FriendFeed auth failed") - # Save the user using, e.g., set_secure_cookie() - - The user object returned by get_authenticated_user() includes the - attributes 'username', 'name', and 'description' in addition to - 'access_token'. You should save the access token with the user; + The user object returned by `~OAuthMixin.get_authenticated_user()` includes the + attributes ``username``, ``name``, and ``description`` in addition to + ``access_token``. You should save the access token with the user; it is required to make requests on behalf of the user later with - friendfeed_request(). + `friendfeed_request()`. """ _OAUTH_VERSION = "1.0" _OAUTH_REQUEST_TOKEN_URL = "https://friendfeed.com/account/oauth/request_token" @@ -685,30 +732,32 @@ class FriendFeedMixin(OAuthMixin): post_args=None, **args): """Fetches the given relative API path, e.g., "/bret/friends" - If the request is a POST, post_args should be provided. Query + If the request is a POST, ``post_args`` should be provided. Query string arguments should be given as keyword arguments. All the FriendFeed methods are documented at http://friendfeed.com/api/documentation. - Many methods require an OAuth access token which you can obtain - through authorize_redirect() and get_authenticated_user(). The - user returned through that process includes an 'access_token' - attribute that can be used to make authenticated requests via - this method. Example usage:: + Many methods require an OAuth access token which you can + obtain through `~OAuthMixin.authorize_redirect` and + `~OAuthMixin.get_authenticated_user`. The user returned + through that process includes an ``access_token`` attribute that + can be used to make authenticated requests via this + method. + + Example usage:: class MainHandler(tornado.web.RequestHandler, tornado.auth.FriendFeedMixin): @tornado.web.authenticated @tornado.web.asynchronous + @tornado.gen.coroutine def get(self): - self.friendfeed_request( + new_entry = yield self.friendfeed_request( "/entry", post_args={"body": "Testing Tornado Web Server"}, - access_token=self.current_user["access_token"], - callback=self.async_callback(self._on_post)) + access_token=self.current_user["access_token"]) - def _on_post(self, new_entry): if not new_entry: # Call failed; perhaps missing permission? self.authorize_redirect() @@ -739,8 +788,8 @@ class FriendFeedMixin(OAuthMixin): def _on_friendfeed_request(self, future, response): if response.error: future.set_exception(AuthError( - "Error response %s fetching %s" % (response.error, - response.request.url))) + "Error response %s fetching %s" % (response.error, + response.request.url))) return future.set_result(escape.json_decode(response.body)) @@ -751,9 +800,8 @@ class FriendFeedMixin(OAuthMixin): key=self.settings["friendfeed_consumer_key"], secret=self.settings["friendfeed_consumer_secret"]) - @return_future - @gen.engine - def _oauth_get_user(self, access_token, callback): + @gen.coroutine + def _oauth_get_user_future(self, access_token, callback): user = yield self.friendfeed_request( "/feedinfo/" + access_token["username"], include="id,name,description", access_token=access_token) @@ -770,26 +818,30 @@ class FriendFeedMixin(OAuthMixin): class GoogleMixin(OpenIdMixin, OAuthMixin): """Google Open ID / OAuth authentication. - No application registration is necessary to use Google for authentication - or to access Google resources on behalf of a user. To authenticate with - Google, redirect with authenticate_redirect(). On return, parse the - response with get_authenticated_user(). We send a dict containing the - values for the user, including 'email', 'name', and 'locale'. + No application registration is necessary to use Google for + authentication or to access Google resources on behalf of a user. + + Google implements both OpenID and OAuth in a hybrid mode. If you + just need the user's identity, use + `~OpenIdMixin.authenticate_redirect`. If you need to make + requests to Google on behalf of the user, use + `authorize_redirect`. On return, parse the response with + `~OpenIdMixin.get_authenticated_user`. We send a dict containing + the values for the user, including ``email``, ``name``, and + ``locale``. + Example usage:: - class GoogleHandler(tornado.web.RequestHandler, tornado.auth.GoogleMixin): + class GoogleLoginHandler(tornado.web.RequestHandler, + tornado.auth.GoogleMixin): @tornado.web.asynchronous + @tornado.gen.coroutine def get(self): if self.get_argument("openid.mode", None): - self.get_authenticated_user(self.async_callback(self._on_auth)) - return - self.authenticate_redirect() - - def _on_auth(self, user): - if not user: - raise tornado.web.HTTPError(500, "Google auth failed") - # Save the user with, e.g., set_secure_cookie() - + user = yield self.get_authenticated_user() + # Save the user with e.g. set_secure_cookie() + else: + self.authenticate_redirect() """ _OPENID_ENDPOINT = "https://www.google.com/accounts/o8/ud" _OAUTH_ACCESS_TOKEN_URL = "https://www.google.com/accounts/OAuthGetAccessToken" @@ -798,7 +850,8 @@ class GoogleMixin(OpenIdMixin, OAuthMixin): ax_attrs=["name", "email", "language", "username"]): """Authenticates and authorizes for the given Google resource. - Some of the available resources are: + Some of the available resources which can be used in the ``oauth_scope`` + argument are: * Gmail Contacts - http://www.google.com/m8/feeds/ * Calendar - http://www.google.com/calendar/feeds/ @@ -839,7 +892,7 @@ class GoogleMixin(OpenIdMixin, OAuthMixin): key=self.settings["google_consumer_key"], secret=self.settings["google_consumer_secret"]) - def _oauth_get_user_future(self, access_token, callback): + def _oauth_get_user_future(self, access_token): return OpenIdMixin.get_authenticated_user(self) @@ -853,9 +906,9 @@ class FacebookMixin(object): To authenticate with Facebook, register your application with Facebook at http://www.facebook.com/developers/apps.php. Then copy your API Key and Application Secret to the application settings - 'facebook_api_key' and 'facebook_secret'. + ``facebook_api_key`` and ``facebook_secret``. - When your application is set up, you can use this Mixin like this + When your application is set up, you can use this mixin like this to authenticate the user with Facebook:: class FacebookHandler(tornado.web.RequestHandler, @@ -872,11 +925,11 @@ class FacebookMixin(object): raise tornado.web.HTTPError(500, "Facebook auth failed") # Save the user using, e.g., set_secure_cookie() - The user object returned by get_authenticated_user() includes the - attributes 'facebook_uid' and 'name' in addition to session attributes - like 'session_key'. You should save the session key with the user; it is + The user object returned by `get_authenticated_user` includes the + attributes ``facebook_uid`` and ``name`` in addition to session attributes + like ``session_key``. You should save the session key with the user; it is required to make requests on behalf of the user later with - facebook_request(). + `facebook_request`. """ def authenticate_redirect(self, callback_uri=None, cancel_uri=None, extended_permissions=None): @@ -1029,9 +1082,9 @@ class FacebookMixin(object): return hashlib.md5(body).hexdigest() def get_auth_http_client(self): - """Returns the AsyncHTTPClient instance to be used for auth requests. + """Returns the `.AsyncHTTPClient` instance to be used for auth requests. - May be overridden by subclasses to use an http client other than + May be overridden by subclasses to use an HTTP client other than the default. """ return httpclient.AsyncHTTPClient() @@ -1043,6 +1096,7 @@ class FacebookGraphMixin(OAuth2Mixin): _OAUTH_AUTHORIZE_URL = "https://graph.facebook.com/oauth/authorize?" _OAUTH_NO_CALLBACKS = False + @_auth_return_future def get_authenticated_user(self, redirect_uri, client_id, client_secret, code, callback, extra_fields=None): """Handles the login for the Facebook user, returning a user object. @@ -1051,24 +1105,20 @@ class FacebookGraphMixin(OAuth2Mixin): class FacebookGraphLoginHandler(LoginHandler, tornado.auth.FacebookGraphMixin): @tornado.web.asynchronous + @tornado.gen.coroutine def get(self): if self.get_argument("code", False): - self.get_authenticated_user( - redirect_uri='/auth/facebookgraph/', - client_id=self.settings["facebook_api_key"], - client_secret=self.settings["facebook_secret"], - code=self.get_argument("code"), - callback=self.async_callback( - self._on_login)) - return - self.authorize_redirect(redirect_uri='/auth/facebookgraph/', - client_id=self.settings["facebook_api_key"], - extra_params={"scope": "read_stream,offline_access"}) - - def _on_login(self, user): - logging.error(user) - self.finish() - + user = yield self.get_authenticated_user( + redirect_uri='/auth/facebookgraph/', + client_id=self.settings["facebook_api_key"], + client_secret=self.settings["facebook_secret"], + code=self.get_argument("code")) + # Save the user with e.g. set_secure_cookie + else: + self.authorize_redirect( + redirect_uri='/auth/facebookgraph/', + client_id=self.settings["facebook_api_key"], + extra_params={"scope": "read_stream,offline_access"}) """ http = self.get_auth_http_client() args = { @@ -1088,10 +1138,9 @@ class FacebookGraphMixin(OAuth2Mixin): client_secret, callback, fields)) def _on_access_token(self, redirect_uri, client_id, client_secret, - callback, fields, response): + future, fields, response): if response.error: - gen_log.warning('Facebook auth error: %s' % str(response)) - callback(None) + future.set_exception(AuthError('Facebook auth error: %s' % str(response))) return args = escape.parse_qs_bytes(escape.native_str(response.body)) @@ -1103,14 +1152,14 @@ class FacebookGraphMixin(OAuth2Mixin): self.facebook_request( path="/me", callback=self.async_callback( - self._on_get_user_info, callback, session, fields), + self._on_get_user_info, future, session, fields), access_token=session["access_token"], fields=",".join(fields) ) - def _on_get_user_info(self, callback, session, fields, user): + def _on_get_user_info(self, future, session, fields, user): if user is None: - callback(None) + future.set_result(None) return fieldmap = {} @@ -1118,42 +1167,43 @@ class FacebookGraphMixin(OAuth2Mixin): fieldmap[field] = user.get(field) fieldmap.update({"access_token": session["access_token"], "session_expires": session.get("expires")}) - callback(fieldmap) + future.set_result(fieldmap) + @_auth_return_future def facebook_request(self, path, callback, access_token=None, post_args=None, **args): """Fetches the given relative API path, e.g., "/btaylor/picture" - If the request is a POST, post_args should be provided. Query + If the request is a POST, ``post_args`` should be provided. Query string arguments should be given as keyword arguments. An introduction to the Facebook Graph API can be found at http://developers.facebook.com/docs/api - Many methods require an OAuth access token which you can obtain - through authorize_redirect() and get_authenticated_user(). The - user returned through that process includes an 'access_token' - attribute that can be used to make authenticated requests via - this method. Example usage:: + Many methods require an OAuth access token which you can + obtain through `~OAuth2Mixin.authorize_redirect` and + `get_authenticated_user`. The user returned through that + process includes an ``access_token`` attribute that can be + used to make authenticated requests via this method. + + Example usage:: class MainHandler(tornado.web.RequestHandler, tornado.auth.FacebookGraphMixin): @tornado.web.authenticated @tornado.web.asynchronous + @tornado.gen.coroutine def get(self): - self.facebook_request( + new_entry = yield self.facebook_request( "/me/feed", post_args={"message": "I am posting from my Tornado application!"}, - access_token=self.current_user["access_token"], - callback=self.async_callback(self._on_post)) + access_token=self.current_user["access_token"]) - def _on_post(self, new_entry): if not new_entry: # Call failed; perhaps missing permission? self.authorize_redirect() return self.finish("Posted a message!") - """ url = "https://graph.facebook.com" + path all_args = {} @@ -1171,18 +1221,18 @@ class FacebookGraphMixin(OAuth2Mixin): else: http.fetch(url, callback=callback) - def _on_facebook_request(self, callback, response): + def _on_facebook_request(self, future, response): if response.error: - gen_log.warning("Error response %s fetching %s", response.error, - response.request.url) - callback(None) + future.set_exception(AuthError("Error response %s fetching %s", + response.error, response.request.url)) return - callback(escape.json_decode(response.body)) + + future.set_result(escape.json_decode(response.body)) def get_auth_http_client(self): - """Returns the AsyncHTTPClient instance to be used for auth requests. + """Returns the `.AsyncHTTPClient` instance to be used for auth requests. - May be overridden by subclasses to use an http client other than + May be overridden by subclasses to use an HTTP client other than the default. """ return httpclient.AsyncHTTPClient() @@ -1243,10 +1293,14 @@ def _oauth_escape(val): def _oauth_parse_response(body): - p = escape.parse_qs(body, keep_blank_values=False) - token = dict(key=p[b"oauth_token"][0], secret=p[b"oauth_token_secret"][0]) + # I can't find an officially-defined encoding for oauth responses and + # have never seen anyone use non-ascii. Leave the response in a byte + # string for python 2, and use utf8 on python 3. + body = escape.native_str(body) + p = urlparse.parse_qs(body, keep_blank_values=False) + token = dict(key=p["oauth_token"][0], secret=p["oauth_token_secret"][0]) # Add the extra parameters the Provider included to the token - special = (b"oauth_token", b"oauth_token_secret") + special = ("oauth_token", "oauth_token_secret") token.update((k, p[k][0]) for k in p if k not in special) return token diff --git a/libs/tornado/autoreload.py b/libs/tornado/autoreload.py index 4e424878..05754299 100755 --- a/libs/tornado/autoreload.py +++ b/libs/tornado/autoreload.py @@ -14,15 +14,24 @@ # License for the specific language governing permissions and limitations # under the License. -"""A module to automatically restart the server when a module is modified. +"""xAutomatically restart the server when a source file is modified. -Most applications should not call this module directly. Instead, pass the +Most applications should not access this module directly. Instead, pass the keyword argument ``debug=True`` to the `tornado.web.Application` constructor. This will enable autoreload mode as well as checking for changes to templates -and static resources. +and static resources. Note that restarting is a destructive operation +and any requests in progress will be aborted when the process restarts. -This module depends on IOLoop, so it will not work in WSGI applications -and Google AppEngine. It also will not work correctly when HTTPServer's +This module can also be used as a command-line wrapper around scripts +such as unit test runners. See the `main` method for details. + +The command-line wrapper and Application debug modes can be used together. +This combination is encouraged as the wrapper catches syntax errors and +other import-time failures, while debug mode catches changes once +the server has started. + +This module depends on `.IOLoop`, so it will not work in WSGI applications +and Google App Engine. It also will not work correctly when `.HTTPServer`'s multi-process mode is used. Reloading loses any Python interpreter command-line arguments (e.g. ``-u``) @@ -94,12 +103,8 @@ _io_loops = weakref.WeakKeyDictionary() def start(io_loop=None, check_time=500): - """Restarts the process automatically when a module is modified. - - We run on the I/O loop, and restarting is a destructive operation, - so will terminate any pending requests. - """ - io_loop = io_loop or ioloop.IOLoop.instance() + """Begins watching source files for changes using the given `.IOLoop`. """ + io_loop = io_loop or ioloop.IOLoop.current() if io_loop in _io_loops: return _io_loops[io_loop] = True @@ -137,8 +142,8 @@ def add_reload_hook(fn): Note that for open file and socket handles it is generally preferable to set the ``FD_CLOEXEC`` flag (using `fcntl` or - `tornado.platform.auto.set_close_exec`) instead of using a reload - hook to close them. + ``tornado.platform.auto.set_close_exec``) instead + of using a reload hook to close them. """ _reload_hooks.append(fn) diff --git a/libs/tornado/concurrent.py b/libs/tornado/concurrent.py index 59075a3a..15a039ca 100755 --- a/libs/tornado/concurrent.py +++ b/libs/tornado/concurrent.py @@ -13,12 +13,21 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +"""Utilities for working with threads and ``Futures``. + +``Futures`` are a pattern for concurrent programming introduced in +Python 3.2 in the `concurrent.futures` package (this package has also +been backported to older versions of Python and can be installed with +``pip install futures``). Tornado will use `concurrent.futures.Future` if +it is available; otherwise it will use a compatible class defined in this +module. +""" from __future__ import absolute_import, division, print_function, with_statement import functools import sys -from tornado.stack_context import ExceptionStackContext +from tornado.stack_context import ExceptionStackContext, wrap from tornado.util import raise_exc_info, ArgReplacer try: @@ -26,10 +35,12 @@ try: except ImportError: futures = None + class ReturnValueIgnoredError(Exception): pass -class DummyFuture(object): + +class _DummyFuture(object): def __init__(self): self._done = False self._result = None @@ -87,50 +98,92 @@ class DummyFuture(object): self._callbacks = None if futures is None: - Future = DummyFuture + Future = _DummyFuture else: Future = futures.Future +class TracebackFuture(Future): + """Subclass of `Future` which can store a traceback with + exceptions. + + The traceback is automatically available in Python 3, but in the + Python 2 futures backport this information is discarded. + """ + def __init__(self): + super(TracebackFuture, self).__init__() + self.__exc_info = None + + def exc_info(self): + return self.__exc_info + + def set_exc_info(self, exc_info): + """Traceback-aware replacement for + `~concurrent.futures.Future.set_exception`. + """ + self.__exc_info = exc_info + self.set_exception(exc_info[1]) + + def result(self): + if self.__exc_info is not None: + raise_exc_info(self.__exc_info) + else: + return super(TracebackFuture, self).result() + + class DummyExecutor(object): def submit(self, fn, *args, **kwargs): - future = Future() + future = TracebackFuture() try: future.set_result(fn(*args, **kwargs)) - except Exception as e: - future.set_exception(e) + except Exception: + future.set_exc_info(sys.exc_info()) return future dummy_executor = DummyExecutor() def run_on_executor(fn): + """Decorator to run a synchronous method asynchronously on an executor. + + The decorated method may be called with a ``callback`` keyword + argument and returns a future. + """ @functools.wraps(fn) def wrapper(self, *args, **kwargs): callback = kwargs.pop("callback", None) future = self.executor.submit(fn, self, *args, **kwargs) if callback: - self.io_loop.add_future(future, callback) + self.io_loop.add_future(future, + lambda future: callback(future.result())) return future return wrapper +_NO_RESULT = object() + + def return_future(f): - """Decorator to make a function that returns via callback return a `Future`. + """Decorator to make a function that returns via callback return a + `Future`. The wrapped function should take a ``callback`` keyword argument and invoke it with one argument when it has finished. To signal failure, the function can simply raise an exception (which will be - captured by the `stack_context` and passed along to the `Future`). + captured by the `.StackContext` and passed along to the ``Future``). From the caller's perspective, the callback argument is optional. If one is given, it will be invoked when the function is complete - with the `Future` as an argument. If no callback is given, the caller - should use the `Future` to wait for the function to complete - (perhaps by yielding it in a `gen.engine` function, or passing it - to `IOLoop.add_future`). + with `Future.result()` as an argument. If the function fails, the + callback will not be run and an exception will be raised into the + surrounding `.StackContext`. + + If no callback is given, the caller should use the ``Future`` to + wait for the function to complete (perhaps by yielding it in a + `.gen.engine` function, or passing it to `.IOLoop.add_future`). Usage:: + @return_future def future_func(arg1, arg2, callback): # Do stuff (possibly asynchronous) @@ -142,19 +195,20 @@ def return_future(f): callback() Note that ``@return_future`` and ``@gen.engine`` can be applied to the - same function, provided ``@return_future`` appears first. + same function, provided ``@return_future`` appears first. However, + consider using ``@gen.coroutine`` instead of this combination. """ replacer = ArgReplacer(f, 'callback') + @functools.wraps(f) def wrapper(*args, **kwargs): - future = Future() - callback, args, kwargs = replacer.replace(future.set_result, - args, kwargs) - if callback is not None: - future.add_done_callback(callback) + future = TracebackFuture() + callback, args, kwargs = replacer.replace( + lambda value=_NO_RESULT: future.set_result(value), + args, kwargs) def handle_error(typ, value, tb): - future.set_exception(value) + future.set_exc_info((typ, value, tb)) return True exc_info = None with ExceptionStackContext(handle_error): @@ -172,9 +226,25 @@ def return_future(f): # go ahead and raise it to the caller directly without waiting # for them to inspect the Future. raise_exc_info(exc_info) + + # If the caller passed in a callback, schedule it to be called + # when the future resolves. It is important that this happens + # just before we return the future, or else we risk confusing + # stack contexts with multiple exceptions (one here with the + # immediate exception, and again when the future resolves and + # the callback triggers its exception by calling future.result()). + if callback is not None: + def run_callback(future): + result = future.result() + if result is _NO_RESULT: + callback() + else: + callback(future.result()) + future.add_done_callback(wrap(run_callback)) return future return wrapper + def chain_future(a, b): """Chain two futures together so that when one completes, so does the other. @@ -182,7 +252,10 @@ def chain_future(a, b): """ def copy(future): assert future is a - if a.exception() is not None: + if (isinstance(a, TracebackFuture) and isinstance(b, TracebackFuture) + and a.exc_info() is not None): + b.set_exc_info(a.exc_info()) + elif a.exception() is not None: b.set_exception(a.exception()) else: b.set_result(a.result()) diff --git a/libs/tornado/curl_httpclient.py b/libs/tornado/curl_httpclient.py index f46ea7b8..adc2314f 100755 --- a/libs/tornado/curl_httpclient.py +++ b/libs/tornado/curl_httpclient.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""Blocking and non-blocking HTTP client implementations using pycurl.""" +"""Non-blocking HTTP client implementation using pycurl.""" from __future__ import absolute_import, division, print_function, with_statement @@ -30,7 +30,8 @@ from tornado.log import gen_log from tornado import stack_context from tornado.escape import utf8, native_str -from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy +from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main +from tornado.util import bytes_type try: from io import BytesIO # py3 @@ -171,7 +172,7 @@ class CurlAsyncHTTPClient(AsyncHTTPClient): # libcurl is ready. After each timeout, resync the scheduled # timeout with libcurl's current state. new_timeout = self._multi.timeout() - if new_timeout != -1: + if new_timeout >= 0: self._set_timeout(new_timeout) def _handle_force_timeout(self): @@ -319,7 +320,7 @@ def _curl_setup_request(curl, request, buffer, headers): write_function = request.streaming_callback else: write_function = buffer.write - if type(b'') is type(''): # py2 + if bytes_type is str: # py2 curl.setopt(pycurl.WRITEFUNCTION, write_function) else: # py3 # Upstream pycurl doesn't support py3, but ubuntu 12.10 includes @@ -410,7 +411,14 @@ def _curl_setup_request(curl, request, buffer, headers): if request.auth_username is not None: userpwd = "%s:%s" % (request.auth_username, request.auth_password or '') - curl.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_BASIC) + + if request.auth_mode is None or request.auth_mode == "basic": + curl.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_BASIC) + elif request.auth_mode == "digest": + curl.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_DIGEST) + else: + raise ValueError("Unsupported auth_mode %s" % request.auth_mode) + curl.setopt(pycurl.USERPWD, native_str(userpwd)) gen_log.debug("%s %s (username: %r)", request.method, request.url, request.auth_username) diff --git a/libs/tornado/escape.py b/libs/tornado/escape.py index 6d72532d..016fdade 100755 --- a/libs/tornado/escape.py +++ b/libs/tornado/escape.py @@ -28,9 +28,9 @@ import sys from tornado.util import bytes_type, unicode_type, basestring_type, u try: - from urllib.parse import parse_qs # py3 + from urllib.parse import parse_qs as _parse_qs # py3 except ImportError: - from urlparse import parse_qs # Python 2.6+ + from urlparse import parse_qs as _parse_qs # Python 2.6+ try: import htmlentitydefs # py2 @@ -54,7 +54,7 @@ _XHTML_ESCAPE_DICT = {'&': '&', '<': '<', '>': '>', '"': '"'} def xhtml_escape(value): - """Escapes a string so it is valid within XML or XHTML.""" + """Escapes a string so it is valid within HTML or XML.""" return _XHTML_ESCAPE_RE.sub(lambda match: _XHTML_ESCAPE_DICT[match.group(0)], to_basestring(value)) @@ -72,7 +72,7 @@ def json_encode(value): # the javscript. Some json libraries do this escaping by default, # although python's standard library does not, so we do it here. # http://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped - return json.dumps(recursive_unicode(value)).replace("`, + which use ``self.finish()`` in place of a callback argument. """ @functools.wraps(func) def wrapper(*args, **kwargs): @@ -116,20 +136,129 @@ def engine(func): if runner is not None: return runner.handle_exception(typ, value, tb) return False - with ExceptionStackContext(handle_exception) as deactivate: - gen = func(*args, **kwargs) - if isinstance(gen, types.GeneratorType): - runner = Runner(gen, deactivate) - runner.run() - return - assert gen is None, gen - deactivate() + with ExceptionStackContext(handle_exception): + try: + result = func(*args, **kwargs) + except (Return, StopIteration) as e: + result = getattr(e, 'value', None) + else: + if isinstance(result, types.GeneratorType): + def final_callback(value): + if value is not None: + raise ReturnValueIgnoredError( + "@gen.engine functions cannot return values: " + "%r" % (value,)) + assert value is None + runner = Runner(result, final_callback) + runner.run() + return + if result is not None: + raise ReturnValueIgnoredError( + "@gen.engine functions cannot return values: %r" % + (result,)) # no yield, so we're done return wrapper +def coroutine(func): + """Decorator for asynchronous generators. + + Any generator that yields objects from this module must be wrapped + in either this decorator or `engine`. These decorators only work + on functions that are already asynchronous. For + `~tornado.web.RequestHandler` :ref:`HTTP verb methods ` methods, this + means that both the `tornado.web.asynchronous` and + `tornado.gen.coroutine` decorators must be used (for proper + exception handling, ``asynchronous`` should come before + ``gen.coroutine``). + + Coroutines may "return" by raising the special exception + `Return(value) `. In Python 3.3+, it is also possible for + the function to simply use the ``return value`` statement (prior to + Python 3.3 generators were not allowed to also return values). + In all versions of Python a coroutine that simply wishes to exit + early may use the ``return`` statement without a value. + + Functions with this decorator return a `.Future`. Additionally, + they may be called with a ``callback`` keyword argument, which + will be invoked with the future's result when it resolves. If the + coroutine fails, the callback will not be run and an exception + will be raised into the surrounding `.StackContext`. The + ``callback`` argument is not visible inside the decorated + function; it is handled by the decorator itself. + + From the caller's perspective, ``@gen.coroutine`` is similar to + the combination of ``@return_future`` and ``@gen.engine``. + """ + @functools.wraps(func) + def wrapper(*args, **kwargs): + runner = None + future = TracebackFuture() + + if 'callback' in kwargs: + callback = kwargs.pop('callback') + IOLoop.current().add_future( + future, lambda future: callback(future.result())) + + def handle_exception(typ, value, tb): + try: + if runner is not None and runner.handle_exception(typ, value, tb): + return True + except Exception: + typ, value, tb = sys.exc_info() + future.set_exc_info((typ, value, tb)) + return True + with ExceptionStackContext(handle_exception): + try: + result = func(*args, **kwargs) + except (Return, StopIteration) as e: + result = getattr(e, 'value', None) + except Exception: + future.set_exc_info(sys.exc_info()) + return future + else: + if isinstance(result, types.GeneratorType): + def final_callback(value): + future.set_result(value) + runner = Runner(result, final_callback) + runner.run() + return future + future.set_result(result) + return future + return wrapper + + +class Return(Exception): + """Special exception to return a value from a `coroutine`. + + If this exception is raised, its value argument is used as the + result of the coroutine:: + + @gen.coroutine + def fetch_json(url): + response = yield AsyncHTTPClient().fetch(url) + raise gen.Return(json_decode(response.body)) + + In Python 3.3, this exception is no longer necessary: the ``return`` + statement can be used directly to return a value (previously + ``yield`` and ``return`` with a value could not be combined in the + same function). + + By analogy with the return statement, the value argument is optional, + but it is never necessary to ``raise gen.Return()``. The ``return`` + statement can be used with no arguments instead. + """ + def __init__(self, value=None): + super(Return, self).__init__() + self.value = value + + class YieldPoint(object): - """Base class for objects that may be yielded from the generator.""" + """Base class for objects that may be yielded from the generator. + + Applications do not normally need to use this class, but it may be + subclassed to provide additional yielding behavior. + """ def start(self, runner): """Called by the runner after the generator has yielded. @@ -195,7 +324,7 @@ class Wait(YieldPoint): class WaitAll(YieldPoint): - """Returns the results of multiple previous `Callbacks`. + """Returns the results of multiple previous `Callbacks `. The argument is a sequence of `Callback` keys, and the result is a list of results in the same order. @@ -291,7 +420,7 @@ class Multi(YieldPoint): def is_ready(self): finished = list(itertools.takewhile( - lambda i: i.is_ready(), self.unfinished_children)) + lambda i: i.is_ready(), self.unfinished_children)) self.unfinished_children.difference_update(finished) return not self.unfinished_children @@ -331,13 +460,13 @@ class Runner(object): def register_callback(self, key): """Adds ``key`` to the list of callbacks.""" if key in self.pending_callbacks: - raise KeyReuseError("key %r is already pending" % key) + raise KeyReuseError("key %r is already pending" % (key,)) self.pending_callbacks.add(key) def is_ready(self, key): """Returns true if a result is available for ``key``.""" if key not in self.pending_callbacks: - raise UnknownKeyError("key %r is not pending" % key) + raise UnknownKeyError("key %r is not pending" % (key,)) return key in self.results def set_result(self, key, result): @@ -374,7 +503,7 @@ class Runner(object): yielded = self.gen.throw(*exc_info) else: yielded = self.gen.send(next) - except StopIteration: + except (StopIteration, Return) as e: self.finished = True if self.pending_callbacks and not self.had_exception: # If we ran cleanly without waiting on all callbacks @@ -384,7 +513,7 @@ class Runner(object): raise LeakedCallbackError( "finished without waiting for callbacks %r" % self.pending_callbacks) - self.final_callback() + self.final_callback(getattr(e, 'value', None)) self.final_callback = None return except Exception: @@ -401,7 +530,8 @@ class Runner(object): except Exception: self.exc_info = sys.exc_info() else: - self.exc_info = (BadYieldError("yielded unknown object %r" % yielded),) + self.exc_info = (BadYieldError( + "yielded unknown object %r" % (yielded,)),) finally: self.running = False @@ -414,7 +544,7 @@ class Runner(object): else: result = None self.set_result(key, result) - return inner + return wrap(inner) def handle_exception(self, typ, value, tb): if not self.running and not self.finished: diff --git a/libs/tornado/httpclient.py b/libs/tornado/httpclient.py index 1b645504..551fd0b1 100755 --- a/libs/tornado/httpclient.py +++ b/libs/tornado/httpclient.py @@ -1,36 +1,35 @@ """Blocking and non-blocking HTTP client interfaces. This module defines a common interface shared by two implementations, -`simple_httpclient` and `curl_httpclient`. Applications may either +``simple_httpclient`` and ``curl_httpclient``. Applications may either instantiate their chosen implementation class directly or use the `AsyncHTTPClient` class from this module, which selects an implementation that can be overridden with the `AsyncHTTPClient.configure` method. -The default implementation is `simple_httpclient`, and this is expected +The default implementation is ``simple_httpclient``, and this is expected to be suitable for most users' needs. However, some applications may wish -to switch to `curl_httpclient` for reasons such as the following: +to switch to ``curl_httpclient`` for reasons such as the following: -* `curl_httpclient` has some features not found in `simple_httpclient`, +* ``curl_httpclient`` has some features not found in ``simple_httpclient``, including support for HTTP proxies and the ability to use a specified network interface. -* `curl_httpclient` is more likely to be compatible with sites that are +* ``curl_httpclient`` is more likely to be compatible with sites that are not-quite-compliant with the HTTP spec, or sites that use little-exercised features of HTTP. -* `simple_httpclient` only supports SSL on Python 2.6 and above. +* ``curl_httpclient`` is faster. -* `curl_httpclient` is faster +* ``curl_httpclient`` was the default prior to Tornado 2.0. -* `curl_httpclient` was the default prior to Tornado 2.0. - -Note that if you are using `curl_httpclient`, it is highly recommended that +Note that if you are using ``curl_httpclient``, it is highly recommended that you use a recent version of ``libcurl`` and ``pycurl``. Currently the minimum supported version is 7.18.2, and the recommended version is 7.21.1 or newer. """ from __future__ import absolute_import, division, print_function, with_statement +import functools import time import weakref @@ -52,15 +51,15 @@ class HTTPClient(object): try: response = http_client.fetch("http://www.google.com/") print response.body - except httpclient.HTTPError, e: + except httpclient.HTTPError as e: print "Error:", e + httpclient.close() """ def __init__(self, async_client_class=None, **kwargs): self._io_loop = IOLoop() if async_client_class is None: async_client_class = AsyncHTTPClient self._async_client = async_client_class(self._io_loop, **kwargs) - self._response = None self._closed = False def __del__(self): @@ -82,13 +81,8 @@ class HTTPClient(object): If an error occurs during the fetch, we raise an `HTTPError`. """ - def callback(response): - self._response = response - self._io_loop.stop() - self._async_client.fetch(request, callback, **kwargs) - self._io_loop.start() - response = self._response - self._response = None + response = self._io_loop.run_sync(functools.partial( + self._async_client.fetch, request, **kwargs)) response.rethrow() return response @@ -98,26 +92,23 @@ class AsyncHTTPClient(Configurable): Example usage:: - import ioloop - def handle_request(response): if response.error: print "Error:", response.error else: print response.body - ioloop.IOLoop.instance().stop() - http_client = httpclient.AsyncHTTPClient() + http_client = AsyncHTTPClient() http_client.fetch("http://www.google.com/", handle_request) - ioloop.IOLoop.instance().start() - The constructor for this class is magic in several respects: It actually - creates an instance of an implementation-specific subclass, and instances - are reused as a kind of pseudo-singleton (one per IOLoop). The keyword - argument force_instance=True can be used to suppress this singleton - behavior. Constructor arguments other than io_loop and force_instance - are deprecated. The implementation subclass as well as arguments to - its constructor can be set with the static method configure() + The constructor for this class is magic in several respects: It + actually creates an instance of an implementation-specific + subclass, and instances are reused as a kind of pseudo-singleton + (one per `.IOLoop`). The keyword argument ``force_instance=True`` + can be used to suppress this singleton behavior. Constructor + arguments other than ``io_loop`` and ``force_instance`` are + deprecated. The implementation subclass as well as arguments to + its constructor can be set with the static method `configure()` """ @classmethod def configurable_base(cls): @@ -136,7 +127,7 @@ class AsyncHTTPClient(Configurable): return getattr(cls, attr_name) def __new__(cls, io_loop=None, force_instance=False, **kwargs): - io_loop = io_loop or IOLoop.instance() + io_loop = io_loop or IOLoop.current() if io_loop in cls._async_clients() and not force_instance: return cls._async_clients()[io_loop] instance = super(AsyncHTTPClient, cls).__new__(cls, io_loop=io_loop, @@ -152,25 +143,29 @@ class AsyncHTTPClient(Configurable): self.defaults.update(defaults) def close(self): - """Destroys this http client, freeing any file descriptors used. + """Destroys this HTTP client, freeing any file descriptors used. Not needed in normal use, but may be helpful in unittests that create and destroy http clients. No other methods may be called - on the AsyncHTTPClient after close(). + on the `AsyncHTTPClient` after ``close()``. """ if self._async_clients().get(self.io_loop) is self: del self._async_clients()[self.io_loop] def fetch(self, request, callback=None, **kwargs): - """Executes a request, calling callback with an `HTTPResponse`. + """Executes a request, asynchronously returning an `HTTPResponse`. The request may be either a string URL or an `HTTPRequest` object. If it is a string, we construct an `HTTPRequest` using any additional kwargs: ``HTTPRequest(request, **kwargs)`` - If an error occurs during the fetch, the HTTPResponse given to the - callback has a non-None error attribute that contains the exception - encountered during the request. You can call response.rethrow() to - throw the exception (if any) in the callback. + This method returns a `.Future` whose result is an + `HTTPResponse`. The ``Future`` wil raise an `HTTPError` if + the request returned a non-200 response code. + + If a ``callback`` is given, it will be invoked with the `HTTPResponse`. + In the callback interface, `HTTPError` is not automatically raised. + Instead, you must check the response's ``error`` attribute or + call its `~HTTPResponse.rethrow` method. """ if not isinstance(request, HTTPRequest): request = HTTPRequest(url=request, **kwargs) @@ -182,6 +177,7 @@ class AsyncHTTPClient(Configurable): future = Future() if callback is not None: callback = stack_context.wrap(callback) + def handle_future(future): exc = future.exception() if isinstance(exc, HTTPError) and exc.response is not None: @@ -194,6 +190,7 @@ class AsyncHTTPClient(Configurable): response = future.result() self.io_loop.add_callback(callback, response) future.add_done_callback(handle_future) + def handle_response(response): if response.error: future.set_exception(response.error) @@ -207,19 +204,19 @@ class AsyncHTTPClient(Configurable): @classmethod def configure(cls, impl, **kwargs): - """Configures the AsyncHTTPClient subclass to use. + """Configures the `AsyncHTTPClient` subclass to use. - AsyncHTTPClient() actually creates an instance of a subclass. + ``AsyncHTTPClient()`` actually creates an instance of a subclass. This method may be called with either a class object or the - fully-qualified name of such a class (or None to use the default, - SimpleAsyncHTTPClient) + fully-qualified name of such a class (or ``None`` to use the default, + ``SimpleAsyncHTTPClient``) If additional keyword arguments are given, they will be passed to the constructor of each subclass instance created. The - keyword argument max_clients determines the maximum number of - simultaneous fetch() operations that can execute in parallel - on each IOLoop. Additional arguments may be supported depending - on the implementation class in use. + keyword argument ``max_clients`` determines the maximum number + of simultaneous `~AsyncHTTPClient.fetch()` operations that can + execute in parallel on each `.IOLoop`. Additional arguments + may be supported depending on the implementation class in use. Example:: @@ -245,7 +242,7 @@ class HTTPRequest(object): validate_cert=True) def __init__(self, url, method="GET", headers=None, body=None, - auth_username=None, auth_password=None, + auth_username=None, auth_password=None, auth_mode=None, connect_timeout=None, request_timeout=None, if_modified_since=None, follow_redirects=None, max_redirects=None, user_agent=None, use_gzip=None, @@ -256,59 +253,61 @@ class HTTPRequest(object): validate_cert=None, ca_certs=None, allow_ipv6=None, client_key=None, client_cert=None): - r"""Creates an `HTTPRequest`. - - All parameters except `url` are optional. + r"""All parameters except ``url`` are optional. :arg string url: URL to fetch :arg string method: HTTP method, e.g. "GET" or "POST" :arg headers: Additional HTTP headers to pass on the request :type headers: `~tornado.httputil.HTTPHeaders` or `dict` - :arg string auth_username: Username for HTTP "Basic" authentication - :arg string auth_password: Password for HTTP "Basic" authentication + :arg string auth_username: Username for HTTP authentication + :arg string auth_password: Password for HTTP authentication + :arg string auth_mode: Authentication mode; default is "basic". + Allowed values are implementation-defined; ``curl_httpclient`` + supports "basic" and "digest"; ``simple_httpclient`` only supports + "basic" :arg float connect_timeout: Timeout for initial connection in seconds :arg float request_timeout: Timeout for entire request in seconds - :arg datetime if_modified_since: Timestamp for ``If-Modified-Since`` - header + :arg if_modified_since: Timestamp for ``If-Modified-Since`` header + :type if_modified_since: `datetime` or `float` :arg bool follow_redirects: Should redirects be followed automatically or return the 3xx response? - :arg int max_redirects: Limit for `follow_redirects` + :arg int max_redirects: Limit for ``follow_redirects`` :arg string user_agent: String to send as ``User-Agent`` header :arg bool use_gzip: Request gzip encoding from the server :arg string network_interface: Network interface to use for request - :arg callable streaming_callback: If set, `streaming_callback` will + :arg callable streaming_callback: If set, ``streaming_callback`` will be run with each chunk of data as it is received, and - `~HTTPResponse.body` and `~HTTPResponse.buffer` will be empty in + ``HTTPResponse.body`` and ``HTTPResponse.buffer`` will be empty in the final response. - :arg callable header_callback: If set, `header_callback` will + :arg callable header_callback: If set, ``header_callback`` will be run with each header line as it is received (including the first line, e.g. ``HTTP/1.0 200 OK\r\n``, and a final line containing only ``\r\n``. All lines include the trailing newline - characters). `~HTTPResponse.headers` will be empty in the final + characters). ``HTTPResponse.headers`` will be empty in the final response. This is most useful in conjunction with - `streaming_callback`, because it's the only way to get access to + ``streaming_callback``, because it's the only way to get access to header data while the request is in progress. :arg callable prepare_curl_callback: If set, will be called with - a `pycurl.Curl` object to allow the application to make additional - `setopt` calls. + a ``pycurl.Curl`` object to allow the application to make additional + ``setopt`` calls. :arg string proxy_host: HTTP proxy hostname. To use proxies, - `proxy_host` and `proxy_port` must be set; `proxy_username` and - `proxy_pass` are optional. Proxies are currently only support - with `curl_httpclient`. + ``proxy_host`` and ``proxy_port`` must be set; ``proxy_username`` and + ``proxy_pass`` are optional. Proxies are currently only supported + with ``curl_httpclient``. :arg int proxy_port: HTTP proxy port :arg string proxy_username: HTTP proxy username :arg string proxy_password: HTTP proxy password - :arg bool allow_nonstandard_methods: Allow unknown values for `method` + :arg bool allow_nonstandard_methods: Allow unknown values for ``method`` argument? :arg bool validate_cert: For HTTPS requests, validate the server's certificate? :arg string ca_certs: filename of CA certificates in PEM format, - or None to use defaults. Note that in `curl_httpclient`, if - any request uses a custom `ca_certs` file, they all must (they - don't have to all use the same `ca_certs`, but it's not possible - to mix requests with ca_certs and requests that use the defaults. + or None to use defaults. Note that in ``curl_httpclient``, if + any request uses a custom ``ca_certs`` file, they all must (they + don't have to all use the same ``ca_certs``, but it's not possible + to mix requests with ``ca_certs`` and requests that use the defaults. :arg bool allow_ipv6: Use IPv6 when available? Default is false in - `simple_httpclient` and true in `curl_httpclient` + ``simple_httpclient`` and true in ``curl_httpclient`` :arg string client_key: Filename for client SSL key, if any :arg string client_cert: Filename for client SSL certificate, if any """ @@ -327,6 +326,7 @@ class HTTPRequest(object): self.body = utf8(body) self.auth_username = auth_username self.auth_password = auth_password + self.auth_mode = auth_mode self.connect_timeout = connect_timeout self.request_timeout = request_timeout self.follow_redirects = follow_redirects @@ -356,29 +356,32 @@ class HTTPResponse(object): * code: numeric HTTP status code, e.g. 200 or 404 * reason: human-readable reason phrase describing the status code - (with curl_httpclient, this is a default value rather than the - server's actual response) + (with curl_httpclient, this is a default value rather than the + server's actual response) - * headers: httputil.HTTPHeaders object + * headers: `tornado.httputil.HTTPHeaders` object - * buffer: cStringIO object for response body + * buffer: ``cStringIO`` object for response body - * body: response body as string (created on demand from self.buffer) + * body: response body as string (created on demand from ``self.buffer``) * error: Exception object, if any * request_time: seconds from request start to finish * time_info: dictionary of diagnostic timing information from the request. - Available data are subject to change, but currently uses timings - available from http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html, - plus 'queue', which is the delay (if any) introduced by waiting for - a slot under AsyncHTTPClient's max_clients setting. + Available data are subject to change, but currently uses timings + available from http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html, + plus ``queue``, which is the delay (if any) introduced by waiting for + a slot under `AsyncHTTPClient`'s ``max_clients`` setting. """ def __init__(self, request, code, headers=None, buffer=None, effective_url=None, error=None, request_time=None, time_info=None, reason=None): - self.request = request + if isinstance(request, _RequestProxy): + self.request = request.request + else: + self.request = request self.code = code self.reason = reason or httputil.responses.get(code, "Unknown") if headers is not None: @@ -426,13 +429,13 @@ class HTTPError(Exception): Attributes: - code - HTTP error integer error code, e.g. 404. Error code 599 is - used when no HTTP response was received, e.g. for a timeout. + * ``code`` - HTTP error integer error code, e.g. 404. Error code 599 is + used when no HTTP response was received, e.g. for a timeout. - response - HTTPResponse object, if any. + * ``response`` - `HTTPResponse` object, if any. - Note that if follow_redirects is False, redirects become HTTPErrors, - and you can look at error.response.headers['Location'] to see the + Note that if ``follow_redirects`` is False, redirects become HTTPErrors, + and you can look at ``error.response.headers['Location']`` to see the destination of the redirect. """ def __init__(self, code, message=None, response=None): diff --git a/libs/tornado/httpserver.py b/libs/tornado/httpserver.py index 24d5e6b3..ef36e6bd 100755 --- a/libs/tornado/httpserver.py +++ b/libs/tornado/httpserver.py @@ -34,14 +34,15 @@ from tornado.escape import native_str, parse_qs_bytes from tornado import httputil from tornado import iostream from tornado.log import gen_log +from tornado import netutil from tornado.tcpserver import TCPServer from tornado import stack_context from tornado.util import bytes_type try: - import Cookie # py2 + import Cookie # py2 except ImportError: - import http.cookies as Cookie # py3 + import http.cookies as Cookie # py3 class HTTPServer(TCPServer): @@ -54,8 +55,8 @@ class HTTPServer(TCPServer): requests). A simple example server that echoes back the URI you requested:: - import httpserver - import ioloop + import tornado.httpserver + import tornado.ioloop def handle_request(request): message = "You requested %s\n" % request.uri @@ -63,9 +64,9 @@ class HTTPServer(TCPServer): len(message), message)) request.finish() - http_server = httpserver.HTTPServer(handle_request) + http_server = tornado.httpserver.HTTPServer(handle_request) http_server.listen(8888) - ioloop.IOLoop.instance().start() + tornado.ioloop.IOLoop.instance().start() `HTTPServer` is a very basic connection handler. It parses the request headers and body, but the request callback is responsible for producing @@ -92,11 +93,10 @@ class HTTPServer(TCPServer): if Tornado is run behind an SSL-decoding proxy that does not set one of the supported ``xheaders``. - `HTTPServer` can serve SSL traffic with Python 2.6+ and OpenSSL. - To make this server serve SSL traffic, send the ssl_options dictionary + To make this server serve SSL traffic, send the ``ssl_options`` dictionary argument with the arguments required for the `ssl.wrap_socket` method, - including "certfile" and "keyfile". In Python 3.2+ you can pass - an `ssl.SSLContext` object instead of a dict:: + including ``certfile`` and ``keyfile``. (In Python 3.2+ you can pass + an `ssl.SSLContext` object instead of a dict):: HTTPServer(applicaton, ssl_options={ "certfile": os.path.join(data_dir, "mydomain.crt"), @@ -123,9 +123,9 @@ class HTTPServer(TCPServer): server.start(0) # Forks multiple sub-processes IOLoop.instance().start() - When using this interface, an `IOLoop` must *not* be passed - to the `HTTPServer` constructor. `start` will always start - the server on the default singleton `IOLoop`. + When using this interface, an `.IOLoop` must *not* be passed + to the `HTTPServer` constructor. `~.TCPServer.start` will always start + the server on the default singleton `.IOLoop`. 3. `~tornado.tcpserver.TCPServer.add_sockets`: advanced multi-process:: @@ -135,21 +135,21 @@ class HTTPServer(TCPServer): server.add_sockets(sockets) IOLoop.instance().start() - The `add_sockets` interface is more complicated, but it can be - used with `tornado.process.fork_processes` to give you more - flexibility in when the fork happens. `add_sockets` can - also be used in single-process servers if you want to create - your listening sockets in some way other than - `tornado.netutil.bind_sockets`. + The `~.TCPServer.add_sockets` interface is more complicated, + but it can be used with `tornado.process.fork_processes` to + give you more flexibility in when the fork happens. + `~.TCPServer.add_sockets` can also be used in single-process + servers if you want to create your listening sockets in some + way other than `tornado.netutil.bind_sockets`. """ - def __init__(self, request_callback, no_keep_alive=False, io_loop=None, - xheaders=False, ssl_options=None, protocol=None, **kwargs): + def __init__(self, request_callback, no_keep_alive = False, io_loop = None, + xheaders = False, ssl_options = None, protocol = None, **kwargs): self.request_callback = request_callback self.no_keep_alive = no_keep_alive self.xheaders = xheaders self.protocol = protocol - TCPServer.__init__(self, io_loop=io_loop, ssl_options=ssl_options, + TCPServer.__init__(self, io_loop = io_loop, ssl_options = ssl_options, **kwargs) def handle_stream(self, stream, address): @@ -168,8 +168,8 @@ class HTTPConnection(object): We parse HTTP headers and bodies, and execute the request callback until the HTTP conection is closed. """ - def __init__(self, stream, address, request_callback, no_keep_alive=False, - xheaders=False, protocol=None): + def __init__(self, stream, address, request_callback, no_keep_alive = False, + xheaders = False, protocol = None): self.stream = stream self.address = address # Save the socket's address family now so we know how to @@ -182,31 +182,51 @@ class HTTPConnection(object): self.protocol = protocol self._request = None self._request_finished = False + self._write_callback = None + self._close_callback = None # Save stack context here, outside of any request. This keeps # contexts from one request from leaking into the next. self._header_callback = stack_context.wrap(self._on_headers) self.stream.read_until(b"\r\n\r\n", self._header_callback) + + def _clear_callbacks(self): + """Clears the per-request callbacks. + + This is run in between requests to allow the previous handler + to be garbage collected (and prevent spurious close callbacks), + and when the connection is closed (to break up cycles and + facilitate garbage collection in cpython). + """ self._write_callback = None self._close_callback = None def set_close_callback(self, callback): + """Sets a callback that will be run when the connection is closed. + + Use this instead of accessing + `HTTPConnection.stream.set_close_callback + <.BaseIOStream.set_close_callback>` directly (which was the + recommended approach prior to Tornado 3.0). + """ self._close_callback = stack_context.wrap(callback) self.stream.set_close_callback(self._on_connection_close) def _on_connection_close(self): callback = self._close_callback self._close_callback = None - callback() + if callback: callback() # Delete any unfinished callbacks to break up reference cycles. - self._write_callback = None + self._header_callback = None + self._clear_callbacks() def close(self): self.stream.close() # Remove this reference to self, which would otherwise cause a # cycle and delay garbage collection of this connection. self._header_callback = None + self._clear_callbacks() - def write(self, chunk, callback=None): + def write(self, chunk, callback = None): """Writes a chunk of output to the stream.""" assert self._request, "Request closed" if not self.stream.closed(): @@ -251,6 +271,7 @@ class HTTPConnection(object): disconnect = True self._request = None self._request_finished = False + self._clear_callbacks() if disconnect: self.close() return @@ -273,7 +294,11 @@ class HTTPConnection(object): raise _BadRequestException("Malformed HTTP request line") if not version.startswith("HTTP/"): raise _BadRequestException("Malformed HTTP version in HTTP Request-Line") - headers = httputil.HTTPHeaders.parse(data[eol:]) + try: + headers = httputil.HTTPHeaders.parse(data[eol:]) + except ValueError: + # Probably from split() if there was no ':' in the line + raise _BadRequestException("Malformed HTTP headers") # HTTPRequest wants an IP, not a full socket address if self.address_family in (socket.AF_INET, socket.AF_INET6): @@ -283,8 +308,8 @@ class HTTPConnection(object): remote_ip = '0.0.0.0' self._request = HTTPRequest( - connection=self, method=method, uri=uri, version=version, - headers=headers, remote_ip=remote_ip, protocol=self.protocol) + connection = self, method = method, uri = uri, version = version, + headers = headers, remote_ip = remote_ip, protocol = self.protocol) content_length = headers.get("Content-Length") if content_length: @@ -339,7 +364,7 @@ class HTTPRequest(object): .. attribute:: headers - `HTTPHeader` dictionary-like object for request headers. Acts like + `.HTTPHeaders` dictionary-like object for request headers. Acts like a case-insensitive dictionary with additional methods for repeated headers. @@ -349,13 +374,13 @@ class HTTPRequest(object): .. attribute:: remote_ip - Client's IP address as a string. If `HTTPServer.xheaders` is set, + Client's IP address as a string. If ``HTTPServer.xheaders`` is set, will pass along the real IP address provided by a load balancer in the ``X-Real-Ip`` header .. attribute:: protocol - The protocol used, either "http" or "https". If `HTTPServer.xheaders` + The protocol used, either "http" or "https". If ``HTTPServer.xheaders`` is set, will pass along the protocol used by a load balancer if reported via an ``X-Scheme`` header. @@ -369,13 +394,13 @@ class HTTPRequest(object): maps arguments names to lists of values (to support multiple values for individual names). Names are of type `str`, while arguments are byte strings. Note that this is different from - `RequestHandler.get_argument`, which returns argument values as + `.RequestHandler.get_argument`, which returns argument values as unicode strings. .. attribute:: files File uploads are available in the files property, which maps file - names to lists of :class:`HTTPFile`. + names to lists of `.HTTPFile`. .. attribute:: connection @@ -384,34 +409,39 @@ class HTTPRequest(object): are typically kept open in HTTP/1.1, multiple requests can be handled sequentially on a single connection. """ - def __init__(self, method, uri, version="HTTP/1.0", headers=None, - body=None, remote_ip=None, protocol=None, host=None, - files=None, connection=None): + def __init__(self, method, uri, version = "HTTP/1.0", headers = None, + body = None, remote_ip = None, protocol = None, host = None, + files = None, connection = None): self.method = method self.uri = uri self.version = version self.headers = headers or httputil.HTTPHeaders() self.body = body or "" + + # set remote IP and protocol + self.remote_ip = remote_ip + if protocol: + self.protocol = protocol + elif connection and isinstance(connection.stream, + iostream.SSLIOStream): + self.protocol = "https" + else: + self.protocol = "http" + + # xheaders can override the defaults if connection and connection.xheaders: # Squid uses X-Forwarded-For, others use X-Real-Ip - self.remote_ip = self.headers.get( - "X-Real-Ip", self.headers.get("X-Forwarded-For", remote_ip)) - if not self._valid_ip(self.remote_ip): - self.remote_ip = remote_ip + ip = self.headers.get( + "X-Real-Ip", self.headers.get("X-Forwarded-For", self.remote_ip)) + if netutil.is_valid_ip(ip): + self.remote_ip = ip # AWS uses X-Forwarded-Proto - self.protocol = self.headers.get( - "X-Scheme", self.headers.get("X-Forwarded-Proto", protocol)) - if self.protocol not in ("http", "https"): - self.protocol = "http" - else: - self.remote_ip = remote_ip - if protocol: - self.protocol = protocol - elif connection and isinstance(connection.stream, - iostream.SSLIOStream): - self.protocol = "https" - else: - self.protocol = "http" + proto = self.headers.get( + "X-Scheme", self.headers.get("X-Forwarded-Proto", self.protocol)) + if proto in ("http", "https"): + self.protocol = proto + + self.host = host or self.headers.get("Host") or "127.0.0.1" self.files = files or {} self.connection = connection @@ -419,7 +449,7 @@ class HTTPRequest(object): self._finish_time = None self.path, sep, self.query = uri.partition('?') - self.arguments = parse_qs_bytes(self.query, keep_blank_values=True) + self.arguments = parse_qs_bytes(self.query, keep_blank_values = True) def supports_http_1_1(self): """Returns True if this request supports HTTP/1.1 semantics""" @@ -438,10 +468,10 @@ class HTTPRequest(object): self._cookies = {} return self._cookies - def write(self, chunk, callback=None): + def write(self, chunk, callback = None): """Writes the given chunk to the response stream.""" assert isinstance(chunk, bytes_type) - self.connection.write(chunk, callback=callback) + self.connection.write(chunk, callback = callback) def finish(self): """Finishes this HTTP request on the open connection.""" @@ -459,7 +489,7 @@ class HTTPRequest(object): else: return self._finish_time - self._start_time - def get_ssl_certificate(self, binary_form=False): + def get_ssl_certificate(self, binary_form = False): """Returns the client's SSL certificate, if any. To use client certificates, the HTTPServer must have been constructed @@ -481,7 +511,7 @@ class HTTPRequest(object): """ try: return self.connection.stream.socket.getpeercert( - binary_form=binary_form) + binary_form = binary_form) except ssl.SSLError: return None @@ -491,15 +521,3 @@ class HTTPRequest(object): args = ", ".join(["%s=%r" % (n, getattr(self, n)) for n in attrs]) return "%s(%s, headers=%s)" % ( self.__class__.__name__, args, dict(self.headers)) - - def _valid_ip(self, ip): - try: - res = socket.getaddrinfo(ip, 0, socket.AF_UNSPEC, - socket.SOCK_STREAM, - 0, socket.AI_NUMERICHOST) - return bool(res) - except socket.gaierror as e: - if e.args[0] == socket.EAI_NONAME: - return False - raise - return True diff --git a/libs/tornado/httputil.py b/libs/tornado/httputil.py index 94b8ba4f..a09aeabf 100755 --- a/libs/tornado/httputil.py +++ b/libs/tornado/httputil.py @@ -32,6 +32,10 @@ try: except ImportError: from http.client import responses # py3 +# responses is unused in this file, but we re-export it to other files. +# Reference it so pyflakes doesn't complain. +responses + try: from urllib import urlencode # py2 except ImportError: @@ -39,11 +43,12 @@ except ImportError: class HTTPHeaders(dict): - """A dictionary that maintains Http-Header-Case for all keys. + """A dictionary that maintains ``Http-Header-Case`` for all keys. Supports multiple values per key via a pair of new methods, - add() and get_list(). The regular dictionary interface returns a single - value per key, with multiple values joined by a comma. + `add()` and `get_list()`. The regular dictionary interface + returns a single value per key, with multiple values joined by a + comma. >>> h = HTTPHeaders({"content-type": "text/html"}) >>> list(h.keys()) @@ -209,13 +214,14 @@ def url_concat(url, args): class HTTPFile(ObjectDict): - """Represents an HTTP file. For backwards compatibility, its instance - attributes are also accessible as dictionary keys. + """Represents a file uploaded via a form. - :ivar filename: - :ivar body: - :ivar content_type: The content_type comes from the provided HTTP header - and should not be trusted outright given that it can be easily forged. + For backwards compatibility, its instance attributes are also + accessible as dictionary keys. + + * ``filename`` + * ``body`` + * ``content_type`` """ pass @@ -223,15 +229,15 @@ class HTTPFile(ObjectDict): def parse_body_arguments(content_type, body, arguments, files): """Parses a form request body. - Supports "application/x-www-form-urlencoded" and "multipart/form-data". - The content_type parameter should be a string and body should be - a byte string. The arguments and files parameters are dictionaries - that will be updated with the parsed contents. + Supports ``application/x-www-form-urlencoded`` and + ``multipart/form-data``. The ``content_type`` parameter should be + a string and ``body`` should be a byte string. The ``arguments`` + and ``files`` parameters are dictionaries that will be updated + with the parsed contents. """ if content_type.startswith("application/x-www-form-urlencoded"): - uri_arguments = parse_qs_bytes(native_str(body)) + uri_arguments = parse_qs_bytes(native_str(body), keep_blank_values=True) for name, values in uri_arguments.items(): - values = [v for v in values if v] if values: arguments.setdefault(name, []).extend(values) elif content_type.startswith("multipart/form-data"): @@ -246,9 +252,9 @@ def parse_body_arguments(content_type, body, arguments, files): def parse_multipart_form_data(boundary, data, arguments, files): - """Parses a multipart/form-data body. + """Parses a ``multipart/form-data`` body. - The boundary and data parameters are both byte strings. + The ``boundary`` and ``data`` parameters are both byte strings. The dictionaries given in the arguments and files parameters will be updated with the contents of the body. """ @@ -294,8 +300,8 @@ def parse_multipart_form_data(boundary, data, arguments, files): def format_timestamp(ts): """Formats a timestamp in the format used by HTTP. - The argument may be a numeric timestamp as returned by `time.time()`, - a time tuple as returned by `time.gmtime()`, or a `datetime.datetime` + The argument may be a numeric timestamp as returned by `time.time`, + a time tuple as returned by `time.gmtime`, or a `datetime.datetime` object. >>> format_timestamp(1359312200) @@ -314,6 +320,8 @@ def format_timestamp(ts): # _parseparam and _parse_header are copied and modified from python2.7's cgi.py # The original 2.7 version of this code did not correctly support some # combinations of semicolons and double quotes. + + def _parseparam(s): while s[:1] == ';': s = s[1:] diff --git a/libs/tornado/ioloop.py b/libs/tornado/ioloop.py index 4062661b..dd9639c0 100755 --- a/libs/tornado/ioloop.py +++ b/libs/tornado/ioloop.py @@ -36,11 +36,12 @@ import logging import numbers import os import select +import sys import threading import time import traceback -from tornado.concurrent import DummyFuture +from tornado.concurrent import Future, TracebackFuture from tornado.log import app_log, gen_log from tornado import stack_context from tornado.util import Configurable @@ -50,11 +51,6 @@ try: except ImportError: signal = None -try: - from concurrent import futures -except ImportError: - futures = None - try: import thread # py2 except ImportError: @@ -63,14 +59,18 @@ except ImportError: from tornado.platform.auto import set_close_exec, Waker +class TimeoutError(Exception): + pass + + class IOLoop(Configurable): """A level-triggered I/O loop. - We use epoll (Linux) or kqueue (BSD and Mac OS X; requires python - 2.6+) if they are available, or else we fall back on select(). If - you are implementing a system that needs to handle thousands of - simultaneous connections, you should use a system that supports either - epoll or kqueue. + We use ``epoll`` (Linux) or ``kqueue`` (BSD and Mac OS X) if they + are available, or else we fall back on select(). If you are + implementing a system that needs to handle thousands of + simultaneous connections, you should use a system that supports + either ``epoll`` or ``kqueue``. Example usage for a simple TCP server:: @@ -125,19 +125,11 @@ class IOLoop(Configurable): @staticmethod def instance(): - """Returns a global IOLoop instance. + """Returns a global `IOLoop` instance. - Most single-threaded applications have a single, global IOLoop. - Use this method instead of passing around IOLoop instances - throughout your code. - - A common pattern for classes that depend on IOLoops is to use - a default argument to enable programs with multiple IOLoops - but not require the argument for simpler applications:: - - class MyClass(object): - def __init__(self, io_loop=None): - self.io_loop = io_loop or IOLoop.instance() + Most applications have a single, global `IOLoop` running on the + main thread. Use this method to get this instance from + another thread. To get the current thread's `IOLoop`, use `current()`. """ if not hasattr(IOLoop, "_instance"): with IOLoop._instance_lock: @@ -152,27 +144,54 @@ class IOLoop(Configurable): return hasattr(IOLoop, "_instance") def install(self): - """Installs this IOloop object as the singleton instance. + """Installs this `IOLoop` object as the singleton instance. This is normally not necessary as `instance()` will create - an IOLoop on demand, but you may want to call `install` to use - a custom subclass of IOLoop. + an `IOLoop` on demand, but you may want to call `install` to use + a custom subclass of `IOLoop`. """ assert not IOLoop.initialized() IOLoop._instance = self @staticmethod def current(): + """Returns the current thread's `IOLoop`. + + If an `IOLoop` is currently running or has been marked as current + by `make_current`, returns that instance. Otherwise returns + `IOLoop.instance()`, i.e. the main thread's `IOLoop`. + + A common pattern for classes that depend on ``IOLoops`` is to use + a default argument to enable programs with multiple ``IOLoops`` + but not require the argument for simpler applications:: + + class MyClass(object): + def __init__(self, io_loop=None): + self.io_loop = io_loop or IOLoop.current() + + In general you should use `IOLoop.current` as the default when + constructing an asynchronous object, and use `IOLoop.instance` + when you mean to communicate to the main thread from a different + one. + """ current = getattr(IOLoop._current, "instance", None) if current is None: - raise ValueError("no current IOLoop") + return IOLoop.instance() return current def make_current(self): + """Makes this the `IOLoop` for the current thread. + + An `IOLoop` automatically becomes current for its thread + when it is started, but it is sometimes useful to call + `make_current` explictly before starting the `IOLoop`, + so that code run at startup time can find the right + instance. + """ IOLoop._current.instance = self - def clear_current(self): - assert IOLoop._current.instance is self + @staticmethod + def clear_current(): IOLoop._current.instance = None @classmethod @@ -195,19 +214,20 @@ class IOLoop(Configurable): pass def close(self, all_fds=False): - """Closes the IOLoop, freeing any resources used. + """Closes the `IOLoop`, freeing any resources used. If ``all_fds`` is true, all file descriptors registered on the - IOLoop will be closed (not just the ones created by the IOLoop itself). + IOLoop will be closed (not just the ones created by the + `IOLoop` itself). - Many applications will only use a single IOLoop that runs for the - entire lifetime of the process. In that case closing the IOLoop + Many applications will only use a single `IOLoop` that runs for the + entire lifetime of the process. In that case closing the `IOLoop` is not necessary since everything will be cleaned up when the process exits. `IOLoop.close` is provided mainly for scenarios such as unit tests, which create and destroy a large number of - IOLoops. + ``IOLoops``. - An IOLoop must be completely stopped before it can be closed. This + An `IOLoop` must be completely stopped before it can be closed. This means that `IOLoop.stop()` must be called *and* `IOLoop.start()` must be allowed to return before attempting to call `IOLoop.close()`. Therefore the call to `close` will usually appear just after @@ -216,7 +236,13 @@ class IOLoop(Configurable): raise NotImplementedError() def add_handler(self, fd, handler, events): - """Registers the given handler to receive the given events for fd.""" + """Registers the given handler to receive the given events for fd. + + The ``events`` argument is a bitwise or of the constants + ``IOLoop.READ``, ``IOLoop.WRITE``, and ``IOLoop.ERROR``. + + When an event occurs, ``handler(fd, events)`` will be run. + """ raise NotImplementedError() def update_handler(self, fd, events): @@ -228,28 +254,32 @@ class IOLoop(Configurable): raise NotImplementedError() def set_blocking_signal_threshold(self, seconds, action): - """Sends a signal if the ioloop is blocked for more than s seconds. + """Sends a signal if the `IOLoop` is blocked for more than + ``s`` seconds. - Pass seconds=None to disable. Requires python 2.6 on a unixy + Pass ``seconds=None`` to disable. Requires Python 2.6 on a unixy platform. - The action parameter is a python signal handler. Read the - documentation for the python 'signal' module for more information. - If action is None, the process will be killed if it is blocked for - too long. + The action parameter is a Python signal handler. Read the + documentation for the `signal` module for more information. + If ``action`` is None, the process will be killed if it is + blocked for too long. """ raise NotImplementedError() def set_blocking_log_threshold(self, seconds): - """Logs a stack trace if the ioloop is blocked for more than s seconds. - Equivalent to set_blocking_signal_threshold(seconds, self.log_stack) + """Logs a stack trace if the `IOLoop` is blocked for more than + ``s`` seconds. + + Equivalent to ``set_blocking_signal_threshold(seconds, + self.log_stack)`` """ self.set_blocking_signal_threshold(seconds, self.log_stack) def log_stack(self, signal, frame): """Signal handler to log the stack trace of the current thread. - For use with set_blocking_signal_threshold. + For use with `set_blocking_signal_threshold`. """ gen_log.warning('IOLoop blocked for %f seconds in\n%s', self._blocking_signal_threshold, @@ -258,7 +288,7 @@ class IOLoop(Configurable): def start(self): """Starts the I/O loop. - The loop will run until one of the I/O handlers calls stop(), which + The loop will run until one of the callbacks calls `stop()`, which will make the loop stop after the current event iteration completes. """ raise NotImplementedError() @@ -266,7 +296,7 @@ class IOLoop(Configurable): def stop(self): """Stop the I/O loop. - If the event loop is not currently running, the next call to start() + If the event loop is not currently running, the next call to `start()` will return immediately. To use asynchronous methods from otherwise-synchronous code (such as @@ -276,23 +306,71 @@ class IOLoop(Configurable): async_method(ioloop=ioloop, callback=ioloop.stop) ioloop.start() - ioloop.start() will return after async_method has run its callback, - whether that callback was invoked before or after ioloop.start. + ``ioloop.start()`` will return after ``async_method`` has run + its callback, whether that callback was invoked before or + after ``ioloop.start``. - Note that even after `stop` has been called, the IOLoop is not + Note that even after `stop` has been called, the `IOLoop` is not completely stopped until `IOLoop.start` has also returned. Some work that was scheduled before the call to `stop` may still - be run before the IOLoop shuts down. + be run before the `IOLoop` shuts down. """ raise NotImplementedError() + def run_sync(self, func, timeout=None): + """Starts the `IOLoop`, runs the given function, and stops the loop. + + If the function returns a `.Future`, the `IOLoop` will run + until the future is resolved. If it raises an exception, the + `IOLoop` will stop and the exception will be re-raised to the + caller. + + The keyword-only argument ``timeout`` may be used to set + a maximum duration for the function. If the timeout expires, + a `TimeoutError` is raised. + + This method is useful in conjunction with `tornado.gen.coroutine` + to allow asynchronous calls in a ``main()`` function:: + + @gen.coroutine + def main(): + # do stuff... + + if __name__ == '__main__': + IOLoop.instance().run_sync(main) + """ + future_cell = [None] + + def run(): + try: + result = func() + except Exception: + future_cell[0] = TracebackFuture() + future_cell[0].set_exc_info(sys.exc_info()) + else: + if isinstance(result, Future): + future_cell[0] = result + else: + future_cell[0] = Future() + future_cell[0].set_result(result) + self.add_future(future_cell[0], lambda future: self.stop()) + self.add_callback(run) + if timeout is not None: + timeout_handle = self.add_timeout(self.time() + timeout, self.stop) + self.start() + if timeout is not None: + self.remove_timeout(timeout_handle) + if not future_cell[0].done(): + raise TimeoutError('Operation timed out after %s seconds' % timeout) + return future_cell[0].result() + def time(self): - """Returns the current time according to the IOLoop's clock. + """Returns the current time according to the `IOLoop`'s clock. The return value is a floating-point number relative to an unspecified time in the past. - By default, the IOLoop's time function is `time.time`. However, + By default, the `IOLoop`'s time function is `time.time`. However, it may be configured to use e.g. `time.monotonic` instead. Calls to `add_timeout` that pass a number instead of a `datetime.timedelta` should use this function to compute the @@ -302,24 +380,26 @@ class IOLoop(Configurable): return time.time() def add_timeout(self, deadline, callback): - """Calls the given callback at the time deadline from the I/O loop. + """Runs the ``callback`` at the time ``deadline`` from the I/O loop. - Returns a handle that may be passed to remove_timeout to cancel. + Returns an opaque handle that may be passed to + `remove_timeout` to cancel. - ``deadline`` may be a number denoting a time relative to - `IOLoop.time`, or a ``datetime.timedelta`` object for a - deadline relative to the current time. + ``deadline`` may be a number denoting a time (on the same + scale as `IOLoop.time`, normally `time.time`), or a + `datetime.timedelta` object for a deadline relative to the + current time. Note that it is not safe to call `add_timeout` from other threads. Instead, you must use `add_callback` to transfer control to the - IOLoop's thread, and then call `add_timeout` from there. + `IOLoop`'s thread, and then call `add_timeout` from there. """ raise NotImplementedError() def remove_timeout(self, timeout): """Cancels a pending timeout. - The argument is a handle as returned by add_timeout. It is + The argument is a handle as returned by `add_timeout`. It is safe to call `remove_timeout` even if the callback has already been run. """ @@ -329,11 +409,11 @@ class IOLoop(Configurable): """Calls the given callback on the next I/O loop iteration. It is safe to call this method from any thread at any time, - except from a signal handler. Note that this is the *only* - method in IOLoop that makes this thread-safety guarantee; all - other interaction with the IOLoop must be done from that - IOLoop's thread. add_callback() may be used to transfer - control from other threads to the IOLoop's thread. + except from a signal handler. Note that this is the **only** + method in `IOLoop` that makes this thread-safety guarantee; all + other interaction with the `IOLoop` must be done from that + `IOLoop`'s thread. `add_callback()` may be used to transfer + control from other threads to the `IOLoop`'s thread. To add a callback from a signal handler, see `add_callback_from_signal`. @@ -347,22 +427,19 @@ class IOLoop(Configurable): otherwise. Callbacks added with this method will be run without any - stack_context, to avoid picking up the context of the function + `.stack_context`, to avoid picking up the context of the function that was interrupted by the signal. """ raise NotImplementedError() - if futures is not None: - _FUTURE_TYPES = (futures.Future, DummyFuture) - else: - _FUTURE_TYPES = DummyFuture - def add_future(self, future, callback): - """Schedules a callback on the IOLoop when the given future is finished. + """Schedules a callback on the ``IOLoop`` when the given + `.Future` is finished. - The callback is invoked with one argument, the future. + The callback is invoked with one argument, the + `.Future`. """ - assert isinstance(future, IOLoop._FUTURE_TYPES) + assert isinstance(future, Future) callback = stack_context.wrap(callback) future.add_done_callback( lambda future: self.add_callback(callback, future)) @@ -378,14 +455,14 @@ class IOLoop(Configurable): self.handle_callback_exception(callback) def handle_callback_exception(self, callback): - """This method is called whenever a callback run by the IOLoop + """This method is called whenever a callback run by the `IOLoop` throws an exception. By default simply logs the exception as an error. Subclasses may override this method to customize reporting of exceptions. The exception itself is not passed explicitly, but is available - in sys.exc_info. + in `sys.exc_info`. """ app_log.error("Exception in callback %r", callback, exc_info=True) @@ -428,7 +505,11 @@ class PollIOLoop(IOLoop): if all_fds: for fd in self._handlers.keys(): try: - os.close(fd) + close_method = getattr(fd, 'close', None) + if close_method is not None: + close_method() + else: + os.close(fd) except Exception: gen_log.debug("error closing fd %s", fd, exc_info=True) self._waker.close() @@ -684,16 +765,16 @@ class _Timeout(object): class PeriodicCallback(object): """Schedules the given callback to be called periodically. - The callback is called every callback_time milliseconds. + The callback is called every ``callback_time`` milliseconds. - `start` must be called after the PeriodicCallback is created. + `start` must be called after the `PeriodicCallback` is created. """ def __init__(self, callback, callback_time, io_loop=None): self.callback = callback if callback_time <= 0: raise ValueError("Periodic callback must have a positive callback_time") self.callback_time = callback_time - self.io_loop = io_loop or IOLoop.instance() + self.io_loop = io_loop or IOLoop.current() self._running = False self._timeout = None diff --git a/libs/tornado/iostream.py b/libs/tornado/iostream.py index 86cd68a8..16b0fac1 100755 --- a/libs/tornado/iostream.py +++ b/libs/tornado/iostream.py @@ -58,7 +58,7 @@ class BaseIOStream(object): All of the methods take callbacks (since writing and reading are non-blocking and asynchronous). - When a stream is closed due to an error, the IOStream's `error` + When a stream is closed due to an error, the IOStream's ``error`` attribute contains the exception object. Subclasses must implement `fileno`, `close_fd`, `write_to_fd`, @@ -66,7 +66,7 @@ class BaseIOStream(object): """ def __init__(self, io_loop=None, max_buffer_size=104857600, read_chunk_size=4096): - self.io_loop = io_loop or ioloop.IOLoop.instance() + self.io_loop = io_loop or ioloop.IOLoop.current() self.max_buffer_size = max_buffer_size self.read_chunk_size = read_chunk_size self.error = None @@ -110,16 +110,17 @@ class BaseIOStream(object): def read_from_fd(self): """Attempts to read from the underlying file. - Returns ``None`` if there was nothing to read (the socket returned - EWOULDBLOCK or equivalent), otherwise returns the data. When possible, - should return no more than ``self.read_chunk_size`` bytes at a time. + Returns ``None`` if there was nothing to read (the socket + returned `~errno.EWOULDBLOCK` or equivalent), otherwise + returns the data. When possible, should return no more than + ``self.read_chunk_size`` bytes at a time. """ raise NotImplementedError() def get_fd_error(self): """Returns information about any error on the underlying file. - This method is called after the IOLoop has signaled an error on the + This method is called after the `.IOLoop` has signaled an error on the file descriptor, and should return an Exception (such as `socket.error` with additional information, or None if no such information is available. @@ -127,23 +128,32 @@ class BaseIOStream(object): return None def read_until_regex(self, regex, callback): - """Call callback when we read the given regex pattern.""" + """Run ``callback`` when we read the given regex pattern. + + The callback will get the data read (including the data that + matched the regex and anything that came before it) as an argument. + """ self._set_read_callback(callback) self._read_regex = re.compile(regex) self._try_inline_read() def read_until(self, delimiter, callback): - """Call callback when we read the given delimiter.""" + """Run ``callback`` when we read the given delimiter. + + The callback will get the data read (including the delimiter) + as an argument. + """ self._set_read_callback(callback) self._read_delimiter = delimiter self._try_inline_read() def read_bytes(self, num_bytes, callback, streaming_callback=None): - """Call callback when we read the given number of bytes. + """Run callback when we read the given number of bytes. If a ``streaming_callback`` is given, it will be called with chunks of data as they become available, and the argument to the final - ``callback`` will be empty. + ``callback`` will be empty. Otherwise, the ``callback`` gets + the data as an argument. """ self._set_read_callback(callback) assert isinstance(num_bytes, numbers.Integral) @@ -156,7 +166,8 @@ class BaseIOStream(object): If a ``streaming_callback`` is given, it will be called with chunks of data as they become available, and the argument to the final - ``callback`` will be empty. + ``callback`` will be empty. Otherwise, the ``callback`` gets the + data as an argument. Subject to ``max_buffer_size`` limit from `IOStream` constructor if a ``streaming_callback`` is not used. @@ -174,12 +185,12 @@ class BaseIOStream(object): return self._read_until_close = True self._streaming_callback = stack_context.wrap(streaming_callback) - self._add_io_state(self.io_loop.READ) + self._try_inline_read() def write(self, data, callback=None): """Write the given data to this stream. - If callback is given, we call it when all of the buffered write + If ``callback`` is given, we call it when all of the buffered write data has been successfully written to the stream. If there was previously buffered write data and an old write callback, that callback is simply overwritten with this new callback. @@ -213,7 +224,7 @@ class BaseIOStream(object): """Close this stream. If ``exc_info`` is true, set the ``error`` attribute to the current - exception from `sys.exc_info()` (or if ``exc_info`` is a tuple, + exception from `sys.exc_info` (or if ``exc_info`` is a tuple, use that instead of `sys.exc_info`). """ if not self.closed(): @@ -573,44 +584,45 @@ class BaseIOStream(object): class IOStream(BaseIOStream): - r"""Socket-based IOStream implementation. + r"""Socket-based `IOStream` implementation. This class supports the read and write methods from `BaseIOStream` plus a `connect` method. - The socket parameter may either be connected or unconnected. For - server operations the socket is the result of calling socket.accept(). - For client operations the socket is created with socket.socket(), - and may either be connected before passing it to the IOStream or - connected with IOStream.connect. + The ``socket`` parameter may either be connected or unconnected. + For server operations the socket is the result of calling + `socket.accept `. For client operations the + socket is created with `socket.socket`, and may either be + connected before passing it to the `IOStream` or connected with + `IOStream.connect`. A very simple (and broken) HTTP client using this class:: - from tornado import ioloop - from tornado import iostream + import tornado.ioloop + import tornado.iostream import socket def send_request(): - stream.write("GET / HTTP/1.0\r\nHost: friendfeed.com\r\n\r\n") - stream.read_until("\r\n\r\n", on_headers) + stream.write(b"GET / HTTP/1.0\r\nHost: friendfeed.com\r\n\r\n") + stream.read_until(b"\r\n\r\n", on_headers) def on_headers(data): headers = {} - for line in data.split("\r\n"): - parts = line.split(":") + for line in data.split(b"\r\n"): + parts = line.split(b":") if len(parts) == 2: headers[parts[0].strip()] = parts[1].strip() - stream.read_bytes(int(headers["Content-Length"]), on_body) + stream.read_bytes(int(headers[b"Content-Length"]), on_body) def on_body(data): print data stream.close() - ioloop.IOLoop.instance().stop() + tornado.ioloop.IOLoop.instance().stop() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) - stream = iostream.IOStream(s) + stream = tornado.iostream.IOStream(s) stream.connect(("friendfeed.com", 80), send_request) - ioloop.IOLoop.instance().start() + tornado.ioloop.IOLoop.instance().start() """ def __init__(self, socket, *args, **kwargs): self.socket = socket @@ -650,20 +662,20 @@ class IOStream(BaseIOStream): May only be called if the socket passed to the constructor was not previously connected. The address parameter is in the - same format as for socket.connect, i.e. a (host, port) tuple. - If callback is specified, it will be called when the - connection is completed. + same format as for `socket.connect `, + i.e. a ``(host, port)`` tuple. If ``callback`` is specified, + it will be called when the connection is completed. If specified, the ``server_hostname`` parameter will be used in SSL connections for certificate validation (if requested in the ``ssl_options``) and SNI (if supported; requires Python 3.2+). - Note that it is safe to call IOStream.write while the - connection is pending, in which case the data will be written - as soon as the connection is ready. Calling IOStream read - methods before the socket is connected works on some platforms - but is non-portable. + Note that it is safe to call `IOStream.write + ` while the connection is pending, in + which case the data will be written as soon as the connection + is ready. Calling `IOStream` read methods before the socket is + connected works on some platforms but is non-portable. """ self._connecting = True try: @@ -711,13 +723,11 @@ class SSLIOStream(IOStream): ssl.wrap_socket(sock, do_handshake_on_connect=False, **kwargs) - before constructing the SSLIOStream. Unconnected sockets will be - wrapped when IOStream.connect is finished. + before constructing the `SSLIOStream`. Unconnected sockets will be + wrapped when `IOStream.connect` is finished. """ def __init__(self, *args, **kwargs): - """Creates an SSLIOStream. - - The ``ssl_options`` keyword argument may either be a dictionary + """The ``ssl_options`` keyword argument may either be a dictionary of keywords arguments for `ssl.wrap_socket`, or an `ssl.SSLContext` object. """ @@ -863,10 +873,12 @@ class SSLIOStream(IOStream): class PipeIOStream(BaseIOStream): - """Pipe-based IOStream implementation. + """Pipe-based `IOStream` implementation. The constructor takes an integer file descriptor (such as one returned - by `os.pipe`) rather than an open file object. + by `os.pipe`) rather than an open file object. Pipes are generally + one-way, so a `PipeIOStream` can be used for reading or writing but not + both. """ def __init__(self, fd, *args, **kwargs): self.fd = fd diff --git a/libs/tornado/locale.py b/libs/tornado/locale.py index e4e1a154..66e9ff6d 100755 --- a/libs/tornado/locale.py +++ b/libs/tornado/locale.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# +# -*- coding: utf-8 -*- # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -18,25 +18,25 @@ To load a locale and generate a translated string:: - user_locale = locale.get("es_LA") + user_locale = tornado.locale.get("es_LA") print user_locale.translate("Sign out") -locale.get() returns the closest matching locale, not necessarily the +`tornado.locale.get()` returns the closest matching locale, not necessarily the specific locale you requested. You can support pluralization with -additional arguments to translate(), e.g.:: +additional arguments to `~Locale.translate()`, e.g.:: people = [...] message = user_locale.translate( "%(list)s is online", "%(list)s are online", len(people)) print message % {"list": user_locale.list(people)} -The first string is chosen if len(people) == 1, otherwise the second +The first string is chosen if ``len(people) == 1``, otherwise the second string is chosen. -Applications should call one of load_translations (which uses a simple -CSV format) or load_gettext_translations (which uses the .mo format -supported by gettext and related tools). If neither method is called, -the locale.translate method will simply return the original string. +Applications should call one of `load_translations` (which uses a simple +CSV format) or `load_gettext_translations` (which uses the ``.mo`` format +supported by `gettext` and related tools). If neither method is called, +the `Locale.translate` method will simply return the original string. """ from __future__ import absolute_import, division, print_function, with_statement @@ -63,15 +63,15 @@ def get(*locale_codes): or a loose match for the code (e.g., "en" for "en_US"), we return the locale. Otherwise we move to the next code in the list. - By default we return en_US if no translations are found for any of + By default we return ``en_US`` if no translations are found for any of the specified locales. You can change the default locale with - set_default_locale() below. + `set_default_locale()`. """ return Locale.get_closest(*locale_codes) def set_default_locale(code): - """Sets the default locale, used in get_closest_locale(). + """Sets the default locale. The default locale is assumed to be the language used for all strings in the system. The translations loaded from disk are mappings from @@ -85,32 +85,32 @@ def set_default_locale(code): def load_translations(directory): - u("""Loads translations from CSV files in a directory. + """Loads translations from CSV files in a directory. Translations are strings with optional Python-style named placeholders - (e.g., "My name is %(name)s") and their associated translations. + (e.g., ``My name is %(name)s``) and their associated translations. - The directory should have translation files of the form LOCALE.csv, - e.g. es_GT.csv. The CSV files should have two or three columns: string, + The directory should have translation files of the form ``LOCALE.csv``, + e.g. ``es_GT.csv``. The CSV files should have two or three columns: string, translation, and an optional plural indicator. Plural indicators should be one of "plural" or "singular". A given string can have both singular - and plural forms. For example "%(name)s liked this" may have a + and plural forms. For example ``%(name)s liked this`` may have a different verb conjugation depending on whether %(name)s is one name or a list of names. There should be two rows in the CSV file for that string, one with plural indicator "singular", and one "plural". For strings with no verbs that would change on translation, simply use "unknown" or the empty string (or don't include the column at all). - The file is read using the csv module in the default "excel" dialect. + The file is read using the `csv` module in the default "excel" dialect. In this format there should not be spaces after the commas. - Example translation es_LA.csv: + Example translation ``es_LA.csv``:: "I love you","Te amo" - "%(name)s liked this","A %(name)s les gust\u00f3 esto","plural" - "%(name)s liked this","A %(name)s le gust\u00f3 esto","singular" + "%(name)s liked this","A %(name)s les gustó esto","plural" + "%(name)s liked this","A %(name)s le gustó esto","singular" - """) + """ global _translations global _supported_locales _translations = {} @@ -151,22 +151,25 @@ def load_translations(directory): def load_gettext_translations(directory, domain): - """Loads translations from gettext's locale tree + """Loads translations from `gettext`'s locale tree - Locale tree is similar to system's /usr/share/locale, like: + Locale tree is similar to system's ``/usr/share/locale``, like:: - {directory}/{lang}/LC_MESSAGES/{domain}.mo + {directory}/{lang}/LC_MESSAGES/{domain}.mo Three steps are required to have you app translated: - 1. Generate POT translation file - xgettext --language=Python --keyword=_:1,2 -d cyclone file1.py file2.html etc + 1. Generate POT translation file:: - 2. Merge against existing POT file: - msgmerge old.po cyclone.po > new.po + xgettext --language=Python --keyword=_:1,2 -d mydomain file1.py file2.html etc - 3. Compile: - msgfmt cyclone.po -o {directory}/pt_BR/LC_MESSAGES/cyclone.mo + 2. Merge against existing POT file:: + + msgmerge old.po mydomain.po > new.po + + 3. Compile:: + + msgfmt mydomain.po -o {directory}/pt_BR/LC_MESSAGES/mydomain.mo """ import gettext global _translations @@ -262,9 +265,10 @@ class Locale(object): def translate(self, message, plural_message=None, count=None): """Returns the translation for the given message for this locale. - If plural_message is given, you must also provide count. We return - plural_message when count != 1, and we return the singular form - for the given message when count == 1. + If ``plural_message`` is given, you must also provide + ``count``. We return ``plural_message`` when ``count != 1``, + and we return the singular form for the given message when + ``count == 1``. """ raise NotImplementedError() @@ -273,10 +277,10 @@ class Locale(object): """Formats the given date (which should be GMT). By default, we return a relative time (e.g., "2 minutes ago"). You - can return an absolute date string with relative=False. + can return an absolute date string with ``relative=False``. You can force a full format date ("July 10, 1980") with - full_format=True. + ``full_format=True``. This method is primarily intended for dates in the past. For dates in the future, we fall back to full format. @@ -360,7 +364,7 @@ class Locale(object): """Formats the given date as a day of week. Example: "Monday, January 22". You can remove the day of week with - dow=False. + ``dow=False``. """ local_date = date - datetime.timedelta(minutes=gmt_offset) _ = self.translate @@ -421,7 +425,7 @@ class CSVLocale(Locale): class GettextLocale(Locale): - """Locale implementation using the gettext module.""" + """Locale implementation using the `gettext` module.""" def __init__(self, code, translations): try: # python 2 diff --git a/libs/tornado/netutil.py b/libs/tornado/netutil.py index 4003245e..7b7d48dd 100755 --- a/libs/tornado/netutil.py +++ b/libs/tornado/netutil.py @@ -41,14 +41,14 @@ def bind_sockets(port, address=None, family=socket.AF_UNSPEC, backlog=128, flags Address may be either an IP address or hostname. If it's a hostname, the server will listen on all IP addresses associated with the name. Address may be an empty string or None to listen on all - available interfaces. Family may be set to either socket.AF_INET - or socket.AF_INET6 to restrict to ipv4 or ipv6 addresses, otherwise + available interfaces. Family may be set to either `socket.AF_INET` + or `socket.AF_INET6` to restrict to IPv4 or IPv6 addresses, otherwise both will be used if available. The ``backlog`` argument has the same meaning as for - ``socket.listen()``. + `socket.listen() `. - ``flags`` is a bitmask of AI_* flags to ``getaddrinfo``, like + ``flags`` is a bitmask of AI_* flags to `~socket.getaddrinfo`, like ``socket.AI_PASSIVE | socket.AI_NUMERICHOST``. """ sockets = [] @@ -119,16 +119,16 @@ if hasattr(socket, 'AF_UNIX'): def add_accept_handler(sock, callback, io_loop=None): - """Adds an ``IOLoop`` event handler to accept new connections on ``sock``. + """Adds an `.IOLoop` event handler to accept new connections on ``sock``. When a connection is accepted, ``callback(connection, address)`` will be run (``connection`` is a socket object, and ``address`` is the address of the other end of the connection). Note that this signature is different from the ``callback(fd, events)`` signature used for - ``IOLoop`` handlers. + `.IOLoop` handlers. """ if io_loop is None: - io_loop = IOLoop.instance() + io_loop = IOLoop.current() def accept_handler(fd, events): while True: @@ -142,7 +142,41 @@ def add_accept_handler(sock, callback, io_loop=None): io_loop.add_handler(sock.fileno(), accept_handler, IOLoop.READ) +def is_valid_ip(ip): + """Returns true if the given string is a well-formed IP address. + + Supports IPv4 and IPv6. + """ + try: + res = socket.getaddrinfo(ip, 0, socket.AF_UNSPEC, + socket.SOCK_STREAM, + 0, socket.AI_NUMERICHOST) + return bool(res) + except socket.gaierror as e: + if e.args[0] == socket.EAI_NONAME: + return False + raise + return True + + class Resolver(Configurable): + """Configurable asynchronous DNS resolver interface. + + By default, a blocking implementation is used (which simply calls + `socket.getaddrinfo`). An alternative implementation can be + chosen with the `Resolver.configure <.Configurable.configure>` + class method:: + + Resolver.configure('tornado.netutil.ThreadedResolver') + + The implementations of this interface included with Tornado are + + * `tornado.netutil.BlockingResolver` + * `tornado.netutil.ThreadedResolver` + * `tornado.netutil.OverrideResolver` + * `tornado.platform.twisted.TwistedResolver` + * `tornado.platform.caresresolver.CaresResolver` + """ @classmethod def configurable_base(cls): return Resolver @@ -151,40 +185,64 @@ class Resolver(Configurable): def configurable_default(cls): return BlockingResolver - def getaddrinfo(self, *args, **kwargs): + def resolve(self, host, port, family=socket.AF_UNSPEC, callback=None): """Resolves an address. - The arguments to this function are the same as to - `socket.getaddrinfo`, with the addition of an optional - keyword-only ``callback`` argument. + The ``host`` argument is a string which may be a hostname or a + literal IP address. - Returns a `Future` whose result is the same as the return - value of `socket.getaddrinfo`. If a callback is passed, - it will be run with the `Future` as an argument when it - is complete. + Returns a `.Future` whose result is a list of (family, + address) pairs, where address is a tuple suitable to pass to + `socket.connect ` (i.e. a ``(host, + port)`` pair for IPv4; additional fields may be present for + IPv6). If a ``callback`` is passed, it will be run with the + result as an argument when it is complete. """ raise NotImplementedError() class ExecutorResolver(Resolver): def initialize(self, io_loop=None, executor=None): - self.io_loop = io_loop or IOLoop.instance() + self.io_loop = io_loop or IOLoop.current() self.executor = executor or dummy_executor @run_on_executor - def getaddrinfo(self, *args, **kwargs): - return socket.getaddrinfo(*args, **kwargs) + def resolve(self, host, port, family=socket.AF_UNSPEC): + addrinfo = socket.getaddrinfo(host, port, family) + results = [] + for family, socktype, proto, canonname, address in addrinfo: + results.append((family, address)) + return results + class BlockingResolver(ExecutorResolver): + """Default `Resolver` implementation, using `socket.getaddrinfo`. + + The `.IOLoop` will be blocked during the resolution, although the + callback will not be run until the next `.IOLoop` iteration. + """ def initialize(self, io_loop=None): super(BlockingResolver, self).initialize(io_loop=io_loop) + class ThreadedResolver(ExecutorResolver): + """Multithreaded non-blocking `Resolver` implementation. + + Requires the `concurrent.futures` package to be installed + (available in the standard library since Python 3.2, + installable with ``pip install futures`` in older versions). + + The thread pool size can be configured with:: + + Resolver.configure('tornado.netutil.ThreadedResolver', + num_threads=10) + """ def initialize(self, io_loop=None, num_threads=10): from concurrent.futures import ThreadPoolExecutor super(ThreadedResolver, self).initialize( io_loop=io_loop, executor=ThreadPoolExecutor(num_threads)) + class OverrideResolver(Resolver): """Wraps a resolver with a mapping of overrides. @@ -197,13 +255,12 @@ class OverrideResolver(Resolver): self.resolver = resolver self.mapping = mapping - def getaddrinfo(self, host, port, *args, **kwargs): + def resolve(self, host, port, *args, **kwargs): if (host, port) in self.mapping: host, port = self.mapping[(host, port)] elif host in self.mapping: host = self.mapping[host] - return self.resolver.getaddrinfo(host, port, *args, **kwargs) - + return self.resolver.resolve(host, port, *args, **kwargs) # These are the keyword arguments to ssl.wrap_socket that must be translated @@ -212,20 +269,22 @@ class OverrideResolver(Resolver): _SSL_CONTEXT_KEYWORDS = frozenset(['ssl_version', 'certfile', 'keyfile', 'cert_reqs', 'ca_certs', 'ciphers']) + def ssl_options_to_context(ssl_options): - """Try to Convert an ssl_options dictionary to an SSLContext object. + """Try to convert an ``ssl_options`` dictionary to an + `~ssl.SSLContext` object. The ``ssl_options`` dictionary contains keywords to be passed to - `ssl.wrap_sockets`. In Python 3.2+, `ssl.SSLContext` objects can + `ssl.wrap_socket`. In Python 3.2+, `ssl.SSLContext` objects can be used instead. This function converts the dict form to its - `SSLContext` equivalent, and may be used when a component which - accepts both forms needs to upgrade to the `SSLContext` version + `~ssl.SSLContext` equivalent, and may be used when a component which + accepts both forms needs to upgrade to the `~ssl.SSLContext` version to use features like SNI or NPN. """ if isinstance(ssl_options, dict): assert all(k in _SSL_CONTEXT_KEYWORDS for k in ssl_options), ssl_options if (not hasattr(ssl, 'SSLContext') or - isinstance(ssl_options, ssl.SSLContext)): + isinstance(ssl_options, ssl.SSLContext)): return ssl_options context = ssl.SSLContext( ssl_options.get('ssl_version', ssl.PROTOCOL_SSLv23)) @@ -241,12 +300,12 @@ def ssl_options_to_context(ssl_options): def ssl_wrap_socket(socket, ssl_options, server_hostname=None, **kwargs): - """Returns an `ssl.SSLSocket` wrapping the given socket. + """Returns an ``ssl.SSLSocket`` wrapping the given socket. ``ssl_options`` may be either a dictionary (as accepted by - `ssl_options_to_context) or an `ssl.SSLContext` object. - Additional keyword arguments are passed to `wrap_socket` - (either the `SSLContext` method or the `ssl` module function + `ssl_options_to_context`) or an `ssl.SSLContext` object. + Additional keyword arguments are passed to ``wrap_socket`` + (either the `~ssl.SSLContext` method or the `ssl` module function as appropriate). """ context = ssl_options_to_context(ssl_options) @@ -262,7 +321,7 @@ def ssl_wrap_socket(socket, ssl_options, server_hostname=None, **kwargs): else: return ssl.wrap_socket(socket, **dict(context, **kwargs)) -if hasattr(ssl, 'match_hostname'): # python 3.2+ +if hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'): # python 3.2+ ssl_match_hostname = ssl.match_hostname SSLCertificateError = ssl.CertificateError else: @@ -272,7 +331,6 @@ else: class SSLCertificateError(ValueError): pass - def _dnsname_to_pat(dn): pats = [] for frag in dn.split(r'.'): @@ -286,7 +344,6 @@ else: pats.append(frag.replace(r'\*', '[^.]*')) return re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) - def ssl_match_hostname(cert, hostname): """Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 rules diff --git a/libs/tornado/options.py b/libs/tornado/options.py index ee146fca..b96f815d 100755 --- a/libs/tornado/options.py +++ b/libs/tornado/options.py @@ -29,27 +29,28 @@ option namespace, e.g.:: db = database.Connection(options.mysql_host) ... -The main() method of your application does not need to be aware of all of +The ``main()`` method of your application does not need to be aware of all of the options used throughout your program; they are all automatically loaded when the modules are loaded. However, all modules that define options must have been imported before the command line is parsed. -Your main() method can parse the command line or parse a config file with +Your ``main()`` method can parse the command line or parse a config file with either:: tornado.options.parse_command_line() # or tornado.options.parse_config_file("/etc/server.conf") -Command line formats are what you would expect ("--myoption=myvalue"). +Command line formats are what you would expect (``--myoption=myvalue``). Config files are just Python files. Global names become options, e.g.:: myoption = "myvalue" myotheroption = "myothervalue" -We support datetimes, timedeltas, ints, and floats (just pass a 'type' -kwarg to define). We also accept multi-value options. See the documentation -for define() below. +We support `datetimes `, `timedeltas +`, ints, and floats (just pass a ``type`` kwarg to +`define`). We also accept multi-value options. See the documentation for +`define()` below. `tornado.options.options` is a singleton instance of `OptionParser`, and the top-level functions in this module (`define`, `parse_command_line`, etc) @@ -68,7 +69,7 @@ import textwrap from tornado.escape import _unicode from tornado.log import define_logging_options from tornado import stack_context -from tornado.util import basestring_type +from tornado.util import basestring_type, exec_in class Error(Exception): @@ -103,28 +104,29 @@ class OptionParser(object): multiple=False, group=None, callback=None): """Defines a new command line option. - If type is given (one of str, float, int, datetime, or timedelta) - or can be inferred from the default, we parse the command line - arguments based on the given type. If multiple is True, we accept + If ``type`` is given (one of str, float, int, datetime, or timedelta) + or can be inferred from the ``default``, we parse the command line + arguments based on the given type. If ``multiple`` is True, we accept comma-separated values, and the option value is always a list. - For multi-value integers, we also accept the syntax x:y, which - turns into range(x, y) - very useful for long integer ranges. + For multi-value integers, we also accept the syntax ``x:y``, which + turns into ``range(x, y)`` - very useful for long integer ranges. - help and metavar are used to construct the automatically generated - command line help string. The help message is formatted like:: + ``help`` and ``metavar`` are used to construct the + automatically generated command line help string. The help + message is formatted like:: --name=METAVAR help string - group is used to group the defined options in logical + ``group`` is used to group the defined options in logical groups. By default, command line options are grouped by the file in which they are defined. Command line option names must be unique globally. They can be parsed - from the command line with parse_command_line() or parsed from a - config file with parse_config_file. + from the command line with `parse_command_line` or parsed from a + config file with `parse_config_file`. - If a callback is given, it will be run with the new value whenever + If a ``callback`` is given, it will be run with the new value whenever the option is changed. This can be used to combine command-line and file-based options:: @@ -159,9 +161,11 @@ class OptionParser(object): callback=callback) def parse_command_line(self, args=None, final=True): - """Parses all options given on the command line (defaults to sys.argv). + """Parses all options given on the command line (defaults to + `sys.argv`). - Note that args[0] is ignored since it is the program name in sys.argv. + Note that ``args[0]`` is ignored since it is the program name + in `sys.argv`. We return a list of all arguments that are not parsed as options. @@ -207,7 +211,8 @@ class OptionParser(object): from multiple sources. """ config = {} - execfile(path, config, config) + with open(path) as f: + exec_in(f.read(), config, config) for name in config: if name in self._options: self._options[name].set(config[name]) @@ -258,15 +263,16 @@ class OptionParser(object): callback() def mockable(self): - """Returns a wrapper around self that is compatible with `mock.patch`. + """Returns a wrapper around self that is compatible with + `mock.patch `. - The `mock.patch` function (included in the standard library - `unittest.mock` package since Python 3.3, or in the - third-party `mock` package for older versions of Python) is - incompatible with objects like ``options`` that override - ``__getattr__`` and ``__setattr__``. This function returns an - object that can be used with `mock.patch.object` to modify - option values:: + The `mock.patch ` function (included in + the standard library `unittest.mock` package since Python 3.3, + or in the third-party ``mock`` package for older versions of + Python) is incompatible with objects like ``options`` that + override ``__getattr__`` and ``__setattr__``. This function + returns an object that can be used with `mock.patch.object + ` to modify option values:: with mock.patch.object(options.mockable(), 'name', value): assert options.name == value diff --git a/libs/tornado/platform/caresresolver.py b/libs/tornado/platform/caresresolver.py new file mode 100755 index 00000000..7c16705d --- /dev/null +++ b/libs/tornado/platform/caresresolver.py @@ -0,0 +1,75 @@ +import pycares +import socket + +from tornado import gen +from tornado.ioloop import IOLoop +from tornado.netutil import Resolver, is_valid_ip + + +class CaresResolver(Resolver): + """Name resolver based on the c-ares library. + + This is a non-blocking and non-threaded resolver. It may not produce + the same results as the system resolver, but can be used for non-blocking + resolution when threads cannot be used. + + c-ares fails to resolve some names when ``family`` is ``AF_UNSPEC``, + so it is only recommended for use in ``AF_INET`` (i.e. IPv4). This is + the default for ``tornado.simple_httpclient``, but other libraries + may default to ``AF_UNSPEC``. + """ + def initialize(self, io_loop=None): + self.io_loop = io_loop or IOLoop.current() + self.channel = pycares.Channel(sock_state_cb=self._sock_state_cb) + self.fds = {} + + def _sock_state_cb(self, fd, readable, writable): + state = ((IOLoop.READ if readable else 0) | + (IOLoop.WRITE if writable else 0)) + if not state: + self.io_loop.remove_handler(fd) + del self.fds[fd] + elif fd in self.fds: + self.io_loop.update_handler(fd, state) + self.fds[fd] = state + else: + self.io_loop.add_handler(fd, self._handle_events, state) + self.fds[fd] = state + + def _handle_events(self, fd, events): + read_fd = pycares.ARES_SOCKET_BAD + write_fd = pycares.ARES_SOCKET_BAD + if events & IOLoop.READ: + read_fd = fd + if events & IOLoop.WRITE: + write_fd = fd + self.channel.process_fd(read_fd, write_fd) + + @gen.coroutine + def resolve(self, host, port, family=0): + if is_valid_ip(host): + addresses = [host] + else: + # gethostbyname doesn't take callback as a kwarg + self.channel.gethostbyname(host, family, (yield gen.Callback(1))) + callback_args = yield gen.Wait(1) + assert isinstance(callback_args, gen.Arguments) + assert not callback_args.kwargs + result, error = callback_args.args + if error: + raise Exception('C-Ares returned error %s: %s while resolving %s' % + (error, pycares.errno.strerror(error), host)) + addresses = result.addresses + addrinfo = [] + for address in addresses: + if '.' in address: + address_family = socket.AF_INET + elif ':' in address: + address_family = socket.AF_INET6 + else: + address_family = socket.AF_UNSPEC + if family != socket.AF_UNSPEC and family != address_family: + raise Exception('Requested socket family %d but got %d' % + (family, address_family)) + addrinfo.append((address_family, (address, port))) + raise gen.Return(addrinfo) diff --git a/libs/tornado/platform/twisted.py b/libs/tornado/platform/twisted.py index 34e108d7..910e46af 100755 --- a/libs/tornado/platform/twisted.py +++ b/libs/tornado/platform/twisted.py @@ -22,6 +22,8 @@ This module lets you run applications and libraries written for Twisted in a Tornado application. It can be used in two modes, depending on which library's underlying event loop you want to use. +This module has been tested with Twisted versions 11.0.0 and newer. + Twisted on Tornado ------------------ @@ -60,26 +62,33 @@ reactor. Recommended usage:: reactor.run() `TwistedIOLoop` always uses the global Twisted reactor. - -This module has been tested with Twisted versions 11.0.0 and newer. """ from __future__ import absolute_import, division, print_function, with_statement -import functools import datetime +import functools +import socket +import twisted.internet.abstract from twisted.internet.posixbase import PosixReactorBase from twisted.internet.interfaces import \ IReactorFDSet, IDelayedCall, IReactorTime, IReadDescriptor, IWriteDescriptor from twisted.python import failure, log from twisted.internet import error +import twisted.names.cache +import twisted.names.client +import twisted.names.hosts +import twisted.names.resolve from zope.interface import implementer -import tornado +from tornado.concurrent import return_future +from tornado.escape import utf8 +from tornado import gen import tornado.ioloop from tornado.log import app_log +from tornado.netutil import Resolver from tornado.stack_context import NullContext, wrap from tornado.ioloop import IOLoop @@ -140,7 +149,7 @@ class TornadoReactor(PosixReactorBase): """ def __init__(self, io_loop=None): if not io_loop: - io_loop = tornado.ioloop.IOLoop.instance() + io_loop = tornado.ioloop.IOLoop.current() self._io_loop = io_loop self._readers = {} # map of reader objects to fd self._writers = {} # map of writer objects to fd @@ -177,8 +186,12 @@ class TornadoReactor(PosixReactorBase): def callFromThread(self, f, *args, **kw): """See `twisted.internet.interfaces.IReactorThreads.callFromThread`""" assert callable(f), "%s is not callable" % f - p = functools.partial(f, *args, **kw) - self._io_loop.add_callback(p) + with NullContext(): + # This NullContext is mainly for an edge case when running + # TwistedIOLoop on top of a TornadoReactor. + # TwistedIOLoop.add_callback uses reactor.callFromThread and + # should not pick up additional StackContexts along the way. + self._io_loop.add_callback(f, *args, **kw) # We don't need the waker code from the super class, Tornado uses # its own waker. @@ -344,7 +357,7 @@ class _TestReactor(TornadoReactor): def install(io_loop=None): """Install this package as the default Twisted reactor.""" if not io_loop: - io_loop = tornado.ioloop.IOLoop.instance() + io_loop = tornado.ioloop.IOLoop.current() reactor = TornadoReactor(io_loop) from twisted.internet.main import installReactor installReactor(reactor) @@ -383,18 +396,21 @@ class _FD(object): class TwistedIOLoop(tornado.ioloop.IOLoop): """IOLoop implementation that runs on Twisted. - Uses the global Twisted reactor. It is possible to create multiple - TwistedIOLoops in the same process, but it doesn't really make sense - because they will all run in the same thread. + Uses the global Twisted reactor by default. To create multiple + `TwistedIOLoops` in the same process, you must pass a unique reactor + when constructing each one. Not compatible with `tornado.process.Subprocess.set_exit_callback` because the ``SIGCHLD`` handlers used by Tornado and Twisted conflict with each other. """ - def initialize(self): - from twisted.internet import reactor + def initialize(self, reactor=None): + if reactor is None: + import twisted.internet.reactor + reactor = twisted.internet.reactor self.reactor = reactor self.fds = {} + self.reactor.callWhenRunning(self.make_current) def close(self, all_fds=False): self.reactor.removeAll() @@ -456,13 +472,14 @@ class TwistedIOLoop(tornado.ioloop.IOLoop): if isinstance(deadline, (int, long, float)): delay = max(deadline - self.time(), 0) elif isinstance(deadline, datetime.timedelta): - delay = deadline.total_seconds() + delay = tornado.ioloop._Timeout.timedelta_to_seconds(deadline) else: raise TypeError("Unsupported deadline %r") return self.reactor.callLater(delay, self._run_callback, wrap(callback)) def remove_timeout(self, timeout): - timeout.cancel() + if timeout.active(): + timeout.cancel() def add_callback(self, callback, *args, **kwargs): self.reactor.callFromThread(self._run_callback, @@ -470,3 +487,58 @@ class TwistedIOLoop(tornado.ioloop.IOLoop): def add_callback_from_signal(self, callback, *args, **kwargs): self.add_callback(callback, *args, **kwargs) + + +class TwistedResolver(Resolver): + """Twisted-based asynchronous resolver. + + This is a non-blocking and non-threaded resolver. It is + recommended only when threads cannot be used, since it has + limitations compared to the standard ``getaddrinfo``-based + `~tornado.netutil.Resolver` and + `~tornado.netutil.ThreadedResolver`. Specifically, it returns at + most one result, and arguments other than ``host`` and ``family`` + are ignored. It may fail to resolve when ``family`` is not + ``socket.AF_UNSPEC``. + + Requires Twisted 12.1 or newer. + """ + def initialize(self, io_loop=None): + self.io_loop = io_loop or IOLoop.current() + # partial copy of twisted.names.client.createResolver, which doesn't + # allow for a reactor to be passed in. + self.reactor = tornado.platform.twisted.TornadoReactor(io_loop) + + host_resolver = twisted.names.hosts.Resolver('/etc/hosts') + cache_resolver = twisted.names.cache.CacheResolver(reactor=self.reactor) + real_resolver = twisted.names.client.Resolver('/etc/resolv.conf', + reactor=self.reactor) + self.resolver = twisted.names.resolve.ResolverChain( + [host_resolver, cache_resolver, real_resolver]) + + @gen.coroutine + def resolve(self, host, port, family=0): + # getHostByName doesn't accept IP addresses, so if the input + # looks like an IP address just return it immediately. + if twisted.internet.abstract.isIPAddress(host): + resolved = host + resolved_family = socket.AF_INET + elif twisted.internet.abstract.isIPv6Address(host): + resolved = host + resolved_family = socket.AF_INET6 + else: + deferred = self.resolver.getHostByName(utf8(host)) + resolved = yield gen.Task(deferred.addCallback) + if twisted.internet.abstract.isIPAddress(resolved): + resolved_family = socket.AF_INET + elif twisted.internet.abstract.isIPv6Address(resolved): + resolved_family = socket.AF_INET6 + else: + resolved_family = socket.AF_UNSPEC + if family != socket.AF_UNSPEC and family != resolved_family: + raise Exception('Requested socket family %d but got %d' % + (family, resolved_family)) + result = [ + (resolved_family, (resolved, port)), + ] + raise gen.Return(result) diff --git a/libs/tornado/process.py b/libs/tornado/process.py index 0509eb3a..438db66d 100755 --- a/libs/tornado/process.py +++ b/libs/tornado/process.py @@ -14,7 +14,9 @@ # License for the specific language governing permissions and limitations # under the License. -"""Utilities for working with multiple processes.""" +"""Utilities for working with multiple processes, including both forking +the server into multiple processes and managing subprocesses. +""" from __future__ import absolute_import, division, print_function, with_statement @@ -169,8 +171,8 @@ class Subprocess(object): additions: * ``stdin``, ``stdout``, and ``stderr`` may have the value - `tornado.process.Subprocess.STREAM`, which will make the corresponding - attribute of the resulting Subprocess a `PipeIOStream`. + ``tornado.process.Subprocess.STREAM``, which will make the corresponding + attribute of the resulting Subprocess a `.PipeIOStream`. * A new keyword argument ``io_loop`` may be used to pass in an IOLoop. """ STREAM = object() @@ -229,15 +231,15 @@ class Subprocess(object): def initialize(cls, io_loop=None): """Initializes the ``SIGCHILD`` handler. - The signal handler is run on an IOLoop to avoid locking issues. - Note that the IOLoop used for signal handling need not be the + The signal handler is run on an `.IOLoop` to avoid locking issues. + Note that the `.IOLoop` used for signal handling need not be the same one used by individual Subprocess objects (as long as the - IOLoops are each running in separate threads). + ``IOLoops`` are each running in separate threads). """ if cls._initialized: return if io_loop is None: - io_loop = ioloop.IOLoop.instance() + io_loop = ioloop.IOLoop.current() cls._old_sigchld = signal.signal( signal.SIGCHLD, lambda sig, frame: io_loop.add_callback_from_signal(cls._cleanup)) diff --git a/libs/tornado/simple_httpclient.py b/libs/tornado/simple_httpclient.py index f33ed242..117ce75b 100755 --- a/libs/tornado/simple_httpclient.py +++ b/libs/tornado/simple_httpclient.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, division, print_function, with_statement from tornado.escape import utf8, _unicode, native_str -from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy +from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy from tornado.httputil import HTTPHeaders from tornado.iostream import IOStream, SSLIOStream from tornado.netutil import Resolver, OverrideResolver @@ -92,10 +92,12 @@ class SimpleAsyncHTTPClient(AsyncHTTPClient): request, callback = self.queue.popleft() key = object() self.active[key] = (request, callback) - _HTTPConnection(self.io_loop, self, request, - functools.partial(self._release_fetch, key), - callback, - self.max_buffer_size, self.resolver) + release_callback = functools.partial(self._release_fetch, key) + self._handle_request(request, release_callback, callback) + + def _handle_request(self, request, release_callback, final_callback): + _HTTPConnection(self.io_loop, self, request, release_callback, + final_callback, self.max_buffer_size, self.resolver) def _release_fetch(self, key): del self.active[key] @@ -150,13 +152,24 @@ class _HTTPConnection(object): # so restrict to ipv4 by default. af = socket.AF_INET - self.resolver.getaddrinfo( - host, port, af, socket.SOCK_STREAM, 0, 0, - callback=self._on_resolve) + self.resolver.resolve(host, port, af, callback=self._on_resolve) - def _on_resolve(self, future): - af, socktype, proto, canonname, sockaddr = future.result()[0] + def _on_resolve(self, addrinfo): + self.stream = self._create_stream(addrinfo) + timeout = min(self.request.connect_timeout, self.request.request_timeout) + if timeout: + self._timeout = self.io_loop.add_timeout( + self.start_time + timeout, + stack_context.wrap(self._on_timeout)) + self.stream.set_close_callback(self._on_close) + # ipv6 addresses are broken (in self.parsed.hostname) until + # 2.7, here is correctly parsed value calculated in __init__ + sockaddr = addrinfo[0][1] + self.stream.connect(sockaddr, self._on_connect, + server_hostname=self.parsed_hostname) + def _create_stream(self, addrinfo): + af = addrinfo[0][0] if self.parsed.scheme == "https": ssl_options = {} if self.request.validate_cert: @@ -189,24 +202,14 @@ class _HTTPConnection(object): # information. ssl_options["ssl_version"] = ssl.PROTOCOL_SSLv3 - self.stream = SSLIOStream(socket.socket(af, socktype, proto), - io_loop=self.io_loop, - ssl_options=ssl_options, - max_buffer_size=self.max_buffer_size) + return SSLIOStream(socket.socket(af), + io_loop=self.io_loop, + ssl_options=ssl_options, + max_buffer_size=self.max_buffer_size) else: - self.stream = IOStream(socket.socket(af, socktype, proto), - io_loop=self.io_loop, - max_buffer_size=self.max_buffer_size) - timeout = min(self.request.connect_timeout, self.request.request_timeout) - if timeout: - self._timeout = self.io_loop.add_timeout( - self.start_time + timeout, - stack_context.wrap(self._on_timeout)) - self.stream.set_close_callback(self._on_close) - # ipv6 addresses are broken (in self.parsed.hostname) until - # 2.7, here is correctly parsed value calculated in __init__ - self.stream.connect(sockaddr, self._on_connect, - server_hostname=self.parsed_hostname) + return IOStream(socket.socket(af), + io_loop=self.io_loop, + max_buffer_size=self.max_buffer_size) def _on_timeout(self): self._timeout = None @@ -246,6 +249,9 @@ class _HTTPConnection(object): username = self.request.auth_username password = self.request.auth_password or '' if username is not None: + if self.request.auth_mode not in (None, "basic"): + raise ValueError("unsupported auth_mode %s", + self.request.auth_mode) auth = utf8(username) + b":" + utf8(password) self.request.headers["Authorization"] = (b"Basic " + base64.b64encode(auth)) @@ -414,7 +420,7 @@ class _HTTPConnection(object): self.final_callback = None self._release() self.client.fetch(new_request, final_callback) - self.stream.close() + self._on_end_request() return if self._decompressor: data = (self._decompressor.decompress(data) + @@ -434,6 +440,9 @@ class _HTTPConnection(object): buffer=buffer, effective_url=self.request.url) self._run_callback(response) + self._on_end_request() + + def _on_end_request(self): self.stream.close() def _on_chunk_length(self, data): diff --git a/libs/tornado/stack_context.py b/libs/tornado/stack_context.py index c30a2598..8804d42d 100755 --- a/libs/tornado/stack_context.py +++ b/libs/tornado/stack_context.py @@ -14,20 +14,21 @@ # License for the specific language governing permissions and limitations # under the License. -"""StackContext allows applications to maintain threadlocal-like state +"""`StackContext` allows applications to maintain threadlocal-like state that follows execution as it moves to other execution contexts. The motivating examples are to eliminate the need for explicit -async_callback wrappers (as in tornado.web.RequestHandler), and to +``async_callback`` wrappers (as in `tornado.web.RequestHandler`), and to allow some additional context to be kept for logging. -This is slightly magic, but it's an extension of the idea that an exception -handler is a kind of stack-local state and when that stack is suspended -and resumed in a new context that state needs to be preserved. StackContext -shifts the burden of restoring that state from each call site (e.g. -wrapping each AsyncHTTPClient callback in async_callback) to the mechanisms -that transfer control from one context to another (e.g. AsyncHTTPClient -itself, IOLoop, thread pools, etc). +This is slightly magic, but it's an extension of the idea that an +exception handler is a kind of stack-local state and when that stack +is suspended and resumed in a new context that state needs to be +preserved. `StackContext` shifts the burden of restoring that state +from each call site (e.g. wrapping each `.AsyncHTTPClient` callback +in ``async_callback``) to the mechanisms that transfer control from +one context to another (e.g. `.AsyncHTTPClient` itself, `.IOLoop`, +thread pools, etc). Example usage:: @@ -52,7 +53,7 @@ Here are a few rules of thumb for when it's necessary: * If you're writing an asynchronous library that doesn't rely on a stack_context-aware library like `tornado.ioloop` or `tornado.iostream` (for example, if you're writing a thread pool), use - `stack_context.wrap()` before any asynchronous operations to capture the + `.stack_context.wrap()` before any asynchronous operations to capture the stack context from where the operation was started. * If you're writing an asynchronous library that has some shared @@ -68,9 +69,6 @@ Here are a few rules of thumb for when it's necessary: from __future__ import absolute_import, division, print_function, with_statement -import contextlib -import functools -import operator import sys import threading @@ -83,7 +81,7 @@ class StackContextInconsistentError(Exception): class _State(threading.local): def __init__(self): - self.contexts = () + self.contexts = (tuple(), None) _state = _State() @@ -107,34 +105,41 @@ class StackContext(object): context that are currently pending). This is an advanced feature and not necessary in most applications. """ - def __init__(self, context_factory, _active_cell=None): + def __init__(self, context_factory): self.context_factory = context_factory - self.active_cell = _active_cell or [True] + self.contexts = [] + + # StackContext protocol + def enter(self): + context = self.context_factory() + self.contexts.append(context) + context.__enter__() + + def exit(self, type, value, traceback): + context = self.contexts.pop() + context.__exit__(type, value, traceback) # Note that some of this code is duplicated in ExceptionStackContext # below. ExceptionStackContext is more common and doesn't need # the full generality of this class. def __enter__(self): self.old_contexts = _state.contexts - # _state.contexts is a tuple of (class, arg, active_cell) tuples - self.new_contexts = (self.old_contexts + - ((StackContext, self.context_factory, - self.active_cell),)) + self.new_contexts = (self.old_contexts[0] + (self,), self) _state.contexts = self.new_contexts + try: - self.context = self.context_factory() - self.context.__enter__() - except Exception: + self.enter() + except: _state.contexts = self.old_contexts raise - return lambda: operator.setitem(self.active_cell, 0, False) def __exit__(self, type, value, traceback): try: - return self.context.__exit__(type, value, traceback) + self.exit(type, value, traceback) finally: final_contexts = _state.contexts _state.contexts = self.old_contexts + # Generator coroutines and with-statements with non-local # effects interact badly. Check here for signs of # the stack getting out of sync. @@ -145,33 +150,32 @@ class StackContext(object): raise StackContextInconsistentError( 'stack_context inconsistency (may be caused by yield ' 'within a "with StackContext" block)') - self.old_contexts = self.new_contexts = None class ExceptionStackContext(object): """Specialization of StackContext for exception handling. - The supplied exception_handler function will be called in the + The supplied ``exception_handler`` function will be called in the event of an uncaught exception in this context. The semantics are similar to a try/finally clause, and intended use cases are to log an error, close a socket, or similar cleanup actions. The - exc_info triple (type, value, traceback) will be passed to the + ``exc_info`` triple ``(type, value, traceback)`` will be passed to the exception_handler function. If the exception handler returns true, the exception will be consumed and will not be propagated to other exception handlers. """ - def __init__(self, exception_handler, _active_cell=None): + def __init__(self, exception_handler): self.exception_handler = exception_handler - self.active_cell = _active_cell or [True] + + def exit(self, type, value, traceback): + if type is not None: + return self.exception_handler(type, value, traceback) def __enter__(self): self.old_contexts = _state.contexts - self.new_contexts = (self.old_contexts + - ((ExceptionStackContext, self.exception_handler, - self.active_cell),)) + self.new_contexts = (self.old_contexts[0], self) _state.contexts = self.new_contexts - return lambda: operator.setitem(self.active_cell, 0, False) def __exit__(self, type, value, traceback): try: @@ -180,98 +184,116 @@ class ExceptionStackContext(object): finally: final_contexts = _state.contexts _state.contexts = self.old_contexts + if final_contexts is not self.new_contexts: raise StackContextInconsistentError( 'stack_context inconsistency (may be caused by yield ' 'within a "with StackContext" block)') - self.old_contexts = self.new_contexts = None class NullContext(object): - """Resets the StackContext. + """Resets the `StackContext`. - Useful when creating a shared resource on demand (e.g. an AsyncHTTPClient) - where the stack that caused the creating is not relevant to future - operations. + Useful when creating a shared resource on demand (e.g. an + `.AsyncHTTPClient`) where the stack that caused the creating is + not relevant to future operations. """ def __enter__(self): self.old_contexts = _state.contexts - _state.contexts = () + _state.contexts = (tuple(), None) def __exit__(self, type, value, traceback): _state.contexts = self.old_contexts -class _StackContextWrapper(functools.partial): - pass - - def wrap(fn): - """Returns a callable object that will restore the current StackContext + """Returns a callable object that will restore the current `StackContext` when executed. Use this whenever saving a callback to be executed later in a different execution context (either in a different thread or asynchronously in the same thread). """ - if fn is None or fn.__class__ is _StackContextWrapper: + # Check if function is already wrapped + if fn is None or hasattr(fn, '_wrapped'): return fn - # functools.wraps doesn't appear to work on functools.partial objects - #@functools.wraps(fn) + # Capture current stack head + contexts = _state.contexts + + #@functools.wraps def wrapped(*args, **kwargs): - callback, contexts, args = args[0], args[1], args[2:] + try: + # Force local state - switch to new stack chain + current_state = _state.contexts + _state.contexts = contexts - if _state.contexts: - new_contexts = [NullContext()] - else: - new_contexts = [] - if contexts: - new_contexts.extend(cls(arg, active_cell) - for (cls, arg, active_cell) in contexts - if active_cell[0]) - if len(new_contexts) > 1: - with _nested(*new_contexts): - callback(*args, **kwargs) - elif new_contexts: - with new_contexts[0]: - callback(*args, **kwargs) - else: - callback(*args, **kwargs) - return _StackContextWrapper(wrapped, fn, _state.contexts) + # Current exception + exc = (None, None, None) + top = None + + # Apply stack contexts + last_ctx = 0 + stack = contexts[0] + + # Apply state + for n in stack: + try: + n.enter() + last_ctx += 1 + except: + # Exception happened. Record exception info and store top-most handler + exc = sys.exc_info() + top = n.old_contexts[1] + + # Execute callback if no exception happened while restoring state + if top is None: + try: + fn(*args, **kwargs) + except: + exc = sys.exc_info() + top = contexts[1] + + # If there was exception, try to handle it by going through the exception chain + if top is not None: + exc = _handle_exception(top, exc) + else: + # Otherwise take shorter path and run stack contexts in reverse order + while last_ctx > 0: + last_ctx -= 1 + c = stack[last_ctx] + + try: + c.exit(*exc) + except: + exc = sys.exc_info() + top = c.old_contexts[1] + break + else: + top = None + + # If if exception happened while unrolling, take longer exception handler path + if top is not None: + exc = _handle_exception(top, exc) + + # If exception was not handled, raise it + if exc != (None, None, None): + raise_exc_info(exc) + finally: + _state.contexts = current_state + + wrapped._wrapped = True + return wrapped -@contextlib.contextmanager -def _nested(*managers): - """Support multiple context managers in a single with-statement. +def _handle_exception(tail, exc): + while tail is not None: + try: + if tail.exit(*exc): + exc = (None, None, None) + except: + exc = sys.exc_info() - Copied from the python 2.6 standard library. It's no longer present - in python 3 because the with statement natively supports multiple - context managers, but that doesn't help if the list of context - managers is not known until runtime. - """ - exits = [] - vars = [] - exc = (None, None, None) - try: - for mgr in managers: - exit = mgr.__exit__ - enter = mgr.__enter__ - vars.append(enter()) - exits.append(exit) - yield vars - except: - exc = sys.exc_info() - finally: - while exits: - exit = exits.pop() - try: - if exit(*exc): - exc = (None, None, None) - except: - exc = sys.exc_info() - if exc != (None, None, None): - # Don't rely on sys.exc_info() still containing - # the right information. Another exception may - # have been raised and caught by an exit method - raise_exc_info(exc) + tail = tail.old_contexts[1] + + return exc diff --git a/libs/tornado/tcpserver.py b/libs/tornado/tcpserver.py index 52ed70b1..fbd9c63d 100755 --- a/libs/tornado/tcpserver.py +++ b/libs/tornado/tcpserver.py @@ -28,13 +28,13 @@ from tornado.iostream import IOStream, SSLIOStream from tornado.netutil import bind_sockets, add_accept_handler, ssl_wrap_socket from tornado import process + class TCPServer(object): r"""A non-blocking, single-threaded TCP server. To use `TCPServer`, define a subclass which overrides the `handle_stream` method. - `TCPServer` can serve SSL traffic with Python 2.6+ and OpenSSL. To make this server serve SSL traffic, send the ssl_options dictionary argument with the arguments required for the `ssl.wrap_socket` method, including "certfile" and "keyfile":: @@ -59,9 +59,9 @@ class TCPServer(object): server.start(0) # Forks multiple sub-processes IOLoop.instance().start() - When using this interface, an `IOLoop` must *not* be passed + When using this interface, an `.IOLoop` must *not* be passed to the `TCPServer` constructor. `start` will always start - the server on the default singleton `IOLoop`. + the server on the default singleton `.IOLoop`. 3. `add_sockets`: advanced multi-process:: @@ -76,7 +76,7 @@ class TCPServer(object): flexibility in when the fork happens. `add_sockets` can also be used in single-process servers if you want to create your listening sockets in some way other than - `bind_sockets`. + `~tornado.netutil.bind_sockets`. """ def __init__(self, io_loop=None, ssl_options=None): self.io_loop = io_loop @@ -108,7 +108,7 @@ class TCPServer(object): This method may be called more than once to listen on multiple ports. `listen` takes effect immediately; it is not necessary to call `TCPServer.start` afterwards. It is, however, necessary to start - the `IOLoop`. + the `.IOLoop`. """ sockets = bind_sockets(port, address=address) self.add_sockets(sockets) @@ -117,13 +117,13 @@ class TCPServer(object): """Makes this server start accepting connections on the given sockets. The ``sockets`` parameter is a list of socket objects such as - those returned by `bind_sockets`. + those returned by `~tornado.netutil.bind_sockets`. `add_sockets` is typically used in combination with that method and `tornado.process.fork_processes` to provide greater control over the initialization of a multi-process server. """ if self.io_loop is None: - self.io_loop = IOLoop.instance() + self.io_loop = IOLoop.current() for sock in sockets: self._sockets[sock.fileno()] = sock @@ -144,12 +144,12 @@ class TCPServer(object): Address may be either an IP address or hostname. If it's a hostname, the server will listen on all IP addresses associated with the name. Address may be an empty string or None to listen on all - available interfaces. Family may be set to either ``socket.AF_INET`` - or ``socket.AF_INET6`` to restrict to ipv4 or ipv6 addresses, otherwise + available interfaces. Family may be set to either `socket.AF_INET` + or `socket.AF_INET6` to restrict to IPv4 or IPv6 addresses, otherwise both will be used if available. The ``backlog`` argument has the same meaning as for - `socket.listen`. + `socket.listen `. This method may be called multiple times prior to `start` to listen on multiple ports or interfaces. @@ -162,7 +162,7 @@ class TCPServer(object): self._pending_sockets.extend(sockets) def start(self, num_processes=1): - """Starts this server in the IOLoop. + """Starts this server in the `.IOLoop`. By default, we run the server in this process and do not fork any additional child process. @@ -199,7 +199,7 @@ class TCPServer(object): sock.close() def handle_stream(self, stream, address): - """Override to handle a new `IOStream` from an incoming connection.""" + """Override to handle a new `.IOStream` from an incoming connection.""" raise NotImplementedError() def _handle_connection(self, connection, address): diff --git a/libs/tornado/template.py b/libs/tornado/template.py index 4f61de3f..8e1bfbae 100755 --- a/libs/tornado/template.py +++ b/libs/tornado/template.py @@ -79,9 +79,10 @@ We provide the functions escape(), url_escape(), json_encode(), and squeeze() to all templates by default. Typical applications do not create `Template` or `Loader` instances by -hand, but instead use the `render` and `render_string` methods of +hand, but instead use the `~.RequestHandler.render` and +`~.RequestHandler.render_string` methods of `tornado.web.RequestHandler`, which load templates automatically based -on the ``template_path`` `Application` setting. +on the ``template_path`` `.Application` setting. Syntax Reference ---------------- @@ -109,7 +110,7 @@ with ``{# ... #}``. ``{% autoescape *function* %}`` Sets the autoescape mode for the current file. This does not affect other files, even those referenced by ``{% include %}``. Note that - autoescaping can also be configured globally, at the `Application` + autoescaping can also be configured globally, at the `.Application` or `Loader`.:: {% autoescape xhtml_escape %} @@ -298,14 +299,14 @@ class Template(object): class BaseLoader(object): - """Base class for template loaders.""" + """Base class for template loaders. + + You must use a template loader to use template constructs like + ``{% extends %}`` and ``{% include %}``. The loader caches all + templates after they are loaded the first time. + """ def __init__(self, autoescape=_DEFAULT_AUTOESCAPE, namespace=None): - """Creates a template loader. - - root_directory may be the empty string if this loader does not - use the filesystem. - - autoescape must be either None or a string naming a function + """``autoescape`` must be either None or a string naming a function in the template namespace, such as "xhtml_escape". """ self.autoescape = autoescape @@ -341,10 +342,6 @@ class BaseLoader(object): class Loader(BaseLoader): """A template loader that loads from a single root directory. - - You must use a template loader to use template constructs like - {% extends %} and {% include %}. Loader caches all templates after - they are loaded the first time. """ def __init__(self, root_directory, **kwargs): super(Loader, self).__init__(**kwargs) diff --git a/libs/tornado/testing.py b/libs/tornado/testing.py index 30fe4e29..51663a4a 100755 --- a/libs/tornado/testing.py +++ b/libs/tornado/testing.py @@ -1,21 +1,13 @@ #!/usr/bin/env python """Support classes for automated testing. -This module contains three parts: +* `AsyncTestCase` and `AsyncHTTPTestCase`: Subclasses of unittest.TestCase + with additional support for testing asynchronous (`.IOLoop` based) code. -* `AsyncTestCase`/`AsyncHTTPTestCase`: Subclasses of unittest.TestCase - with additional support for testing asynchronous (IOLoop-based) code. - -* `LogTrapTestCase`: Subclass of unittest.TestCase that discards log output - from tests that pass and only produces output for failing tests. +* `ExpectLog` and `LogTrapTestCase`: Make test logs less spammy. * `main()`: A simple test runner (wrapper around unittest.main()) with support for the tornado.autoreload module to rerun the tests when code changes. - -These components may be used together or independently. In particular, -it is safe to combine AsyncTestCase and LogTrapTestCase via multiple -inheritance. See the docstrings for each class/function below for more -information. """ from __future__ import absolute_import, division, print_function, with_statement @@ -46,12 +38,11 @@ import re import signal import socket import sys -import types try: - from io import StringIO # py3 -except ImportError: from cStringIO import StringIO # py2 +except ImportError: + from io import StringIO # py3 # Tornado's own test suite requires the updated unittest module # (either py27+ or unittest2) so tornado.test.util enforces @@ -91,30 +82,53 @@ def bind_unused_port(): return sock, port +def get_async_test_timeout(): + """Get the global timeout setting for async tests. + + Returns a float, the timeout in seconds. + """ + try: + return float(os.environ.get('ASYNC_TEST_TIMEOUT')) + except (ValueError, TypeError): + return 5 + + class AsyncTestCase(unittest.TestCase): - """TestCase subclass for testing IOLoop-based asynchronous code. + """`~unittest.TestCase` subclass for testing `.IOLoop`-based + asynchronous code. - The unittest framework is synchronous, so the test must be complete - by the time the test method returns. This method provides the stop() - and wait() methods for this purpose. The test method itself must call - self.wait(), and asynchronous callbacks should call self.stop() to signal - completion. + The unittest framework is synchronous, so the test must be + complete by the time the test method returns. This class provides + the `stop()` and `wait()` methods for this purpose. The test + method itself must call ``self.wait()``, and asynchronous + callbacks should call ``self.stop()`` to signal completion. + Alternately, the `gen_test` decorator can be used to use yield points + from the `tornado.gen` module. - By default, a new IOLoop is constructed for each test and is available - as self.io_loop. This IOLoop should be used in the construction of + By default, a new `.IOLoop` is constructed for each test and is available + as ``self.io_loop``. This `.IOLoop` should be used in the construction of HTTP clients/servers, etc. If the code being tested requires a - global IOLoop, subclasses should override get_new_ioloop to return it. + global `.IOLoop`, subclasses should override `get_new_ioloop` to return it. - The IOLoop's start and stop methods should not be called directly. - Instead, use self.stop self.wait. Arguments passed to self.stop are - returned from self.wait. It is possible to have multiple - wait/stop cycles in the same test. + The `.IOLoop`'s ``start`` and ``stop`` methods should not be + called directly. Instead, use `self.stop ` and `self.wait + `. Arguments passed to ``self.stop`` are returned from + ``self.wait``. It is possible to have multiple ``wait``/``stop`` + cycles in the same test. Example:: - # This test uses an asynchronous style similar to most async - # application code. + # This test uses argument passing between self.stop and self.wait. class MyTestCase(AsyncTestCase): + def test_http_fetch(self): + client = AsyncHTTPClient(self.io_loop) + client.fetch("http://www.tornadoweb.org/", self.stop) + response = self.wait() + # Test contents of response + self.assertIn("FriendFeed", response.body) + + # This test uses an explicit callback-based style. + class MyTestCase2(AsyncTestCase): def test_http_fetch(self): client = AsyncHTTPClient(self.io_loop) client.fetch("http://www.tornadoweb.org/", self.handle_fetch) @@ -128,19 +142,6 @@ class AsyncTestCase(unittest.TestCase): # self.wait() in test_http_fetch() via stack_context. self.assertIn("FriendFeed", response.body) self.stop() - - # This test uses the argument passing between self.stop and self.wait - # for a simpler, more synchronous style. - # This style is recommended over the preceding example because it - # keeps the assertions in the test method itself, and is therefore - # less sensitive to the subtleties of stack_context. - class MyTestCase2(AsyncTestCase): - def test_http_fetch(self): - client = AsyncHTTPClient(self.io_loop) - client.fetch("http://www.tornadoweb.org/", self.stop) - response = self.wait() - # Test contents of response - self.assertIn("FriendFeed", response.body) """ def __init__(self, *args, **kwargs): super(AsyncTestCase, self).__init__(*args, **kwargs) @@ -165,16 +166,21 @@ class AsyncTestCase(unittest.TestCase): # set FD_CLOEXEC on its file descriptors) self.io_loop.close(all_fds=True) super(AsyncTestCase, self).tearDown() + # In case an exception escaped or the StackContext caught an exception + # when there wasn't a wait() to re-raise it, do so here. + # This is our last chance to raise an exception in a way that the + # unittest machinery understands. + self.__rethrow() def get_new_ioloop(self): - """Creates a new IOLoop for this test. May be overridden in - subclasses for tests that require a specific IOLoop (usually - the singleton). + """Creates a new `.IOLoop` for this test. May be overridden in + subclasses for tests that require a specific `.IOLoop` (usually + the singleton `.IOLoop.instance()`). """ return IOLoop() def _handle_exception(self, typ, value, tb): - self.__failure = sys.exc_info() + self.__failure = (typ, value, tb) self.stop() return True @@ -187,16 +193,18 @@ class AsyncTestCase(unittest.TestCase): def run(self, result=None): with ExceptionStackContext(self._handle_exception): super(AsyncTestCase, self).run(result) - # In case an exception escaped super.run or the StackContext caught - # an exception when there wasn't a wait() to re-raise it, do so here. + # As a last resort, if an exception escaped super.run() and wasn't + # re-raised in tearDown, raise it here. This will cause the + # unittest run to fail messily, but that's better than silently + # ignoring an error. self.__rethrow() def stop(self, _arg=None, **kwargs): - """Stops the ioloop, causing one pending (or future) call to wait() + """Stops the `.IOLoop`, causing one pending (or future) call to `wait()` to return. - Keyword arguments or a single positional argument passed to stop() are - saved and will be returned by wait(). + Keyword arguments or a single positional argument passed to `stop()` are + saved and will be returned by `wait()`. """ assert _arg is None or not kwargs self.__stop_args = kwargs or _arg @@ -205,14 +213,19 @@ class AsyncTestCase(unittest.TestCase): self.__running = False self.__stopped = True - def wait(self, condition=None, timeout=5): - """Runs the IOLoop until stop is called or timeout has passed. + def wait(self, condition=None, timeout=None): + """Runs the `.IOLoop` until stop is called or timeout has passed. - In the event of a timeout, an exception will be thrown. + In the event of a timeout, an exception will be thrown. The default + timeout is 5 seconds; it may be overridden with a ``timeout`` keyword + argument or globally with the ASYNC_TEST_TIMEOUT environment variable. - If condition is not None, the IOLoop will be restarted after stop() - until condition() returns true. + If ``condition`` is not None, the `.IOLoop` will be restarted + after `stop()` until ``condition()`` returns true. """ + if timeout is None: + timeout = get_async_test_timeout() + if not self.__stopped: if timeout: def timeout_func(): @@ -244,9 +257,9 @@ class AsyncTestCase(unittest.TestCase): class AsyncHTTPTestCase(AsyncTestCase): """A test case that starts up an HTTP server. - Subclasses must override get_app(), which returns the - tornado.web.Application (or other HTTPServer callback) to be tested. - Tests will typically use the provided self.http_client to fetch + Subclasses must override `get_app()`, which returns the + `tornado.web.Application` (or other `.HTTPServer` callback) to be tested. + Tests will typically use the provided ``self.http_client`` to fetch URLs from this server. Example:: @@ -283,17 +296,17 @@ class AsyncHTTPTestCase(AsyncTestCase): def get_app(self): """Should be overridden by subclasses to return a - tornado.web.Application or other HTTPServer callback. + `tornado.web.Application` or other `.HTTPServer` callback. """ raise NotImplementedError() def fetch(self, path, **kwargs): """Convenience method to synchronously fetch a url. - The given path will be appended to the local server's host and port. - Any additional kwargs will be passed directly to - AsyncHTTPClient.fetch (and so could be used to pass method="POST", - body="...", etc). + The given path will be appended to the local server's host and + port. Any additional kwargs will be passed directly to + `.AsyncHTTPClient.fetch` (and so could be used to pass + ``method="POST"``, ``body="..."``, etc). """ self.http_client.fetch(self.get_url(path), self.stop, **kwargs) return self.wait() @@ -357,34 +370,58 @@ class AsyncHTTPSTestCase(AsyncHTTPTestCase): return 'https' -def gen_test(f): - """Testing equivalent of ``@gen.engine``, to be applied to test methods. +def gen_test(func=None, timeout=None): + """Testing equivalent of ``@gen.coroutine``, to be applied to test methods. - ``@gen.engine`` cannot be used on tests because the `IOLoop` is not + ``@gen.coroutine`` cannot be used on tests because the `.IOLoop` is not already running. ``@gen_test`` should be applied to test methods on subclasses of `AsyncTestCase`. - Note that unlike most uses of ``@gen.engine``, ``@gen_test`` can - detect automatically when the function finishes cleanly so there - is no need to run a callback to signal completion. - Example:: + class MyTest(AsyncHTTPTestCase): @gen_test def test_something(self): response = yield gen.Task(self.fetch('/')) + By default, ``@gen_test`` times out after 5 seconds. The timeout may be + overridden globally with the ASYNC_TEST_TIMEOUT environment variable, + or for each test with the ``timeout`` keyword argument:: + + class MyTest(AsyncHTTPTestCase): + @gen_test(timeout=10) + def test_something_slow(self): + response = yield gen.Task(self.fetch('/')) + + If both the environment variable and the parameter are set, ``gen_test`` + uses the maximum of the two. """ - @functools.wraps(f) - def wrapper(self, *args, **kwargs): - result = f(self, *args, **kwargs) - if result is None: - return - assert isinstance(result, types.GeneratorType) - runner = gen.Runner(result, self.stop) - runner.run() - self.wait() - return wrapper + if timeout is None: + timeout = get_async_test_timeout() + + def wrap(f): + f = gen.coroutine(f) + + @functools.wraps(f) + def wrapper(self): + return self.io_loop.run_sync( + functools.partial(f, self), timeout=timeout) + return wrapper + + if func is not None: + # Used like: + # @gen_test + # def f(self): + # pass + return wrap(func) + else: + # Used like @gen_test(timeout=10) + return wrap + + +# Without this attribute, nosetests will try to run gen_test as a test +# anywhere it is imported. +gen_test.__test__ = False class LogTrapTestCase(unittest.TestCase): @@ -395,13 +432,13 @@ class LogTrapTestCase(unittest.TestCase): the test succeeds, so this class can be useful to minimize the noise. Simply use it as a base class for your test case. It is safe to combine with AsyncTestCase via multiple inheritance - ("class MyTestCase(AsyncHTTPTestCase, LogTrapTestCase):") + (``class MyTestCase(AsyncHTTPTestCase, LogTrapTestCase):``) - This class assumes that only one log handler is configured and that - it is a StreamHandler. This is true for both logging.basicConfig - and the "pretty logging" configured by tornado.options. It is not - compatible with other log buffering mechanisms, such as those provided - by some test runners. + This class assumes that only one log handler is configured and + that it is a `~logging.StreamHandler`. This is true for both + `logging.basicConfig` and the "pretty logging" configured by + `tornado.options`. It is not compatible with other log buffering + mechanisms, such as those provided by some test runners. """ def run(self, result=None): logger = logging.getLogger() @@ -409,7 +446,7 @@ class LogTrapTestCase(unittest.TestCase): logging.basicConfig() handler = logger.handlers[0] if (len(logger.handlers) > 1 or - not isinstance(handler, logging.StreamHandler)): + not isinstance(handler, logging.StreamHandler)): # Logging has been configured in a way we don't recognize, # so just leave it alone. super(LogTrapTestCase, self).run(result) @@ -486,10 +523,11 @@ def main(**kwargs): be specified. Projects with many tests may wish to define a test script like - tornado/test/runtests.py. This script should define a method all() - which returns a test suite and then call tornado.testing.main(). - Note that even when a test script is used, the all() test suite may - be overridden by naming a single test on the command line:: + ``tornado/test/runtests.py``. This script should define a method + ``all()`` which returns a test suite and then call + `tornado.testing.main()`. Note that even when a test script is + used, the ``all()`` test suite may be overridden by naming a + single test on the command line:: # Runs all tests python -m tornado.test.runtests diff --git a/libs/tornado/util.py b/libs/tornado/util.py index 69de2c8e..a2fba779 100755 --- a/libs/tornado/util.py +++ b/libs/tornado/util.py @@ -1,4 +1,14 @@ -"""Miscellaneous utility functions.""" +"""Miscellaneous utility functions and classes. + +This module is used internally by Tornado. It is not necessarily expected +that the functions and classes defined here will be useful to other +applications, but they are documented here in case they are. + +The one public-facing part of this module is the `Configurable` class +and its `~Configurable.configure` method, which becomes a part of the +interface of its subclasses, including `.AsyncHTTPClient`, `.IOLoop`, +and `.Resolver`. +""" from __future__ import absolute_import, division, print_function, with_statement @@ -8,7 +18,8 @@ import zlib class ObjectDict(dict): - """Makes a dictionary behave like an object.""" + """Makes a dictionary behave like an object, with attribute-style access. + """ def __getattr__(self, name): try: return self[name] @@ -52,6 +63,7 @@ class GzipDecompressor(object): def import_object(name): """Imports an object by name. + import_object('x') is equivalent to 'import x'. import_object('x.y.z') is equivalent to 'from x.y import z'. >>> import tornado.escape @@ -59,10 +71,23 @@ def import_object(name): True >>> import_object('tornado.escape.utf8') is tornado.escape.utf8 True + >>> import_object('tornado') is tornado + True + >>> import_object('tornado.missing_module') + Traceback (most recent call last): + ... + ImportError: No module named missing_module """ + if name.count('.') == 0: + return __import__(name, None, None) + parts = name.split('.') obj = __import__('.'.join(parts[:-1]), None, None, [parts[-1]], 0) - return getattr(obj, parts[-1]) + try: + return getattr(obj, parts[-1]) + except AttributeError: + raise ImportError("No module named %s" % parts[-1]) + # Fake unicode literal support: Python 3.2 doesn't have the u'' marker for # literal strings, and alternative solutions like "from __future__ import @@ -115,16 +140,17 @@ class Configurable(object): The implementation subclass as well as optional keyword arguments to its initializer can be set globally at runtime with `configure`. - By using the constructor as the factory method, the interface looks like - a normal class, ``isinstance()`` works as usual, etc. This pattern - is most useful when the choice of implementation is likely to be a - global decision (e.g. when epoll is available, always use it instead of - select), or when a previously-monolithic class has been split into - specialized subclasses. + By using the constructor as the factory method, the interface + looks like a normal class, `isinstance` works as usual, etc. This + pattern is most useful when the choice of implementation is likely + to be a global decision (e.g. when `~select.epoll` is available, + always use it instead of `~select.select`), or when a + previously-monolithic class has been split into specialized + subclasses. Configurable subclasses must define the class methods `configurable_base` and `configurable_default`, and use the instance - method `initialize` instead of `__init__`. + method `initialize` instead of ``__init__``. """ __impl_class = None __impl_kwargs = None @@ -163,7 +189,7 @@ class Configurable(object): def initialize(self): """Initialize a `Configurable` subclass instance. - Configurable classes should use `initialize` instead of `__init__`. + Configurable classes should use `initialize` instead of ``__init__``. """ @classmethod @@ -210,8 +236,6 @@ class ArgReplacer(object): and similar wrappers. """ def __init__(self, func, name): - """Create an ArgReplacer for the named argument to the given function. - """ self.name = name try: self.arg_pos = inspect.getargspec(func).args.index(self.name) diff --git a/libs/tornado/web.py b/libs/tornado/web.py index 3cccba56..6abf42c0 100755 --- a/libs/tornado/web.py +++ b/libs/tornado/web.py @@ -14,13 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. -""" -The Tornado web framework looks a bit like web.py (http://webpy.org/) or -Google's webapp (http://code.google.com/appengine/docs/python/tools/webapp/), -but with additional tools and optimizations to take advantage of the -Tornado non-blocking web server and tools. +"""``tornado.web`` provides a simple web framework with asynchronous +features that allow it to scale to large numbers of open connections, +making it ideal for `long polling +`_. -Here is the canonical "Hello, world" example app:: +Here is a simple "Hello, world" example app:: import tornado.ioloop import tornado.web @@ -36,17 +35,19 @@ Here is the canonical "Hello, world" example app:: application.listen(8888) tornado.ioloop.IOLoop.instance().start() -See the Tornado walkthrough on http://tornadoweb.org for more details -and a good getting started guide. +See the :doc:`Tornado overview ` for more details and a good getting +started guide. Thread-safety notes ------------------- -In general, methods on RequestHandler and elsewhere in tornado are not -thread-safe. In particular, methods such as write(), finish(), and -flush() must only be called from the main thread. If you use multiple -threads it is important to use IOLoop.add_callback to transfer control -back to the main thread before finishing the request. +In general, methods on `RequestHandler` and elsewhere in Tornado are +not thread-safe. In particular, methods such as +`~RequestHandler.write()`, `~RequestHandler.finish()`, and +`~RequestHandler.flush()` must only be called from the main thread. If +you use multiple threads it is important to use `.IOLoop.add_callback` +to transfer control back to the main thread before finishing the +request. """ from __future__ import absolute_import, division, print_function, with_statement @@ -72,6 +73,7 @@ import traceback import types import uuid +from tornado.concurrent import Future from tornado import escape from tornado import httputil from tornado import locale @@ -103,11 +105,11 @@ except ImportError: class RequestHandler(object): - """Subclass this class and define get() or post() to make a handler. + """Subclass this class and define `get()` or `post()` to make a handler. If you want to support more methods than the standard GET/HEAD/POST, you - should override the class variable SUPPORTED_METHODS in your - RequestHandler class. + should override the class variable ``SUPPORTED_METHODS`` in your + `RequestHandler` subclass. """ SUPPORTED_METHODS = ("GET", "HEAD", "POST", "DELETE", "PATCH", "PUT", "OPTIONS") @@ -167,7 +169,7 @@ class RequestHandler(object): @property def settings(self): - """An alias for `self.application.settings`.""" + """An alias for `self.application.settings `.""" return self.application.settings def head(self, *args, **kwargs): @@ -192,7 +194,7 @@ class RequestHandler(object): raise HTTPError(405) def prepare(self): - """Called at the beginning of a request before `get`/`post`/etc. + """Called at the beginning of a request before `get`/`post`/etc. Override this method to perform common initialization regardless of the request method. @@ -228,10 +230,10 @@ class RequestHandler(object): def clear(self): """Resets all headers and content for this response.""" self._headers = httputil.HTTPHeaders({ - "Server": "TornadoServer/%s" % tornado.version, - "Content-Type": "text/html; charset=UTF-8", - "Date": httputil.format_timestamp(time.gmtime()), - }) + "Server": "TornadoServer/%s" % tornado.version, + "Content-Type": "text/html; charset=UTF-8", + "Date": httputil.format_timestamp(time.gmtime()), + }) self.set_default_headers() if not self.request.supports_http_1_1(): if self.request.headers.get("Connection") == "Keep-Alive": @@ -253,10 +255,11 @@ class RequestHandler(object): def set_status(self, status_code, reason=None): """Sets the status code for our response. - :arg int status_code: Response status code. If `reason` is ``None``, - it must be present in `httplib.responses`. + :arg int status_code: Response status code. If ``reason`` is ``None``, + it must be present in `httplib.responses `. :arg string reason: Human-readable reason phrase describing the status - code. If ``None``, it will be filled in from `httplib.responses`. + code. If ``None``, it will be filled in from + `httplib.responses `. """ self._status_code = status_code if reason is not None: @@ -363,8 +366,8 @@ class RequestHandler(object): By default, this method decodes the argument as utf-8 and returns a unicode string, but this may be overridden in subclasses. - This method is used as a filter for both get_argument() and for - values extracted from the url and passed to get()/post()/etc. + This method is used as a filter for both `get_argument()` and for + values extracted from the url and passed to `get()`/`post()`/etc. The name of the argument is provided if known, but may be None (e.g. for unnamed groups in the url regex). @@ -373,6 +376,7 @@ class RequestHandler(object): @property def cookies(self): + """An alias for `self.request.cookies <.httpserver.HTTPRequest.cookies>`.""" return self.request.cookies def get_cookie(self, name, default=None): @@ -496,8 +500,8 @@ class RequestHandler(object): To write the output to the network, use the flush() method below. If the given chunk is a dictionary, we write it as JSON and set - the Content-Type of the response to be application/json. - (if you want to send JSON as a different Content-Type, call + the Content-Type of the response to be ``application/json``. + (if you want to send JSON as a different ``Content-Type``, call set_header *after* calling write()). Note that lists are not converted to JSON because of a potential @@ -604,8 +608,8 @@ class RequestHandler(object): def render_string(self, template_name, **kwargs): """Generate the given template with the given arguments. - We return the generated string. To generate and write a template - as a response, use render() above. + We return the generated byte string (in utf8). To generate and + write a template as a response, use render() above. """ # If no template_path is specified, use the path of the calling file template_path = self.get_template_path() @@ -743,6 +747,9 @@ class RequestHandler(object): self._log() self._finished = True self.on_finish() + # Break up a reference cycle between this handler and the + # _ui_module closures to allow for faster GC on CPython. + self.ui = None def send_error(self, status_code=500, **kwargs): """Sends the given HTTP error code to the browser. @@ -823,9 +830,9 @@ class RequestHandler(object): def locale(self): """The local for the current session. - Determined by either get_user_locale, which you can override to + Determined by either `get_user_locale`, which you can override to set the locale based on, e.g., a user preference stored in a - database, or get_browser_locale, which uses the Accept-Language + database, or `get_browser_locale`, which uses the ``Accept-Language`` header. """ if not hasattr(self, "_locale"): @@ -838,15 +845,15 @@ class RequestHandler(object): def get_user_locale(self): """Override to determine the locale from the authenticated user. - If None is returned, we fall back to get_browser_locale(). + If None is returned, we fall back to `get_browser_locale()`. - This method should return a tornado.locale.Locale object, - most likely obtained via a call like tornado.locale.get("en") + This method should return a `tornado.locale.Locale` object, + most likely obtained via a call like ``tornado.locale.get("en")`` """ return None def get_browser_locale(self, default="en_US"): - """Determines the user's locale from Accept-Language header. + """Determines the user's locale from ``Accept-Language`` header. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 """ @@ -873,9 +880,9 @@ class RequestHandler(object): def current_user(self): """The authenticated user for this request. - Determined by either get_current_user, which you can override to - set the user based on, e.g., a cookie. If that method is not - overridden, this method always returns None. + This is a cached version of `get_current_user`, which you can + override to set the user based on, e.g., a cookie. If that + method is not overridden, this method always returns None. We lazy-load the current user the first time this method is called and cache the result after that. @@ -891,7 +898,7 @@ class RequestHandler(object): def get_login_url(self): """Override to customize the login URL based on the request. - By default, we use the 'login_url' application setting. + By default, we use the ``login_url`` application setting. """ self.require_setting("login_url", "@tornado.web.authenticated") return self.application.settings["login_url"] @@ -899,7 +906,7 @@ class RequestHandler(object): def get_template_path(self): """Override to customize template path for each handler. - By default, we use the 'template_path' application setting. + By default, we use the ``template_path`` application setting. Return None to load templates relative to the calling file. """ return self.application.settings.get("template_path") @@ -925,21 +932,21 @@ class RequestHandler(object): return self._xsrf_token def check_xsrf_cookie(self): - """Verifies that the '_xsrf' cookie matches the '_xsrf' argument. + """Verifies that the ``_xsrf`` cookie matches the ``_xsrf`` argument. - To prevent cross-site request forgery, we set an '_xsrf' + To prevent cross-site request forgery, we set an ``_xsrf`` cookie and include the same value as a non-cookie - field with all POST requests. If the two do not match, we + field with all ``POST`` requests. If the two do not match, we reject the form submission as a potential forgery. - The _xsrf value may be set as either a form field named _xsrf - or in a custom HTTP header named X-XSRFToken or X-CSRFToken + The ``_xsrf`` value may be set as either a form field named ``_xsrf`` + or in a custom HTTP header named ``X-XSRFToken`` or ``X-CSRFToken`` (the latter is accepted for compatibility with Django). See http://en.wikipedia.org/wiki/Cross-site_request_forgery Prior to release 1.1.1, this check was ignored if the HTTP header - "X-Requested-With: XMLHTTPRequest" was present. This exception + ``X-Requested-With: XMLHTTPRequest`` was present. This exception has been shown to be insecure and has been removed. For more information please see http://www.djangoproject.com/weblog/2011/feb/08/security/ @@ -954,14 +961,17 @@ class RequestHandler(object): raise HTTPError(403, "XSRF cookie does not match POST argument") def xsrf_form_html(self): - """An HTML element to be included with all POST forms. + """An HTML ```` element to be included with all POST forms. - It defines the _xsrf input value, which we check on all POST + It defines the ``_xsrf`` input value, which we check on all POST requests to prevent cross-site request forgery. If you have set - the 'xsrf_cookies' application setting, you must include this + the ``xsrf_cookies`` application setting, you must include this HTML within all of your HTML forms. - See check_xsrf_cookie() above for more information. + In a template, this method should be called with ``{% module + xsrf_form_html() %}`` + + See `check_xsrf_cookie()` above for more information. """ return '' @@ -969,11 +979,11 @@ class RequestHandler(object): def static_url(self, path, include_host=None): """Returns a static URL for the given relative static file path. - This method requires you set the 'static_path' setting in your + This method requires you set the ``static_path`` setting in your application (which specifies the root directory of your static files). - We append ?v= to the returned URL, which makes our + We append ``?v=`` to the returned URL, which makes our static file handler set an infinite expiration header on the returned content. The signature is based on the content of the file. @@ -1142,10 +1152,18 @@ class RequestHandler(object): def asynchronous(method): """Wrap request handler methods with this if they are asynchronous. + This decorator should only be applied to the :ref:`HTTP verb + methods `; its behavior is undefined for any other method. + This decorator does not *make* a method asynchronous; it tells + the framework that the method *is* asynchronous. For this decorator + to be useful the method must (at least sometimes) do something + asynchronous. + If this decorator is given, the response is not finished when the - method returns. It is up to the request handler to call self.finish() - to finish the HTTP request. Without this decorator, the request is - automatically finished when the get() or post() method returns. :: + method returns. It is up to the request handler to call + `self.finish() ` to finish the HTTP + request. Without this decorator, the request is automatically + finished when the ``get()`` or ``post()`` method returns. Example:: class MyRequestHandler(web.RequestHandler): @web.asynchronous @@ -1158,6 +1176,8 @@ def asynchronous(method): self.finish() """ + # Delay the IOLoop import because it's not available on app engine. + from tornado.ioloop import IOLoop @functools.wraps(method) def wrapper(self, *args, **kwargs): if self.application._wsgi: @@ -1165,14 +1185,27 @@ def asynchronous(method): self._auto_finish = False with stack_context.ExceptionStackContext( self._stack_context_handle_exception): - return method(self, *args, **kwargs) + result = method(self, *args, **kwargs) + if isinstance(result, Future): + # If @asynchronous is used with @gen.coroutine, (but + # not @gen.engine), we can automatically finish the + # request when the future resolves. Additionally, + # the Future will swallow any exceptions so we need + # to throw them back out to the stack context to finish + # the request. + def future_complete(f): + f.result() + if not self._finished: + self.finish() + IOLoop.current().add_future(result, future_complete) + return result return wrapper def removeslash(method): """Use this decorator to remove trailing slashes from the request path. - For example, a request to ``'/foo/'`` would redirect to ``'/foo'`` with this + For example, a request to ``/foo/`` would redirect to ``/foo`` with this decorator. Your request handler mapping should use a regular expression like ``r'/foo/*'`` in conjunction with using the decorator. """ @@ -1195,9 +1228,9 @@ def removeslash(method): def addslash(method): """Use this decorator to add a missing trailing slash to the request path. - For example, a request to '/foo' would redirect to '/foo/' with this + For example, a request to ``/foo`` would redirect to ``/foo/`` with this decorator. Your request handler mapping should use a regular expression - like r'/foo/?' in conjunction with using the decorator. + like ``r'/foo/?'`` in conjunction with using the decorator. """ @functools.wraps(method) def wrapper(self, *args, **kwargs): @@ -1226,35 +1259,36 @@ class Application(object): http_server.listen(8080) ioloop.IOLoop.instance().start() - The constructor for this class takes in a list of URLSpec objects + The constructor for this class takes in a list of `URLSpec` objects or (regexp, request_class) tuples. When we receive requests, we iterate over the list in order and instantiate an instance of the first request class whose regexp matches the request path. - Each tuple can contain an optional third element, which should be a - dictionary if it is present. That dictionary is passed as keyword - arguments to the contructor of the handler. This pattern is used - for the StaticFileHandler below (note that a StaticFileHandler - can be installed automatically with the static_path setting described - below):: + Each tuple can contain an optional third element, which should be + a dictionary if it is present. That dictionary is passed as + keyword arguments to the contructor of the handler. This pattern + is used for the `StaticFileHandler` in this example (note that a + `StaticFileHandler` can be installed automatically with the + static_path setting described below):: application = web.Application([ (r"/static/(.*)", web.StaticFileHandler, {"path": "/var/www"}), ]) - We support virtual hosts with the add_handlers method, which takes in + We support virtual hosts with the `add_handlers` method, which takes in a host regular expression as the first argument:: application.add_handlers(r"www\.myhost\.com", [ (r"/article/([0-9]+)", ArticleHandler), ]) - You can serve static files by sending the static_path setting as a - keyword argument. We will serve those files from the /static/ URI - (this is configurable with the static_url_prefix setting), - and we will serve /favicon.ico and /robots.txt from the same directory. - A custom subclass of StaticFileHandler can be specified with the - static_handler_class setting. + You can serve static files by sending the ``static_path`` setting + as a keyword argument. We will serve those files from the + ``/static/`` URI (this is configurable with the + ``static_url_prefix`` setting), and we will serve ``/favicon.ico`` + and ``/robots.txt`` from the same directory. A custom subclass of + `StaticFileHandler` can be specified with the + ``static_handler_class`` setting. """ def __init__(self, handlers=None, default_host="", transforms=None, wsgi=False, **settings): @@ -1301,15 +1335,16 @@ class Application(object): def listen(self, port, address="", **kwargs): """Starts an HTTP server for this application on the given port. - This is a convenience alias for creating an HTTPServer object - and calling its listen method. Keyword arguments not - supported by HTTPServer.listen are passed to the HTTPServer - constructor. For advanced uses (e.g. preforking), do not use - this method; create an HTTPServer and call its bind/start - methods directly. + This is a convenience alias for creating an `.HTTPServer` + object and calling its listen method. Keyword arguments not + supported by `HTTPServer.listen <.TCPServer.listen>` are passed to the + `.HTTPServer` constructor. For advanced uses + (e.g. multi-process mode), do not use this method; create an + `.HTTPServer` and call its + `.TCPServer.bind`/`.TCPServer.start` methods directly. Note that after calling this method you still need to call - IOLoop.instance().start() to start the server. + ``IOLoop.instance().start()`` to start the server. """ # import is here rather than top level because HTTPServer # is not importable on appengine @@ -1337,7 +1372,7 @@ class Application(object): self.handlers.append((re.compile(host_pattern), handlers)) for spec in host_handlers: - if isinstance(spec, type(())): + if isinstance(spec, (tuple, list)): assert len(spec) in (2, 3) pattern = spec[0] handler = spec[1] @@ -1361,7 +1396,6 @@ class Application(object): self.named_handlers[spec.name] = spec def add_transform(self, transform_class): - """Adds the given OutputTransform to our transform list.""" self.transforms.append(transform_class) def _get_host_handlers(self, request): @@ -1456,11 +1490,11 @@ class Application(object): return handler def reverse_url(self, name, *args): - """Returns a URL path for handler named `name` + """Returns a URL path for handler named ``name`` - The handler must be added to the application as a named URLSpec. + The handler must be added to the application as a named `URLSpec`. - Args will be substituted for capturing groups in the URLSpec regex. + Args will be substituted for capturing groups in the `URLSpec` regex. They will be converted to strings if necessary, encoded as utf8, and url-escaped. """ @@ -1474,7 +1508,7 @@ class Application(object): By default writes to the python root logger. To change this behavior either subclass Application and override this method, or pass a function in the application settings dictionary as - 'log_function'. + ``log_function``. """ if "log_function" in self.settings: self.settings["log_function"](handler) @@ -1493,8 +1527,13 @@ class Application(object): class HTTPError(Exception): """An exception that will turn into an HTTP error response. + Raising an `HTTPError` is a convenient alternative to calling + `RequestHandler.send_error` since it automatically ends the + current function. + :arg int status_code: HTTP status code. Must be listed in - `httplib.responses` unless the ``reason`` keyword argument is given. + `httplib.responses ` unless the ``reason`` + keyword argument is given. :arg string log_message: Message to be written to the log for this error (will not be shown to the user unless the `Application` is in debug mode). May contain ``%s``-style placeholders, which will be filled @@ -1521,7 +1560,7 @@ class HTTPError(Exception): class ErrorHandler(RequestHandler): - """Generates an error response with status_code for all requests.""" + """Generates an error response with ``status_code`` for all requests.""" def initialize(self, status_code): self.set_status(status_code) @@ -1538,7 +1577,7 @@ class ErrorHandler(RequestHandler): class RedirectHandler(RequestHandler): """Redirects the client to the given URL for all GET requests. - You should provide the keyword argument "url" to the handler, e.g.:: + You should provide the keyword argument ``url`` to the handler, e.g.:: application = web.Application([ (r"/oldpath", web.RedirectHandler, {"url": "/newpath"}), @@ -1555,20 +1594,20 @@ class RedirectHandler(RequestHandler): class StaticFileHandler(RequestHandler): """A simple handler that can serve static content from a directory. - To map a path to this handler for a static data directory /var/www, + To map a path to this handler for a static data directory ``/var/www``, you would add a line to your application like:: application = web.Application([ (r"/static/(.*)", web.StaticFileHandler, {"path": "/var/www"}), ]) - The local root directory of the content should be passed as the "path" + The local root directory of the content should be passed as the ``path`` argument to the handler. - To support aggressive browser caching, if the argument "v" is given + To support aggressive browser caching, if the argument ``v`` is given with the path, we set an infinite HTTP expiration header. So, if you want browsers to cache a file indefinitely, send them to, e.g., - /static/images/myimage.png?v=xxx. Override ``get_cache_time`` method for + ``/static/images/myimage.png?v=xxx``. Override `get_cache_time` method for more fine-grained cache control. """ CACHE_MAX_AGE = 86400 * 365 * 10 # 10 years @@ -1609,7 +1648,7 @@ class StaticFileHandler(RequestHandler): raise HTTPError(403, "%s is not a file", path) stat_result = os.stat(abspath) - modified = datetime.datetime.fromtimestamp(stat_result[stat.ST_MTIME]) + modified = datetime.datetime.utcfromtimestamp(stat_result[stat.ST_MTIME]) self.set_header("Last-Modified", modified) @@ -1631,7 +1670,7 @@ class StaticFileHandler(RequestHandler): ims_value = self.request.headers.get("If-Modified-Since") if ims_value is not None: date_tuple = email.utils.parsedate(ims_value) - if_since = datetime.datetime.fromtimestamp(time.mktime(date_tuple)) + if_since = datetime.datetime(*date_tuple[:6]) if if_since >= modified: self.set_status(304) return @@ -1651,11 +1690,13 @@ class StaticFileHandler(RequestHandler): def get_cache_time(self, path, modified, mime_type): """Override to customize cache control behavior. - Return a positive number of seconds to trigger aggressive caching or 0 - to mark resource as cacheable, only. + Return a positive number of seconds to make the result + cacheable for that amount of time or 0 to mark resource as + cacheable for an unspecified amount of time (subject to + browser heuristics). By default returns cache expiry of 10 years for resources requested - with "v" argument. + with ``v`` argument. """ return self.CACHE_MAX_AGE if "v" in self.request.arguments else 0 @@ -1718,12 +1759,13 @@ class StaticFileHandler(RequestHandler): class FallbackHandler(RequestHandler): - """A RequestHandler that wraps another HTTP server callback. + """A `RequestHandler` that wraps another HTTP server callback. - The fallback is a callable object that accepts an HTTPRequest, - such as an Application or tornado.wsgi.WSGIContainer. This is most - useful to use both tornado RequestHandlers and WSGI in the same server. - Typical usage:: + The fallback is a callable object that accepts an + `~.httpserver.HTTPRequest`, such as an `Application` or + `tornado.wsgi.WSGIContainer`. This is most useful to use both + Tornado ``RequestHandlers`` and WSGI in the same server. Typical + usage:: wsgi_app = tornado.wsgi.WSGIContainer( django.core.handlers.wsgi.WSGIHandler()) @@ -1837,7 +1879,11 @@ class ChunkedTransferEncoding(OutputTransform): def authenticated(method): - """Decorate methods with this to require that the user be logged in.""" + """Decorate methods with this to require that the user be logged in. + + If the user is not logged in, they will be redirected to the configured + `login url `. + """ @functools.wraps(method) def wrapper(self, *args, **kwargs): if not self.current_user: @@ -1858,7 +1904,7 @@ def authenticated(method): class UIModule(object): - """A UI re-usable, modular unit on a page. + """A re-usable, modular UI unit on a page. UI modules often execute additional queries, and they can include additional CSS and JavaScript that will be included in the output @@ -1985,21 +2031,19 @@ class TemplateModule(UIModule): class URLSpec(object): """Specifies mappings between URLs and handlers.""" def __init__(self, pattern, handler_class, kwargs=None, name=None): - """Creates a URLSpec. + """Parameters: - Parameters: + * ``pattern``: Regular expression to be matched. Any groups + in the regex will be passed in to the handler's get/post/etc + methods as arguments. - pattern: Regular expression to be matched. Any groups in the regex - will be passed in to the handler's get/post/etc methods as - arguments. + * ``handler_class``: `RequestHandler` subclass to be invoked. - handler_class: RequestHandler subclass to be invoked. + * ``kwargs`` (optional): A dictionary of additional arguments + to be passed to the handler's constructor. - kwargs (optional): A dictionary of additional arguments to be passed - to the handler's constructor. - - name (optional): A name for this handler. Used by - Application.reverse_url. + * ``name`` (optional): A name for this handler. Used by + `Application.reverse_url`. """ if not pattern.endswith('$'): pattern += '$' diff --git a/libs/tornado/websocket.py b/libs/tornado/websocket.py index 235a1102..7bc65138 100755 --- a/libs/tornado/websocket.py +++ b/libs/tornado/websocket.py @@ -1,4 +1,4 @@ -"""Server-side implementation of the WebSocket protocol. +"""Implementation of the WebSocket protocol. `WebSockets `_ allow for bidirectional communication between the browser and server. @@ -25,46 +25,44 @@ import base64 import collections import functools import hashlib -import logging import os -import re -import socket import struct import time import tornado.escape import tornado.web -from tornado.concurrent import Future, return_future -from tornado.escape import utf8, to_unicode, native_str -from tornado.httputil import HTTPHeaders +from tornado.concurrent import Future +from tornado.escape import utf8, native_str +from tornado import httpclient from tornado.ioloop import IOLoop -from tornado.iostream import IOStream, SSLIOStream from tornado.log import gen_log, app_log from tornado.netutil import Resolver from tornado import simple_httpclient -from tornado.util import bytes_type +from tornado.util import bytes_type, unicode_type try: xrange # py2 except NameError: xrange = range # py3 -try: - import urlparse # py2 -except ImportError: - import urllib.parse as urlparse # py3 + +class WebSocketError(Exception): + pass + class WebSocketHandler(tornado.web.RequestHandler): """Subclass this class to create a basic WebSocket handler. - Override on_message to handle incoming messages. You can also override - open and on_close to handle opened and closed connections. + Override `on_message` to handle incoming messages, and use + `write_message` to send messages to the client. You can also + override `open` and `on_close` to handle opened and closed + connections. See http://dev.w3.org/html5/websockets/ for details on the JavaScript interface. The protocol is specified at http://tools.ietf.org/html/rfc6455. - Here is an example Web Socket handler that echos back all received messages + Here is an example WebSocket handler that echos back all received messages back to the client:: class EchoWebSocket(websocket.WebSocketHandler): @@ -77,14 +75,15 @@ class WebSocketHandler(tornado.web.RequestHandler): def on_close(self): print "WebSocket closed" - Web Sockets are not standard HTTP connections. The "handshake" is HTTP, - but after the handshake, the protocol is message-based. Consequently, - most of the Tornado HTTP facilities are not available in handlers of this - type. The only communication methods available to you are write_message() - and close(). Likewise, your request handler class should - implement open() method rather than get() or post(). + WebSockets are not standard HTTP connections. The "handshake" is + HTTP, but after the handshake, the protocol is + message-based. Consequently, most of the Tornado HTTP facilities + are not available in handlers of this type. The only communication + methods available to you are `write_message()`, `ping()`, and + `close()`. Likewise, your request handler class should implement + `open()` method rather than ``get()`` or ``post()``. - If you map the handler above to "/websocket" in your application, you can + If you map the handler above to ``/websocket`` in your application, you can invoke it in JavaScript with:: var ws = new WebSocket("ws://localhost:8888/websocket"); @@ -211,6 +210,7 @@ class WebSocketHandler(tornado.web.RequestHandler): Once the close handshake is successful the socket will be closed. """ self.ws_connection.close() + self.ws_connection = None def allow_draft76(self): """Override to enable support for the older "draft76" protocol. @@ -240,11 +240,10 @@ class WebSocketHandler(tornado.web.RequestHandler): return "wss" if self.request.protocol == "https" else "ws" def async_callback(self, callback, *args, **kwargs): - """Wrap callbacks with this if they are used on asynchronous requests. + """Obsolete - catches exceptions from the wrapped function. - Catches exceptions properly and closes this WebSocket if an exception - is uncaught. (Note that this is usually unnecessary thanks to - `tornado.stack_context`) + This function is normally unncecessary thanks to + `tornado.stack_context`. """ return self.ws_connection.async_callback(callback, *args, **kwargs) @@ -398,8 +397,9 @@ class WebSocketProtocol76(WebSocketProtocol): """Processes the key headers and calculates their key value. Raises ValueError when feed invalid key.""" + # pyflakes complains about variable reuse if both of these lines use 'c' number = int(''.join(c for c in key if c.isdigit())) - spaces = len([c for c in key if c.isspace()]) + spaces = len([c2 for c2 in key if c2.isspace()]) try: key_number = number // spaces except (ValueError, ZeroDivisionError): @@ -444,7 +444,7 @@ class WebSocketProtocol76(WebSocketProtocol): if binary: raise ValueError( "Binary messages not supported by this version of websockets") - if isinstance(message, unicode): + if isinstance(message, unicode_type): message = message.encode("utf-8") assert isinstance(message, bytes_type) self.stream.write(b"\x00" + message + b"\xff") @@ -520,7 +520,6 @@ class WebSocketProtocol13(WebSocketProtocol): return WebSocketProtocol13.compute_accept_value( self.request.headers.get("Sec-Websocket-Key")) - def _accept_connection(self): subprotocol_header = '' subprotocols = self.request.headers.get("Sec-WebSocket-Protocol", '') @@ -727,7 +726,8 @@ class WebSocketProtocol13(WebSocketProtocol): self.stream.io_loop.time() + 5, self._abort) -class _WebSocketClientConnection(simple_httpclient._HTTPConnection): +class WebSocketClientConnection(simple_httpclient._HTTPConnection): + """WebSocket client connection.""" def __init__(self, io_loop, request): self.connect_future = Future() self.read_future = None @@ -738,19 +738,26 @@ class _WebSocketClientConnection(simple_httpclient._HTTPConnection): scheme = {'ws': 'http', 'wss': 'https'}[scheme] request.url = scheme + sep + rest request.headers.update({ - 'Upgrade': 'websocket', - 'Connection': 'Upgrade', - 'Sec-WebSocket-Key': self.key, - 'Sec-WebSocket-Version': '13', - }) + 'Upgrade': 'websocket', + 'Connection': 'Upgrade', + 'Sec-WebSocket-Key': self.key, + 'Sec-WebSocket-Version': '13', + }) - super(_WebSocketClientConnection, self).__init__( - io_loop, None, request, lambda: None, lambda response: None, + super(WebSocketClientConnection, self).__init__( + io_loop, None, request, lambda: None, self._on_http_response, 104857600, Resolver(io_loop=io_loop)) def _on_close(self): self.on_message(None) + def _on_http_response(self, response): + if not self.connect_future.done(): + if response.error: + self.connect_future.set_exception(response.error) + else: + self.connect_future.set_exception(WebSocketError( + "Non-websocket response")) def _handle_1xx(self, code): assert code == 101 @@ -769,9 +776,17 @@ class _WebSocketClientConnection(simple_httpclient._HTTPConnection): self.connect_future.set_result(self) def write_message(self, message, binary=False): + """Sends a message to the WebSocket server.""" self.protocol.write_message(message, binary) def read_message(self, callback=None): + """Reads a message from the WebSocket server. + + Returns a future whose result is the message, or None + if the connection is closed. If a callback argument + is given it will be called with the future when it is + ready. + """ assert self.read_future is None future = Future() if self.read_queue: @@ -793,13 +808,18 @@ class _WebSocketClientConnection(simple_httpclient._HTTPConnection): pass -def WebSocketConnect(url, io_loop=None, callback=None): +def websocket_connect(url, io_loop=None, callback=None, connect_timeout=None): + """Client-side websocket support. + + Takes a url and returns a Future whose result is a + `WebSocketClientConnection`. + """ if io_loop is None: - io_loop = IOLoop.instance() - request = simple_httpclient.HTTPRequest(url) - request = simple_httpclient._RequestProxy( - request, simple_httpclient.HTTPRequest._DEFAULTS) - conn = _WebSocketClientConnection(io_loop, request) + io_loop = IOLoop.current() + request = httpclient.HTTPRequest(url, connect_timeout=connect_timeout) + request = httpclient._RequestProxy( + request, httpclient.HTTPRequest._DEFAULTS) + conn = WebSocketClientConnection(io_loop, request) if callback is not None: io_loop.add_future(conn.connect_future, callback) return conn.connect_future diff --git a/libs/tornado/wsgi.py b/libs/tornado/wsgi.py index 3d06860f..62cff590 100755 --- a/libs/tornado/wsgi.py +++ b/libs/tornado/wsgi.py @@ -82,11 +82,11 @@ else: class WSGIApplication(web.Application): """A WSGI equivalent of `tornado.web.Application`. - WSGIApplication is very similar to web.Application, except no - asynchronous methods are supported (since WSGI does not support - non-blocking requests properly). If you call self.flush() or other - asynchronous methods in your request handlers running in a - WSGIApplication, we throw an exception. + `WSGIApplication` is very similar to `tornado.web.Application`, + except no asynchronous methods are supported (since WSGI does not + support non-blocking requests properly). If you call + ``self.flush()`` or other asynchronous methods in your request + handlers running in a `WSGIApplication`, we throw an exception. Example usage:: @@ -105,13 +105,15 @@ class WSGIApplication(web.Application): server = wsgiref.simple_server.make_server('', 8888, application) server.serve_forever() - See the 'appengine' demo for an example of using this module to run - a Tornado app on Google AppEngine. + See the `appengine demo + `_ + for an example of using this module to run a Tornado app on Google + App Engine. - Since no asynchronous methods are available for WSGI applications, the - httpclient and auth modules are both not available for WSGI applications. - We support the same interface, but handlers running in a WSGIApplication - do not support flush() or asynchronous methods. + WSGI applications use the same `.RequestHandler` class, but not + ``@asynchronous`` methods or ``flush()``. This means that it is + not possible to use `.AsyncHTTPClient`, or the `tornado.auth` or + `tornado.websocket` modules. """ def __init__(self, handlers=None, default_host="", **settings): web.Application.__init__(self, handlers, default_host, transforms=[], @@ -134,7 +136,7 @@ class WSGIApplication(web.Application): class HTTPRequest(object): """Mimics `tornado.httpserver.HTTPRequest` for WSGI applications.""" def __init__(self, environ): - """Parses the given WSGI environ to construct the request.""" + """Parses the given WSGI environment to construct the request.""" self.method = environ["REQUEST_METHOD"] self.path = urllib_parse.quote(from_wsgi_str(environ.get("SCRIPT_NAME", ""))) self.path += urllib_parse.quote(from_wsgi_str(environ.get("PATH_INFO", ""))) @@ -206,7 +208,7 @@ class HTTPRequest(object): class WSGIContainer(object): r"""Makes a WSGI-compatible function runnable on Tornado's HTTP server. - Wrap a WSGI function in a WSGIContainer and pass it to HTTPServer to + Wrap a WSGI function in a `WSGIContainer` and pass it to `.HTTPServer` to run it. For example:: def simple_app(environ, start_response): From 2979a8edecb786330a135b13f58c4cbb8e4109b1 Mon Sep 17 00:00:00 2001 From: mano3m <-> Date: Fri, 19 Apr 2013 21:22:29 +0200 Subject: [PATCH 04/48] Cleanup --- couchpotato/core/plugins/renamer/main.py | 65 ++++++++++++++---------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 807ee04c..a8b39c7f 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -103,7 +103,7 @@ class Renamer(Plugin): # make sure the movie folder name is included in the search folder = None - movie_files = [] + files = [] if movie_folder: log.info('Scanning movie folder %s...', movie_folder) movie_folder = movie_folder.rstrip(os.path.sep) @@ -112,38 +112,17 @@ class Renamer(Plugin): # Get all files from the specified folder try: for root, folders, names in os.walk(movie_folder): - movie_files.extend([os.path.join(root, name) for name in names]) + files.extend([os.path.join(root, name) for name in names]) except: log.error('Failed getting files from %s: %s', (movie_folder, traceback.format_exc())) db = get_session() - # Get the release with the downloader ID that was downloaded by the downloader - download_info = None - if download_id and downloader: - rls = None - - rlsnfo_dwnlds = db.query(ReleaseInfo).filter_by(identifier = 'download_downloader', value = downloader).all() - rlsnfo_ids = db.query(ReleaseInfo).filter_by(identifier = 'download_id', value = download_id).all() - - for rlsnfo_dwnld in rlsnfo_dwnlds: - for rlsnfo_id in rlsnfo_ids: - if rlsnfo_id.release == rlsnfo_dwnld.release: - rls = rlsnfo_id.release - break - if rls: break - - if rls: - download_info = { - 'imdb_id': rls.movie.library.identifier, - 'quality': rls.quality.identifier, - 'is_torrent': any(downloader_type in fireEvent('download.downloader_type', downloader = downloader) for downloader_type in ['torrent', 'torrent_magnet']) - } - else: - log.error('Download ID %s from downloader %s not found in releases', (download_id, downloader)) + # Get the download info stored in the downloaded release + download_info = getDownloadInfo(download_id = download_id, downloader = downloader) groups = fireEvent('scanner.scan', folder = folder if folder else self.conf('from'), - files = movie_files, download_info = download_info, return_ignored = False, single = True) + files = files, download_info = download_info, return_ignored = False, single = True) destination = self.conf('to') folder_name = self.conf('folder_name') @@ -678,7 +657,7 @@ Remove it if you want it to be renamed (again, or at least let it try again) elif item['status'] == 'completed': log.info('Download of %s completed!', item['name']) if item['id'] and item['downloader'] and item['folder']: - fireEventAsync('renamer.scan', movie_folder = item['folder'], downloader = item['downloader'], download_id = item['id']) + fireEvent('renamer.scan', movie_folder = item['folder'], downloader = item['downloader'], download_id = item['id']) else: scan_required = True @@ -697,3 +676,35 @@ Remove it if you want it to be renamed (again, or at least let it try again) self.checking_snatched = False return True + +def getDownloadInfo(self, download_id, downloader): + + rls = None + download_info = None + + if download_id and downloader: + + db = get_session() + + rlsnfo_dwnlds = db.query(ReleaseInfo).filter_by(identifier = 'download_downloader', value = downloader).all() + rlsnfo_ids = db.query(ReleaseInfo).filter_by(identifier = 'download_id', value = download_id).all() + + for rlsnfo_dwnld in rlsnfo_dwnlds: + for rlsnfo_id in rlsnfo_ids: + if rlsnfo_id.release == rlsnfo_dwnld.release: + rls = rlsnfo_id.release + break + if rls: break + + if not rls: + log.error('Download ID %s from downloader %s not found in releases', (download_id, downloader)) + + if rls: + download_info = { + 'imdb_id': rls.movie.library.identifier, + 'quality': rls.quality.identifier, + 'is_torrent': any(downloader_type in fireEvent('download.downloader_type', downloader = downloader) for downloader_type in ['torrent', 'torrent_magnet']) + } + + return download_info + From f2f43a223142785db739cf80fd75d03a31471fd5 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Tue, 16 Apr 2013 11:10:50 +0930 Subject: [PATCH 05/48] Wont delete the "from" (sub)folders, "movie" folder or "destination" folder at this time. These should be deleted after the renaming... at this stage we should only be deleting any "older releases" --- couchpotato/core/plugins/renamer/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 87d9aaf3..8ad7ddc2 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -421,7 +421,7 @@ class Renamer(Plugin): os.remove(src) parent_dir = os.path.normpath(os.path.dirname(src)) - if delete_folders.count(parent_dir) == 0 and os.path.isdir(parent_dir) and destination != parent_dir: + if delete_folders.count(parent_dir) == 0 and os.path.isdir(parent_dir) and not parent_dir in [destination, movie_folder] and not self.conf('from') in parent_dir: delete_folders.append(parent_dir) except: From b85942989dcd69e5ed8a3c4a9b38edd9081c89de Mon Sep 17 00:00:00 2001 From: mano3m <-> Date: Sun, 21 Apr 2013 23:46:21 +0200 Subject: [PATCH 06/48] Standardise failed status apply the failed status in case of a manual re-add and automatic try next release --- couchpotato/core/plugins/renamer/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index a8b39c7f..47080cbc 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -647,13 +647,12 @@ Remove it if you want it to be renamed (again, or at least let it try again) pass elif item['status'] == 'failed': fireEvent('download.remove_failed', item, single = True) + rel.status_id = failed_status.get('id') + rel.last_edit = int(time.time()) + db.commit() if self.conf('next_on_failed'): fireEvent('searcher.try_next_release', movie_id = rel.movie_id) - else: - rel.status_id = failed_status.get('id') - rel.last_edit = int(time.time()) - db.commit() elif item['status'] == 'completed': log.info('Download of %s completed!', item['name']) if item['id'] and item['downloader'] and item['folder']: From 1022753213976a6650505dfa37ddbdeaf5fd990d Mon Sep 17 00:00:00 2001 From: mano3m <-> Date: Wed, 24 Apr 2013 22:19:34 +0200 Subject: [PATCH 07/48] Add username to nzbget downloader For raspberry pi a different username than normal is required. Fixes #1652 --- couchpotato/core/downloaders/nzbget/__init__.py | 4 ++++ couchpotato/core/downloaders/nzbget/main.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/downloaders/nzbget/__init__.py b/couchpotato/core/downloaders/nzbget/__init__.py index 5349914a..bbe52ca4 100644 --- a/couchpotato/core/downloaders/nzbget/__init__.py +++ b/couchpotato/core/downloaders/nzbget/__init__.py @@ -24,6 +24,10 @@ config = [{ 'default': 'localhost:6789', 'description': 'Hostname with port. Usually localhost:6789', }, + { + 'name': 'username', + 'default': 'nzbget', + }, { 'name': 'password', 'type': 'password', diff --git a/couchpotato/core/downloaders/nzbget/main.py b/couchpotato/core/downloaders/nzbget/main.py index 78e2b957..ff307432 100644 --- a/couchpotato/core/downloaders/nzbget/main.py +++ b/couchpotato/core/downloaders/nzbget/main.py @@ -16,7 +16,7 @@ class NZBGet(Downloader): type = ['nzb'] - url = 'http://nzbget:%(password)s@%(host)s/xmlrpc' + url = 'http://%(username):%(password)s@%(host)s/xmlrpc' def download(self, data = {}, movie = {}, filedata = None): @@ -26,7 +26,7 @@ class NZBGet(Downloader): log.info('Sending "%s" to NZBGet.', data.get('name')) - url = self.url % {'host': self.conf('host'), 'password': self.conf('password')} + url = self.url % {'host': self.conf('host'), 'username': self.conf('username'), 'password': self.conf('password')} nzb_name = ss('%s.nzb' % self.createNzbName(data, movie)) rpc = xmlrpclib.ServerProxy(url) @@ -61,7 +61,7 @@ class NZBGet(Downloader): log.debug('Checking NZBGet download status.') - url = self.url % {'host': self.conf('host'), 'password': self.conf('password')} + url = self.url % {'host': self.conf('host'), 'username': self.conf('username'), 'password': self.conf('password')} rpc = xmlrpclib.ServerProxy(url) try: From 92998bafc836ff021f647a5d65063716c47eefbe Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Sat, 20 Apr 2013 11:49:10 +0930 Subject: [PATCH 08/48] write unique id to nzbget params My mistake. Fixed now. Yeah... sorry ;) This does work for check_snatched... Marks as busy, or failed etc. keep consistent release table format fix check_snatched correctly parse the NZBGet Parameters and Pass status.downloader remove downloader and fix id My mistake. Fixed now. Yeah... sorry ;) This does work for check_snatched... Marks as busy, or failed etc. keep consistent release table format fix check_snatched correctly parse the NZBGet Parameters and Pass status.downloader remove downloader and fix id --- couchpotato/core/downloaders/nzbget/main.py | 32 ++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/couchpotato/core/downloaders/nzbget/main.py b/couchpotato/core/downloaders/nzbget/main.py index 78e2b957..5478a3cb 100644 --- a/couchpotato/core/downloaders/nzbget/main.py +++ b/couchpotato/core/downloaders/nzbget/main.py @@ -1,7 +1,7 @@ from base64 import standard_b64encode from couchpotato.core.downloaders.base import Downloader, StatusList from couchpotato.core.helpers.encoding import ss -from couchpotato.core.helpers.variable import tryInt +from couchpotato.core.helpers.variable import tryInt, md5 from couchpotato.core.logger import CPLog from datetime import timedelta import re @@ -52,7 +52,14 @@ class NZBGet(Downloader): if xml_response: log.info('NZB sent successfully to NZBGet') - return True + nzb_id = md5(data['url']) # about as unique as they come ;) + couchpotato_id = "couchpotato=" + nzb_id + groups = rpc.listgroups() + file_id = [item['LastID'] for item in groups if item['NZBFilename'] == nzb_name] + confirmed = rpc.editqueue("GroupSetParameter", 0, couchpotato_id, file_id) + if confirmed: + log.debug('couchpotato parameter set in nzbget download') + return self.downloadReturnId(nzb_id) else: log.error('NZBGet could not add %s to the queue.', nzb_name) return False @@ -93,15 +100,19 @@ class NZBGet(Downloader): for item in groups: log.debug('Found %s in NZBGet download queue', item['NZBFilename']) + try: + NZB_ID = [param['Value'] for param in item['Parameters'] if param['Name'] == 'couchpotato'][0] + except: + NZB_ID = item['NZBID'], statuses.append({ - 'id': item['NZBID'], + 'id': NZB_ID, 'name': item['NZBFilename'], 'original_status': 'DOWNLOADING' if item['ActiveDownloads'] > 0 else 'QUEUED', # Seems to have no native API function for time left. This will return the time left after NZBGet started downloading this item 'timeleft': str(timedelta(seconds = item['RemainingSizeMB'] / status['DownloadRate'] * 2 ^ 20)) if item['ActiveDownloads'] > 0 and not (status['DownloadPaused'] or status['Download2Paused']) else -1, }) - for item in queue: + for item in queue: # 'Parameters' is not passed in rpc.postqueue log.debug('Found %s in NZBGet postprocessing queue', item['NZBFilename']) statuses.append({ 'id': item['NZBID'], @@ -112,8 +123,12 @@ class NZBGet(Downloader): for item in history: log.debug('Found %s in NZBGet history. ParStatus: %s, ScriptStatus: %s, Log: %s', (item['NZBFilename'] , item['ParStatus'], item['ScriptStatus'] , item['Log'])) + try: + NZB_ID = [param['Value'] for param in item['Parameters'] if param['Name'] == 'couchpotato'][0] + except: + NZB_ID = item['NZBID'], statuses.append({ - 'id': item['NZBID'], + 'id': NZB_ID, 'name': item['NZBFilename'], 'status': 'completed' if item['ParStatus'] == 'SUCCESS' and item['ScriptStatus'] == 'SUCCESS' else 'failed', 'original_status': item['ParStatus'] + ', ' + item['ScriptStatus'], @@ -147,8 +162,11 @@ class NZBGet(Downloader): try: history = rpc.history() - if rpc.editqueue('HistoryDelete', 0, "", [tryInt(item['id'])]): - path = [hist['DestDir'] for hist in history if hist['NZBID'] == item['id']][0] + for hist in history: + if hist['Parameters'] and hist['Parameters']['couchpotato'] and hist['Parameters']['couchpotato'] == item['id']: + NZBID = hist['ID'] + path = hist['DestDir'] + if rpc.editqueue('HistoryDelete', 0, "", [tryInt(NZBID)]): shutil.rmtree(path, True) except: log.error('Failed deleting: %s', traceback.format_exc(0)) From cbd29df52afcf07f84889674d8621cb8d0e7a813 Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 26 Apr 2013 16:27:36 +0200 Subject: [PATCH 09/48] Update to_go even if movie isn't found in manage. --- couchpotato/core/plugins/manage/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/couchpotato/core/plugins/manage/main.py b/couchpotato/core/plugins/manage/main.py index 51094899..3e791de1 100644 --- a/couchpotato/core/plugins/manage/main.py +++ b/couchpotato/core/plugins/manage/main.py @@ -185,6 +185,8 @@ class Manage(Plugin): # Add it to release and update the info fireEvent('release.add', group = group) fireEventAsync('library.update', identifier = identifier, on_complete = self.createAfterUpdate(folder, identifier)) + else: + self.in_progress[folder]['to_go'] = self.in_progress[folder]['to_go'] - 1 return addToLibrary From 1600b6d0ea21b3eb146682dba1910b811aaab1ff Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 26 Apr 2013 16:36:42 +0200 Subject: [PATCH 10/48] NZBGet set advanced and description --- couchpotato/core/downloaders/nzbget/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/couchpotato/core/downloaders/nzbget/__init__.py b/couchpotato/core/downloaders/nzbget/__init__.py index bbe52ca4..a17b2dc5 100644 --- a/couchpotato/core/downloaders/nzbget/__init__.py +++ b/couchpotato/core/downloaders/nzbget/__init__.py @@ -27,6 +27,8 @@ config = [{ { 'name': 'username', 'default': 'nzbget', + 'advanced': True, + 'description': 'Set a different username to connect. Default: nzbget', }, { 'name': 'password', From 518ac1681445966949eaad83213b17b7990dc810 Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 26 Apr 2013 16:44:02 +0200 Subject: [PATCH 11/48] Use lowercase variable --- couchpotato/core/downloaders/nzbget/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/couchpotato/core/downloaders/nzbget/main.py b/couchpotato/core/downloaders/nzbget/main.py index 7dfa472f..0f1bfcdf 100644 --- a/couchpotato/core/downloaders/nzbget/main.py +++ b/couchpotato/core/downloaders/nzbget/main.py @@ -58,7 +58,7 @@ class NZBGet(Downloader): file_id = [item['LastID'] for item in groups if item['NZBFilename'] == nzb_name] confirmed = rpc.editqueue("GroupSetParameter", 0, couchpotato_id, file_id) if confirmed: - log.debug('couchpotato parameter set in nzbget download') + log.debug('couchpotato parameter set in nzbget download') return self.downloadReturnId(nzb_id) else: log.error('NZBGet could not add %s to the queue.', nzb_name) @@ -101,11 +101,11 @@ class NZBGet(Downloader): for item in groups: log.debug('Found %s in NZBGet download queue', item['NZBFilename']) try: - NZB_ID = [param['Value'] for param in item['Parameters'] if param['Name'] == 'couchpotato'][0] + nzb_id = [param['Value'] for param in item['Parameters'] if param['Name'] == 'couchpotato'][0] except: - NZB_ID = item['NZBID'], + nzb_id = item['NZBID'], statuses.append({ - 'id': NZB_ID, + 'id': nzb_id, 'name': item['NZBFilename'], 'original_status': 'DOWNLOADING' if item['ActiveDownloads'] > 0 else 'QUEUED', # Seems to have no native API function for time left. This will return the time left after NZBGet started downloading this item @@ -124,11 +124,11 @@ class NZBGet(Downloader): for item in history: log.debug('Found %s in NZBGet history. ParStatus: %s, ScriptStatus: %s, Log: %s', (item['NZBFilename'] , item['ParStatus'], item['ScriptStatus'] , item['Log'])) try: - NZB_ID = [param['Value'] for param in item['Parameters'] if param['Name'] == 'couchpotato'][0] + nzb_id = [param['Value'] for param in item['Parameters'] if param['Name'] == 'couchpotato'][0] except: - NZB_ID = item['NZBID'], + nzb_id = item['NZBID'], statuses.append({ - 'id': NZB_ID, + 'id': nzb_id, 'name': item['NZBFilename'], 'status': 'completed' if item['ParStatus'] == 'SUCCESS' and item['ScriptStatus'] == 'SUCCESS' else 'failed', 'original_status': item['ParStatus'] + ', ' + item['ScriptStatus'], From e786c9c79a8f41a205f34dcf8770294c2a661ea3 Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 26 Apr 2013 18:11:18 +0200 Subject: [PATCH 12/48] Use sets for ignored words. fixes #1657 --- couchpotato/core/plugins/searcher/__init__.py | 3 ++- couchpotato/core/plugins/searcher/main.py | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/couchpotato/core/plugins/searcher/__init__.py b/couchpotato/core/plugins/searcher/__init__.py index 90cece46..aec419a2 100644 --- a/couchpotato/core/plugins/searcher/__init__.py +++ b/couchpotato/core/plugins/searcher/__init__.py @@ -25,12 +25,13 @@ config = [{ 'label': 'Required words', 'default': '', 'placeholder': 'Example: DTS, AC3 & English', - 'description': 'Ignore releases that don\'t contain at least one set of words. Sets are separated by "," and each word within a set must be separated with "&"' + 'description': 'A release should contain at least one set of words. Sets are separated by "," and each word within a set must be separated with "&"' }, { 'name': 'ignored_words', 'label': 'Ignored words', 'default': 'german, dutch, french, truefrench, danish, swedish, spanish, italian, korean, dubbed, swesub, korsub, dksubs', + 'description': 'Ignores releases that match any of these sets. (Works like explained above)' }, { 'name': 'preferred_method', diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index ad33c6ff..e6e81740 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -384,8 +384,9 @@ class Searcher(Plugin): movie_words = re.split('\W+', simplifyString(movie_name)) nzb_name = simplifyString(nzb['name']) nzb_words = re.split('\W+', nzb_name) - required_words = splitString(self.conf('required_words').lower()) + # Make sure it has required words + required_words = splitString(self.conf('required_words').lower()) req_match = 0 for req_set in required_words: req = splitString(req_set, '&') @@ -395,19 +396,24 @@ class Searcher(Plugin): log.info2("Wrong: Required word missing: %s" % nzb['name']) return False + # Ignore releases ignored_words = splitString(self.conf('ignored_words').lower()) - blacklisted = list(set(nzb_words) & set(ignored_words) - set(movie_words)) - if self.conf('ignored_words') and blacklisted: - log.info2("Wrong: '%s' blacklisted words: %s" % (nzb['name'], ", ".join(blacklisted))) + ignored_match = 0 + for ignored_set in ignored_words: + ignored = splitString(ignored_set, '&') + ignored_match += len(list(set(nzb_words) & set(ignored))) == len(ignored) + + if self.conf('ignored_words') and ignored_match: + log.info2("Wrong: '%s' contains 'ignored words'" % (nzb['name'])) return False + # Ignore porn stuff pron_tags = ['xxx', 'sex', 'anal', 'tits', 'fuck', 'porn', 'orgy', 'milf', 'boobs', 'erotica', 'erotic'] pron_words = list(set(nzb_words) & set(pron_tags) - set(movie_words)) if pron_words: log.info('Wrong: %s, probably pr0n', (nzb['name'])) return False - #qualities = fireEvent('quality.all', single = True) preferred_quality = fireEvent('quality.single', identifier = quality['identifier'], single = True) # Contains lower quality string From 6e45c14ac5f372bbff8768366d80891016c6d267 Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 26 Apr 2013 18:49:39 +0200 Subject: [PATCH 13/48] Don't download html files as trailers. fixes #1658 --- couchpotato/core/plugins/trailer/__init__.py | 2 +- couchpotato/core/plugins/trailer/main.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/plugins/trailer/__init__.py b/couchpotato/core/plugins/trailer/__init__.py index e4c51bd1..d8496b30 100644 --- a/couchpotato/core/plugins/trailer/__init__.py +++ b/couchpotato/core/plugins/trailer/__init__.py @@ -29,7 +29,7 @@ config = [{ 'label': 'Naming', 'default': '-trailer', 'advanced': True, - 'description': 'Use to use above settings.' + 'description': 'Use <filename> to use above settings.' }, ], }, diff --git a/couchpotato/core/plugins/trailer/main.py b/couchpotato/core/plugins/trailer/main.py index 4ab51e78..1a8955fb 100644 --- a/couchpotato/core/plugins/trailer/main.py +++ b/couchpotato/core/plugins/trailer/main.py @@ -22,10 +22,15 @@ class Trailer(Plugin): return False for trailer in trailers.get(self.conf('quality'), []): - filename = self.conf('name').replace('', group['filename']) + ('.%s' % getExt(trailer)) + + ext = getExt(trailer) + filename = self.conf('name').replace('', group['filename']) + ('.%s' % ('mp4' if len(ext) > 5 else ext)) destination = os.path.join(group['destination_dir'], filename) if not os.path.isfile(destination): - fireEvent('file.download', url = trailer, dest = destination, urlopen_kwargs = {'headers': {'User-Agent': 'Quicktime'}}, single = True) + trailer_file = fireEvent('file.download', url = trailer, dest = destination, urlopen_kwargs = {'headers': {'User-Agent': 'Quicktime'}}, single = True) + if os.path.getsize(trailer_file) < (1024 * 1024): # Don't trust small trailers (1MB), try next one + os.unlink(trailer_file) + continue else: log.debug('Trailer already exists: %s', destination) From 6ee68d1418204f5d504578226ee9ea42272cedc6 Mon Sep 17 00:00:00 2001 From: mano3m <-> Date: Fri, 26 Apr 2013 19:34:15 +0200 Subject: [PATCH 14/48] Fix getDownloadInfo --- couchpotato/core/plugins/renamer/main.py | 67 ++++++++++++------------ 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 47080cbc..a84f36e3 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -119,7 +119,7 @@ class Renamer(Plugin): db = get_session() # Get the download info stored in the downloaded release - download_info = getDownloadInfo(download_id = download_id, downloader = downloader) + download_info = self.getDownloadInfo(download_id = download_id, downloader = downloader) groups = fireEvent('scanner.scan', folder = folder if folder else self.conf('from'), files = files, download_info = download_info, return_ignored = False, single = True) @@ -355,7 +355,7 @@ class Renamer(Plugin): else: log.info('Better quality release already exists for %s, with quality %s', (movie.library.titles[0].title, release.quality.label)) - # Add _EXISTS_ to the parent dir + # Add exists tag to the .ignore file self.tagDir(group, 'exists') # Notify on rename fail @@ -376,7 +376,8 @@ class Renamer(Plugin): db.commit() # Remove leftover files - if self.conf('cleanup') and not self.conf('move_leftover') and remove_leftovers: + if self.conf('cleanup') and not self.conf('move_leftover') and remove_leftovers and \ + not (self.conf('file_action') != 'move' and download_info and download_info.get('is_torrent')): log.debug('Removing leftover files') for current_file in group['files']['leftover']: remove_files.append(current_file) @@ -676,34 +677,34 @@ Remove it if you want it to be renamed (again, or at least let it try again) return True -def getDownloadInfo(self, download_id, downloader): - - rls = None - download_info = None - - if download_id and downloader: - - db = get_session() - - rlsnfo_dwnlds = db.query(ReleaseInfo).filter_by(identifier = 'download_downloader', value = downloader).all() - rlsnfo_ids = db.query(ReleaseInfo).filter_by(identifier = 'download_id', value = download_id).all() - - for rlsnfo_dwnld in rlsnfo_dwnlds: - for rlsnfo_id in rlsnfo_ids: - if rlsnfo_id.release == rlsnfo_dwnld.release: - rls = rlsnfo_id.release - break - if rls: break - - if not rls: - log.error('Download ID %s from downloader %s not found in releases', (download_id, downloader)) - - if rls: - download_info = { - 'imdb_id': rls.movie.library.identifier, - 'quality': rls.quality.identifier, - 'is_torrent': any(downloader_type in fireEvent('download.downloader_type', downloader = downloader) for downloader_type in ['torrent', 'torrent_magnet']) - } - - return download_info + def getDownloadInfo(self, download_id, downloader): + + rls = None + download_info = None + + if download_id and downloader: + + db = get_session() + + rlsnfo_dwnlds = db.query(ReleaseInfo).filter_by(identifier = 'download_downloader', value = downloader).all() + rlsnfo_ids = db.query(ReleaseInfo).filter_by(identifier = 'download_id', value = download_id).all() + + for rlsnfo_dwnld in rlsnfo_dwnlds: + for rlsnfo_id in rlsnfo_ids: + if rlsnfo_id.release == rlsnfo_dwnld.release: + rls = rlsnfo_id.release + break + if rls: break + + if not rls: + log.error('Download ID %s from downloader %s not found in releases', (download_id, downloader)) + + if rls: + download_info = { + 'imdb_id': rls.movie.library.identifier, + 'quality': rls.quality.identifier, + 'is_torrent': any(downloader_type in fireEvent('download.downloader_type', downloader = downloader) for downloader_type in ['torrent', 'torrent_magnet']) + } + + return download_info From 384a355a53d32b49a8d6ad9d506deb347974a48c Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 26 Apr 2013 23:48:54 +0200 Subject: [PATCH 15/48] Check release type by info --- couchpotato/core/downloaders/base.py | 7 --- couchpotato/core/plugins/renamer/main.py | 56 ++++++++++++------------ 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/couchpotato/core/downloaders/base.py b/couchpotato/core/downloaders/base.py index a78e0b18..8ccc1369 100644 --- a/couchpotato/core/downloaders/base.py +++ b/couchpotato/core/downloaders/base.py @@ -39,13 +39,6 @@ class Downloader(Provider): addEvent('download.enabled_types', self.getEnabledDownloadType) addEvent('download.status', self._getAllDownloadStatus) addEvent('download.remove_failed', self._removeFailed) - addEvent('download.downloader_type', self.getDownloaderType) - - def getDownloaderType(self, downloader): - if self.getName() == downloader: - return self.type - - return [] def getEnabledDownloadType(self): for download_type in self.type: diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 3842b855..1a8be7af 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -70,15 +70,14 @@ class Renamer(Plugin): fireEventAsync('renamer.scan', movie_folder = movie_folder, - downloader = downloader, - download_id = download_id + download_info = {'id': download_id, 'downloader': downloader} if download_id else None ) return jsonified({ 'success': True }) - def scan(self, movie_folder = None, downloader = None, download_id = None): + def scan(self, movie_folder = None, download_info = None): if self.isDisabled(): return @@ -118,8 +117,8 @@ class Renamer(Plugin): db = get_session() - # Get the download info stored in the downloaded release - download_info = self.getDownloadInfo(download_id = download_id, downloader = downloader) + # Extend the download info with info stored in the downloaded release + download_info = self.extendDownloadInfo(download_info) groups = fireEvent('scanner.scan', folder = folder if folder else self.conf('from'), files = files, download_info = download_info, return_ignored = False, single = True) @@ -377,7 +376,7 @@ class Renamer(Plugin): # Remove leftover files if self.conf('cleanup') and not self.conf('move_leftover') and remove_leftovers and \ - not (self.conf('file_action') != 'move' and download_info and download_info.get('is_torrent')): + not (self.conf('file_action') != 'move' and self.downloadIsTorrent(download_info)): log.debug('Removing leftover files') for current_file in group['files']['leftover']: remove_files.append(current_file) @@ -427,13 +426,13 @@ class Renamer(Plugin): self.makeDir(os.path.dirname(dst)) try: - self.moveFile(src, dst, forcemove = not (download_info and download_info.get('is_torrent'))) + self.moveFile(src, dst, forcemove = not self.downloadIsTorrent(download_info)) group['renamed_files'].append(dst) except: log.error('Failed moving the file "%s" : %s', (os.path.basename(src), traceback.format_exc())) self.tagDir(group, 'failed_rename') - if self.conf('file_action') != 'move' and download_info and download_info.get('is_torrent'): + if self.conf('file_action') != 'move' and self.downloadIsTorrent(download_info): self.tagDir(group, 'renamed already') # Remove matching releases @@ -657,7 +656,7 @@ Remove it if you want it to be renamed (again, or at least let it try again) elif item['status'] == 'completed': log.info('Download of %s completed!', item['name']) if item['id'] and item['downloader'] and item['folder']: - fireEvent('renamer.scan', movie_folder = item['folder'], downloader = item['downloader'], download_id = item['id']) + fireEventAsync('renamer.scan', movie_folder = item['folder'], download_info = item) else: scan_required = True @@ -677,34 +676,37 @@ Remove it if you want it to be renamed (again, or at least let it try again) return True - def getDownloadInfo(self, download_id, downloader): - - rls = None - download_info = None - - if download_id and downloader: - + def extendDownloadInfo(self, download_info): + + rls = None + + if download_info and download_info.get('id') and download_info.get('downloader'): + db = get_session() - - rlsnfo_dwnlds = db.query(ReleaseInfo).filter_by(identifier = 'download_downloader', value = downloader).all() - rlsnfo_ids = db.query(ReleaseInfo).filter_by(identifier = 'download_id', value = download_id).all() - + + rlsnfo_dwnlds = db.query(ReleaseInfo).filter_by(identifier = 'download_downloader', value = download_info.get('downloader')).all() + rlsnfo_ids = db.query(ReleaseInfo).filter_by(identifier = 'download_id', value = download_info.get('id')).all() + for rlsnfo_dwnld in rlsnfo_dwnlds: for rlsnfo_id in rlsnfo_ids: if rlsnfo_id.release == rlsnfo_dwnld.release: rls = rlsnfo_id.release break if rls: break - + if not rls: - log.error('Download ID %s from downloader %s not found in releases', (download_id, downloader)) - + log.error('Download ID %s from downloader %s not found in releases', (download_info.get('id'), download_info.get('downloader'))) + if rls: - download_info = { + + rls_dict = rls.to_dict({'info':{}}) + download_info.update({ 'imdb_id': rls.movie.library.identifier, 'quality': rls.quality.identifier, - 'is_torrent': any(downloader_type in fireEvent('download.downloader_type', downloader = downloader) for downloader_type in ['torrent', 'torrent_magnet']) - } - + 'type': rls_dict.get('info', {}).get('type') + }) + return download_info + def downloadIsTorrent(self, download_info): + return download_info and download_info.get('type') in ['torrent', 'torrent_magnet'] From 1a846b04ee63d2f4cdeb40abe80d4e85328653ff Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Sat, 27 Apr 2013 11:26:52 +0930 Subject: [PATCH 16/48] Fix minor errors. Fix #1666 --- couchpotato/core/downloaders/nzbget/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/downloaders/nzbget/main.py b/couchpotato/core/downloaders/nzbget/main.py index 0f1bfcdf..c060a334 100644 --- a/couchpotato/core/downloaders/nzbget/main.py +++ b/couchpotato/core/downloaders/nzbget/main.py @@ -16,7 +16,7 @@ class NZBGet(Downloader): type = ['nzb'] - url = 'http://%(username):%(password)s@%(host)s/xmlrpc' + url = 'http://%(username)s:%(password)s@%(host)s/xmlrpc' def download(self, data = {}, movie = {}, filedata = None): @@ -103,7 +103,7 @@ class NZBGet(Downloader): try: nzb_id = [param['Value'] for param in item['Parameters'] if param['Name'] == 'couchpotato'][0] except: - nzb_id = item['NZBID'], + nzb_id = item['NZBID'] statuses.append({ 'id': nzb_id, 'name': item['NZBFilename'], @@ -126,7 +126,7 @@ class NZBGet(Downloader): try: nzb_id = [param['Value'] for param in item['Parameters'] if param['Name'] == 'couchpotato'][0] except: - nzb_id = item['NZBID'], + nzb_id = item['NZBID'] statuses.append({ 'id': nzb_id, 'name': item['NZBFilename'], From 3936100000c9693916f892e3ab0798c916122016 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 27 Apr 2013 09:42:29 +0200 Subject: [PATCH 17/48] Cache status calls --- couchpotato/core/plugins/status/main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/plugins/status/main.py b/couchpotato/core/plugins/status/main.py index c01caef5..f9fb5138 100644 --- a/couchpotato/core/plugins/status/main.py +++ b/couchpotato/core/plugins/status/main.py @@ -25,6 +25,7 @@ class StatusPlugin(Plugin): 'available': 'Available', 'suggest': 'Suggest', } + status_cached = {} def __init__(self): addEvent('status.add', self.add) @@ -32,6 +33,7 @@ class StatusPlugin(Plugin): addEvent('status.get_by_id', self.getById) addEvent('status.all', self.all) addEvent('app.initialize', self.fill) + addEvent('app.load', self.all) addApiView('status.list', self.list, docs = { 'desc': 'Check for available update', @@ -67,11 +69,16 @@ class StatusPlugin(Plugin): s = status.to_dict() temp.append(s) - #db.close() + # Update cache + self.status_cached[status.identifier] = s + return temp def add(self, identifier): + if self.status_cached.get(identifier): + return self.status_cached.get(identifier) + db = get_session() s = db.query(Status).filter_by(identifier = identifier).first() @@ -85,7 +92,7 @@ class StatusPlugin(Plugin): status_dict = s.to_dict() - #db.close() + self.status_cached[identifier] = status_dict return status_dict def fill(self): From 7818b430456d05e857c8a361314662253133c3f4 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 27 Apr 2013 10:08:03 +0200 Subject: [PATCH 18/48] Release files add in bulk --- couchpotato/core/plugins/release/main.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/couchpotato/core/plugins/release/main.py b/couchpotato/core/plugins/release/main.py index 68bf60a6..5c4d39f2 100644 --- a/couchpotato/core/plugins/release/main.py +++ b/couchpotato/core/plugins/release/main.py @@ -41,6 +41,7 @@ class Release(Plugin): addEvent('release.clean', self.clean) def add(self, group): + db = get_session() identifier = '%s.%s.%s' % (group['library']['identifier'], group['meta_data'].get('audio', 'unknown'), group['meta_data']['quality']['identifier']) @@ -76,15 +77,19 @@ class Release(Plugin): db.commit() # Add each file type + added_files = [] for type in group['files']: for cur_file in group['files'][type]: added_file = self.saveFile(cur_file, type = type, include_media_info = type is 'movie') - try: - added_file = db.query(File).filter_by(id = added_file.get('id')).one() - rel.files.append(added_file) - db.commit() - except Exception, e: - log.debug('Failed to attach "%s" to release: %s', (cur_file, e)) + added_files.append(added_file.get('id')) + + # Add the release files in batch + try: + added_files = db.query(File).filter(or_(*[File.id == x for x in added_files])).all() + rel.files.append(added_files) + db.commit() + except Exception, e: + log.debug('Failed to attach "%s" to release: %s', (cur_file, e)) fireEvent('movie.restatus', movie.id) From 1d603e1ec294fa243fd6055136440817bcae1cf2 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 27 Apr 2013 10:48:47 +0200 Subject: [PATCH 19/48] Simplify event handling --- couchpotato/core/event.py | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/couchpotato/core/event.py b/couchpotato/core/event.py index 19e97541..8a5145a6 100644 --- a/couchpotato/core/event.py +++ b/couchpotato/core/event.py @@ -16,10 +16,8 @@ def runHandler(name, handler, *args, **kwargs): def addEvent(name, handler, priority = 100): - if events.get(name): - e = events[name] - else: - e = events[name] = Event(name = name, threads = 10, exc_info = True, traceback = True, lock = threading.RLock()) + if not events.get(name): + events[name] = [] def createHandle(*args, **kwargs): @@ -35,7 +33,10 @@ def addEvent(name, handler, priority = 100): return h - e.handle(createHandle, priority = priority) + events[name].append({ + 'handler': createHandle, + 'priority': priority, + }) def removeEvent(name, handler): e = events[name] @@ -43,6 +44,12 @@ def removeEvent(name, handler): def fireEvent(name, *args, **kwargs): if not events.get(name): return + + e = Event(name = name, threads = 10, asynch = kwargs.get('async', False), exc_info = True, traceback = True, lock = threading.RLock()) + + for event in events[name]: + e.handle(event['handler'], priority = event['priority']) + #log.debug('Firing event %s', name) try: @@ -52,6 +59,7 @@ def fireEvent(name, *args, **kwargs): 'single': False, # Return single handler 'merge': False, # Merge items 'in_order': False, # Fire them in specific order, waits for the other to finish + 'async': False } # Do options @@ -62,13 +70,6 @@ def fireEvent(name, *args, **kwargs): options[x] = val except: pass - e = events[name] - - # Lock this event - e.lock.acquire() - - e.asynchronous = False - # Make sure only 1 event is fired at a time when order is wanted kwargs['event_order_lock'] = threading.RLock() if options['in_order'] or options['single'] else None kwargs['event_return_on_result'] = options['single'] @@ -76,9 +77,6 @@ def fireEvent(name, *args, **kwargs): # Fire result = e(*args, **kwargs) - # Release lock for this event - e.lock.release() - if options['single'] and not options['merge']: results = None @@ -140,13 +138,8 @@ def fireEvent(name, *args, **kwargs): log.error('%s: %s', (name, traceback.format_exc())) def fireEventAsync(*args, **kwargs): - try: - my_thread = threading.Thread(target = fireEvent, args = args, kwargs = kwargs) - my_thread.setDaemon(True) - my_thread.start() - return True - except Exception, e: - log.error('%s: %s', (args[0], e)) + kwargs['async'] = True + fireEvent(*args, **kwargs) def errorHandler(error): etype, value, tb = error From 9ba19d27a680309102941c51a3c39558cc25bb3c Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 27 Apr 2013 11:04:19 +0200 Subject: [PATCH 20/48] Combine status calls --- couchpotato/core/plugins/movie/main.py | 15 +++---- couchpotato/core/plugins/release/main.py | 11 +++-- couchpotato/core/plugins/renamer/main.py | 13 ++---- couchpotato/core/plugins/searcher/main.py | 3 +- couchpotato/core/plugins/status/main.py | 42 +++++++++++-------- .../core/providers/movie/_modifier/main.py | 3 +- 6 files changed, 41 insertions(+), 46 deletions(-) diff --git a/couchpotato/core/plugins/movie/main.py b/couchpotato/core/plugins/movie/main.py index 0a99fe6a..4b595dc5 100644 --- a/couchpotato/core/plugins/movie/main.py +++ b/couchpotato/core/plugins/movie/main.py @@ -108,9 +108,8 @@ class MoviePlugin(Plugin): now = time.time() week = 262080 - done_status = fireEvent('status.get', 'done', single = True) - available_status = fireEvent('status.get', 'available', single = True) - snatched_status = fireEvent('status.get', 'snatched', single = True) + done_status, available_status, snatched_status = \ + fireEvent('status.get', ['done', 'available', 'snatched'], single = True) db = get_session() @@ -367,11 +366,8 @@ class MoviePlugin(Plugin): library = fireEvent('library.add', single = True, attrs = params, update_after = update_library) # Status - status_active = fireEvent('status.add', 'active', single = True) - snatched_status = fireEvent('status.add', 'snatched', single = True) - ignored_status = fireEvent('status.add', 'ignored', single = True) - done_status = fireEvent('status.add', 'done', single = True) - downloaded_status = fireEvent('status.add', 'downloaded', single = True) + status_active, snatched_status, ignored_status, done_status, downloaded_status = \ + fireEvent('status.get', ['active', 'snatched', 'ignored', 'done', 'downloaded'], single = True) default_profile = fireEvent('profile.default', single = True) @@ -549,8 +545,7 @@ class MoviePlugin(Plugin): def restatus(self, movie_id): - active_status = fireEvent('status.get', 'active', single = True) - done_status = fireEvent('status.get', 'done', single = True) + active_status, done_status = fireEvent('status.get', ['active', 'done'], single = True) db = get_session() diff --git a/couchpotato/core/plugins/release/main.py b/couchpotato/core/plugins/release/main.py index 5c4d39f2..4967bce0 100644 --- a/couchpotato/core/plugins/release/main.py +++ b/couchpotato/core/plugins/release/main.py @@ -46,8 +46,10 @@ class Release(Plugin): identifier = '%s.%s.%s' % (group['library']['identifier'], group['meta_data'].get('audio', 'unknown'), group['meta_data']['quality']['identifier']) + + done_status, snatched_status = fireEvent('status.get', ['done', 'snatched'], single = True) + # Add movie - done_status = fireEvent('status.get', 'done', single = True) movie = db.query(Movie).filter_by(library_id = group['library'].get('id')).first() if not movie: movie = Movie( @@ -59,7 +61,6 @@ class Release(Plugin): db.commit() # Add Release - snatched_status = fireEvent('status.get', 'snatched', single = True) rel = db.query(Relea).filter( or_( Relea.identifier == identifier, @@ -152,8 +153,7 @@ class Release(Plugin): rel = db.query(Relea).filter_by(id = id).first() if rel: - ignored_status = fireEvent('status.get', 'ignored', single = True) - available_status = fireEvent('status.get', 'available', single = True) + ignored_status, available_status = fireEvent('status.get', ['ignored', 'available'], single = True) rel.status_id = available_status.get('id') if rel.status_id is ignored_status.get('id') else ignored_status.get('id') db.commit() @@ -166,8 +166,7 @@ class Release(Plugin): db = get_session() id = getParam('id') - snatched_status = fireEvent('status.add', 'snatched', single = True) - done_status = fireEvent('status.get', 'done', single = True) + snatched_status, done_status = fireEvent('status.get', ['snatched', 'done'], single = True) rel = db.query(Relea).filter_by(id = id).first() if rel: diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 1a8be7af..5e886fb2 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -131,10 +131,8 @@ class Renamer(Plugin): separator = self.conf('separator') # Statusses - done_status = fireEvent('status.get', 'done', single = True) - active_status = fireEvent('status.get', 'active', single = True) - downloaded_status = fireEvent('status.get', 'downloaded', single = True) - snatched_status = fireEvent('status.get', 'snatched', single = True) + done_status, active_status, downloaded_status, snatched_status = \ + fireEvent('status.get', ['done', 'active', 'downloaded', 'snatched'], single = True) for group_identifier in groups: @@ -588,11 +586,8 @@ Remove it if you want it to be renamed (again, or at least let it try again) self.checking_snatched = True - snatched_status = fireEvent('status.get', 'snatched', single = True) - ignored_status = fireEvent('status.get', 'ignored', single = True) - failed_status = fireEvent('status.get', 'failed', single = True) - - done_status = fireEvent('status.get', 'done', single = True) + snatched_status, ignored_status, failed_status, done_status = \ + fireEvent('status.get', ['snatched', 'ignored', 'failed', 'done'], single = True) db = get_session() rels = db.query(Release).filter_by(status_id = snatched_status.get('id')).all() diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index e6e81740..dba0ea7e 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -146,8 +146,7 @@ class Searcher(Plugin): pre_releases = fireEvent('quality.pre_releases', single = True) release_dates = fireEvent('library.update_release_date', identifier = movie['library']['identifier'], merge = True) - available_status = fireEvent('status.get', 'available', single = True) - ignored_status = fireEvent('status.get', 'ignored', single = True) + available_status, ignored_status = fireEvent('status.get', ['available', 'ignored'], single = True) found_releases = [] diff --git a/couchpotato/core/plugins/status/main.py b/couchpotato/core/plugins/status/main.py index f9fb5138..c496c2de 100644 --- a/couchpotato/core/plugins/status/main.py +++ b/couchpotato/core/plugins/status/main.py @@ -28,12 +28,11 @@ class StatusPlugin(Plugin): status_cached = {} def __init__(self): - addEvent('status.add', self.add) - addEvent('status.get', self.add) # Alias for .add + addEvent('status.get', self.get) addEvent('status.get_by_id', self.getById) addEvent('status.all', self.all) addEvent('app.initialize', self.fill) - addEvent('app.load', self.all) + addEvent('app.load', self.all) # Cache all statuses addApiView('status.list', self.list, docs = { 'desc': 'Check for available update', @@ -74,26 +73,35 @@ class StatusPlugin(Plugin): return temp - def add(self, identifier): + def get(self, identifiers): - if self.status_cached.get(identifier): - return self.status_cached.get(identifier) + if not isinstance(identifiers, (list)): + identifiers = [identifiers] db = get_session() + return_list = [] - s = db.query(Status).filter_by(identifier = identifier).first() - if not s: - s = Status( - identifier = identifier, - label = toUnicode(identifier.capitalize()) - ) - db.add(s) - db.commit() + for identifier in identifiers: - status_dict = s.to_dict() + if self.status_cached.get(identifier): + return_list.append(self.status_cached.get(identifier)) + continue - self.status_cached[identifier] = status_dict - return status_dict + s = db.query(Status).filter_by(identifier = identifier).first() + if not s: + s = Status( + identifier = identifier, + label = toUnicode(identifier.capitalize()) + ) + db.add(s) + db.commit() + + status_dict = s.to_dict() + + self.status_cached[identifier] = status_dict + return_list.append(status_dict) + + return return_list if len(identifiers) > 1 else return_list[0] def fill(self): diff --git a/couchpotato/core/providers/movie/_modifier/main.py b/couchpotato/core/providers/movie/_modifier/main.py index f0f98e0e..12d1e325 100644 --- a/couchpotato/core/providers/movie/_modifier/main.py +++ b/couchpotato/core/providers/movie/_modifier/main.py @@ -52,8 +52,7 @@ class MovieResultModifier(Plugin): if l: # Statuses - active_status = fireEvent('status.get', 'active', single = True) - done_status = fireEvent('status.get', 'done', single = True) + active_status, done_status = fireEvent('status.get', ['active', 'done'], single = True) for movie in l.movies: if movie.status_id == active_status['id']: From 367c385fff918e6ac581388259947730532cf76b Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 27 Apr 2013 11:12:15 +0200 Subject: [PATCH 21/48] Lowercase variables --- couchpotato/core/downloaders/nzbget/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/downloaders/nzbget/main.py b/couchpotato/core/downloaders/nzbget/main.py index c060a334..fc54f024 100644 --- a/couchpotato/core/downloaders/nzbget/main.py +++ b/couchpotato/core/downloaders/nzbget/main.py @@ -164,9 +164,9 @@ class NZBGet(Downloader): history = rpc.history() for hist in history: if hist['Parameters'] and hist['Parameters']['couchpotato'] and hist['Parameters']['couchpotato'] == item['id']: - NZBID = hist['ID'] + nzb_id = hist['ID'] path = hist['DestDir'] - if rpc.editqueue('HistoryDelete', 0, "", [tryInt(NZBID)]): + if rpc.editqueue('HistoryDelete', 0, "", [tryInt(nzb_id)]): shutil.rmtree(path, True) except: log.error('Failed deleting: %s', traceback.format_exc(0)) From 8b0aa7a6b366194fbd8b3d1675e99347f2f0a4d8 Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 30 Apr 2013 00:24:56 +0200 Subject: [PATCH 22/48] Initial mobile styling --- .../notifications/core/static/notification.js | 1 + couchpotato/core/plugins/log/static/log.css | 14 +- couchpotato/core/plugins/movie/static/list.js | 124 ++-- .../core/plugins/movie/static/movie.css | 287 +++++--- .../core/plugins/movie/static/movie.js | 14 +- .../core/plugins/movie/static/search.css | 231 ++++--- .../core/plugins/movie/static/search.js | 79 +-- couchpotato/static/fonts/Elusive-Icons.eot | Bin 0 -> 41988 bytes couchpotato/static/fonts/Elusive-Icons.svg | 298 +++++++++ couchpotato/static/fonts/Elusive-Icons.ttf | Bin 0 -> 41804 bytes couchpotato/static/fonts/Elusive-Icons.woff | Bin 0 -> 76072 bytes .../static/fonts/OpenSans-Bold-webfont.eot | Bin 0 -> 21190 bytes .../static/fonts/OpenSans-Bold-webfont.svg | 146 +++++ .../static/fonts/OpenSans-Bold-webfont.ttf | Bin 0 -> 21012 bytes .../static/fonts/OpenSans-Bold-webfont.woff | Bin 0 -> 14036 bytes .../fonts/OpenSans-BoldItalic-webfont.eot | Bin 0 -> 23510 bytes .../fonts/OpenSans-BoldItalic-webfont.svg | 146 +++++ .../fonts/OpenSans-BoldItalic-webfont.ttf | Bin 0 -> 23304 bytes .../fonts/OpenSans-BoldItalic-webfont.woff | Bin 0 -> 15572 bytes .../static/fonts/OpenSans-Italic-webfont.eot | Bin 0 -> 23866 bytes .../static/fonts/OpenSans-Italic-webfont.svg | 146 +++++ .../static/fonts/OpenSans-Italic-webfont.ttf | Bin 0 -> 23680 bytes .../static/fonts/OpenSans-Italic-webfont.woff | Bin 0 -> 15836 bytes .../static/fonts/OpenSans-Regular-webfont.eot | Bin 0 -> 20878 bytes .../static/fonts/OpenSans-Regular-webfont.svg | 146 +++++ .../static/fonts/OpenSans-Regular-webfont.ttf | Bin 0 -> 20688 bytes .../fonts/OpenSans-Regular-webfont.woff | Bin 0 -> 13988 bytes couchpotato/static/images/sprite.png | Bin 1795 -> 2759 bytes couchpotato/static/scripts/block/menu.js | 2 +- .../static/scripts/block/navigation.js | 45 +- couchpotato/static/scripts/couchpotato.js | 2 +- .../static/scripts/library/question.js | 28 +- couchpotato/static/style/main.css | 615 ++++++++++++------ couchpotato/static/style/settings.css | 20 +- couchpotato/templates/index.html | 3 + 35 files changed, 1792 insertions(+), 555 deletions(-) create mode 100755 couchpotato/static/fonts/Elusive-Icons.eot create mode 100755 couchpotato/static/fonts/Elusive-Icons.svg create mode 100755 couchpotato/static/fonts/Elusive-Icons.ttf create mode 100755 couchpotato/static/fonts/Elusive-Icons.woff create mode 100755 couchpotato/static/fonts/OpenSans-Bold-webfont.eot create mode 100755 couchpotato/static/fonts/OpenSans-Bold-webfont.svg create mode 100755 couchpotato/static/fonts/OpenSans-Bold-webfont.ttf create mode 100755 couchpotato/static/fonts/OpenSans-Bold-webfont.woff create mode 100755 couchpotato/static/fonts/OpenSans-BoldItalic-webfont.eot create mode 100755 couchpotato/static/fonts/OpenSans-BoldItalic-webfont.svg create mode 100755 couchpotato/static/fonts/OpenSans-BoldItalic-webfont.ttf create mode 100755 couchpotato/static/fonts/OpenSans-BoldItalic-webfont.woff create mode 100755 couchpotato/static/fonts/OpenSans-Italic-webfont.eot create mode 100755 couchpotato/static/fonts/OpenSans-Italic-webfont.svg create mode 100755 couchpotato/static/fonts/OpenSans-Italic-webfont.ttf create mode 100755 couchpotato/static/fonts/OpenSans-Italic-webfont.woff create mode 100755 couchpotato/static/fonts/OpenSans-Regular-webfont.eot create mode 100755 couchpotato/static/fonts/OpenSans-Regular-webfont.svg create mode 100755 couchpotato/static/fonts/OpenSans-Regular-webfont.ttf create mode 100755 couchpotato/static/fonts/OpenSans-Regular-webfont.woff diff --git a/couchpotato/core/notifications/core/static/notification.js b/couchpotato/core/notifications/core/static/notification.js index 52062e93..025d81d1 100644 --- a/couchpotato/core/notifications/core/static/notification.js +++ b/couchpotato/core/notifications/core/static/notification.js @@ -21,6 +21,7 @@ var NotificationBase = new Class({ App.addEvent('load', function(){ App.block.notification = new Block.Menu(self, { + 'button_class': 'icon2.eye-open', 'class': 'notification_menu', 'onOpen': self.markAsRead.bind(self) }) diff --git a/couchpotato/core/plugins/log/static/log.css b/couchpotato/core/plugins/log/static/log.css index 222b8efa..8804af63 100644 --- a/couchpotato/core/plugins/log/static/log.css +++ b/couchpotato/core/plugins/log/static/log.css @@ -5,7 +5,7 @@ margin: 0; font-size: 20px; position: fixed; - width: 960px; + width: 100%; bottom: 0; background: #4E5969; } @@ -24,7 +24,17 @@ .page.log .nav li.active { font-weight: bold; cursor: default; - font-size: 30px; + background: rgba(255,255,255,.1); + } + + @media all and (max-width: 480px) { + .page.log .nav { + font-size: 14px; + } + + .page.log .nav li { + padding: 5px; + } } .page.log .loading { diff --git a/couchpotato/core/plugins/movie/static/list.js b/couchpotato/core/plugins/movie/static/list.js index a89f89af..46819439 100644 --- a/couchpotato/core/plugins/movie/static/list.js +++ b/couchpotato/core/plugins/movie/static/list.js @@ -43,7 +43,10 @@ var MovieList = new Class({ }) : null ); - self.changeView(self.getSavedView() || self.options.view || 'details'); + if($(window).getSize().x < 480) + self.changeView('list'); + else + self.changeView(self.getSavedView() || self.options.view || 'details'); self.getMovies(); @@ -121,7 +124,7 @@ var MovieList = new Class({ if(!self.navigation_counter) return; - self.navigation_counter.set('text', (count || 0)); + self.navigation_counter.set('text', (count || 0) + ' movies'); }, @@ -146,64 +149,67 @@ var MovieList = new Class({ var chars = '#ABCDEFGHIJKLMNOPQRSTUVWXYZ'; self.current_view = self.getSavedView() || 'details'; - self.el.addClass(self.current_view+'_list') + self.el.addClass(self.current_view+'_list with_navigation') - self.navigation = new Element('div.alph_nav').adopt( - self.navigation_actions = new Element('ul.inlay.actions.reversed'), - self.navigation_counter = new Element('span.counter[title=Total]'), - self.navigation_alpha = new Element('ul.numbers', { - 'events': { - 'click:relay(li)': function(e, el){ - self.movie_list.empty() - self.activateLetter(el.get('data-letter')) - self.getMovies() + self.navigation = new Element('div.alph_nav').grab( + new Element('div').adopt( + self.navigation_alpha = new Element('ul.numbers', { + 'events': { + 'click:relay(li)': function(e, el){ + self.movie_list.empty() + self.activateLetter(el.get('data-letter')) + self.getMovies() + } } - } - }), - self.navigation_search_input = new Element('input.inlay', { - 'placeholder': 'Search', - 'events': { - 'keyup': self.search.bind(self), - 'change': self.search.bind(self) - } - }), - self.navigation_menu = new Block.Menu(self), - self.mass_edit_form = new Element('div.mass_edit_form').adopt( - new Element('span.select').adopt( - self.mass_edit_select = new Element('input[type=checkbox].inlay', { - 'events': { - 'change': self.massEditToggleAll.bind(self) - } - }), - self.mass_edit_selected = new Element('span.count', {'text': 0}), - self.mass_edit_selected_label = new Element('span', {'text': 'selected'}) - ), - new Element('div.quality').adopt( - self.mass_edit_quality = new Element('select'), - new Element('a.button.orange', { - 'text': 'Change quality', - 'events': { - 'click': self.changeQualitySelected.bind(self) - } - }) - ), - new Element('div.delete').adopt( - new Element('span[text=or]'), - new Element('a.button.red', { - 'text': 'Delete', - 'events': { - 'click': self.deleteSelected.bind(self) - } - }) - ), - new Element('div.refresh').adopt( - new Element('span[text=or]'), - new Element('a.button.green', { - 'text': 'Refresh', - 'events': { - 'click': self.refreshSelected.bind(self) - } - }) + }), + self.navigation_counter = new Element('span.counter[title=Total]'), + self.navigation_actions = new Element('ul.inlay.actions.reversed'), + self.navigation_search_input = new Element('input.search.inlay', { + 'title': 'Search through ' + self.options.identifier, + 'placeholder': 'Search through ' + self.options.identifier, + 'events': { + 'keyup': self.search.bind(self), + 'change': self.search.bind(self) + } + }), + self.navigation_menu = new Block.Menu(self), + self.mass_edit_form = new Element('div.mass_edit_form').adopt( + new Element('span.select').adopt( + self.mass_edit_select = new Element('input[type=checkbox].inlay', { + 'events': { + 'change': self.massEditToggleAll.bind(self) + } + }), + self.mass_edit_selected = new Element('span.count', {'text': 0}), + self.mass_edit_selected_label = new Element('span', {'text': 'selected'}) + ), + new Element('div.quality').adopt( + self.mass_edit_quality = new Element('select'), + new Element('a.button.orange', { + 'text': 'Change quality', + 'events': { + 'click': self.changeQualitySelected.bind(self) + } + }) + ), + new Element('div.delete').adopt( + new Element('span[text=or]'), + new Element('a.button.red', { + 'text': 'Delete', + 'events': { + 'click': self.deleteSelected.bind(self) + } + }) + ), + new Element('div.refresh').adopt( + new Element('span[text=or]'), + new Element('a.button.green', { + 'text': 'Refresh', + 'events': { + 'click': self.refreshSelected.bind(self) + } + }) + ) ) ) ).inject(self.el, 'top'); @@ -543,7 +549,7 @@ var MovieList = new Class({ self.title[is_empty ? 'hide' : 'show']() if(self.description) - self.description[is_empty ? 'hide' : 'show']() + self.description.setStyle('display', [is_empty ? 'none' : '']) if(is_empty && self.options.on_empty_element){ self.options.on_empty_element.inject(self.loader_first || self.title || self.movie_list, 'after'); diff --git a/couchpotato/core/plugins/movie/static/movie.css b/couchpotato/core/plugins/movie/static/movie.css index c6fe4e0a..6e0f7fd3 100644 --- a/couchpotato/core/plugins/movie/static/movie.css +++ b/couchpotato/core/plugins/movie/static/movie.css @@ -1,50 +1,72 @@ .movies { - padding: 60px 0 20px; + padding: 10px 0 20px; position: relative; z-index: 3; + width: 100%; } - .movies .loading { - display: block; - padding: 20px 0 0 0; - width: 100%; - z-index: 3; - transition: all .4s cubic-bezier(0.9,0,0.1,1); - height: 40px; - opacity: 1; - position: absolute; + .movies > div { + clear: both; + } + + .movies.thumbs_list > div:not(.description) { + margin-right: -4px; text-align: center; } - .movies .loading.hide { - height: 0; + + .movies .loading { + display: block; padding: 20px 0 0 0; - opacity: 0; - margin-top: -20px; - } - - .movies .loading .spinner { - display: inline-block; - } - - .movies .loading .message { - margin: 0 20px; + width: 100%; + z-index: 3; + transition: all .4s cubic-bezier(0.9,0,0.1,1); + height: 40px; + opacity: 1; + position: absolute; + text-align: center; } + .movies .loading.hide { + height: 0; + padding: 20px 0 0 0; + opacity: 0; + margin-top: -20px; + } + + .movies .loading .spinner { + display: inline-block; + } + + .movies .loading .message { + margin: 0 20px; + } - .movies > h2 { + .movies h2 { margin-bottom: 20px; } + @media all and (max-width: 480px) { + .movies h2 { + font-size: 25px; + margin-bottom: 5px; + } + } + .movies > .description { position: absolute; top: 30px; right: 0; font-style: italic; - text-shadow: none; opacity: 0.8; } .movies:hover > .description { opacity: 1; } + + @media all and (max-width: 860px) { + .movies > .description { + display: none; + } + } .movies.thumbs_list { padding: 20px 0 20px; @@ -53,21 +75,21 @@ .home .movies { padding-top: 6px; } - - - .movies.mass_edit_list { - padding-top: 90px; - } .movies .movie { position: relative; border-radius: 4px; margin: 10px 0; + padding-left: 20px; overflow: hidden; width: 100%; height: 180px; transition: all 0.6s cubic-bezier(0.9,0,0.1,1); } + + .movies.details_list .movie { + padding-left: 120px; + } .movies.list_list .movie:not(.details_view), .movies.mass_edit_list .movie { @@ -75,13 +97,22 @@ } .movies.thumbs_list .movie { - width: 153px; + width: 151px; height: 230px; display: inline-block; - margin: 0 8px 0 0; + margin: 0 8px 8px 0; + padding: 0; + vertical-align: top; } - .movies.thumbs_list .movie:nth-child(6n+6) { - margin: 0; + + @media all and (max-width: 480px) { + .movies.thumbs_list .movie { + width: 90px; + height: 137px; + display: inline-block; + margin: 0 8px 8px 0; + padding: 0; + } } .movies .movie .mask { @@ -109,8 +140,8 @@ .movies .data { padding: 20px; height: 100%; - width: 840px; - position: absolute; + width: 100%; + position: relative; right: 0; border-radius: 0; transition: all .6s cubic-bezier(0.9,0,0.1,1); @@ -119,7 +150,6 @@ .movies.mass_edit_list .movie .data { height: 30px; padding: 3px 0 3px 10px; - width: 938px; box-shadow: none; border: 0; background: #4e5969; @@ -197,27 +227,36 @@ .movies .info { position: relative; height: 100%; + width: 100%; } .movies .info .title { - display: inline; - position: absolute; font-size: 28px; font-weight: bold; margin-bottom: 10px; + margin-top: 2px; left: 0; top: 0; - width: 90%; + width: 100%; + padding-right: 80px; transition: all 0.2s linear; } + .movies .info .title span { + display: block; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + width: 100%; + height: 30px; + line-height: 30px; + top: -5px; + position: relative; + } .movies.list_list .movie:not(.details_view) .info .title, .movies.mass_edit_list .info .title { font-size: 16px; font-weight: normal; - text-overflow: ellipsis; width: auto; - overflow: hidden; - } .movies.thumbs_list .movie:not(.no_thumbnail) .info { @@ -229,25 +268,22 @@ .movies.thumbs_list .info .title { font-size: 21px; - text-shadow: 0 0 10px #000; word-wrap: break-word; + padding: 0; } .movies .info .year { position: absolute; - font-size: 30px; - margin-bottom: 10px; color: #bbb; - width: 10%; right: 0; - top: 0; + top: 1px; text-align: right; transition: all 0.2s linear; + font-weight: normal; } .movies.list_list .movie:not(.details_view) .info .year, .movies.mass_edit_list .info .year { - font-size: 16px; - width: 6%; + font-size: 1.25em; right: 10px; } @@ -259,16 +295,14 @@ top: auto; right: auto; color: #FFF; - text-shadow: none; - text-shadow: 0 0 6px #000; } .movies .info .description { - position: absolute; top: 30px; clear: both; - height: 80px; + bottom: 30px; overflow: hidden; + position: absolute; } .movies .data:hover .description { overflow: auto; @@ -281,12 +315,17 @@ .movies .data .quality { position: absolute; - bottom: 0; + bottom: 2px; display: block; min-height: 20px; - vertical-align: mid; } + @media all and (max-width: 480px) { + .movies .data .quality { + display: none; + } + } + .movies .status_suggest .data .quality, .movies.thumbs_list .data .quality { display: none; @@ -302,9 +341,8 @@ vertical-align: middle; display: inline-block; text-transform: uppercase; - text-shadow: none; font-weight: normal; - margin: 0 2px; + margin: 0 4px 0 0; border-radius: 2px; background-color: rgba(255,255,255,0.1); } @@ -312,7 +350,7 @@ .movies.mass_edit_list .data .quality { text-align: right; right: 0; - margin-right: 50px; + margin-right: 60px; z-index: 1; } @@ -342,8 +380,32 @@ bottom: 20px; right: 20px; line-height: 0; - margin-top: -25px; + top: 0; + opacity: 0; + display: none; + width: 0; } + @media all and (max-width: 480px) { + .movies .data .actions { + display: none !important; + } + } + + .movies .movie:hover .data .actions { + opacity: 1; + display: inline-block; + width: auto; + } + + .movies.details_list .data .actions { + top: auto; + bottom: 18px; + } + + .movies .movie:hover .actions { + opacity: 1; + display: inline-block; + } .movies.thumbs_list .data .actions { bottom: 8px; right: 10px; @@ -362,7 +424,6 @@ width: 26px; height: 26px; padding: 3px; - opacity: 0; } .movies.list_list .movie:not(.details_view):hover .actions, @@ -399,7 +460,6 @@ .movies .options { position: absolute; - margin-left: 120px; width: 840px; } @@ -423,7 +483,6 @@ .movies .options .table .item.ignored span { text-decoration: line-through; color: rgba(255,255,255,0.4); - text-shadow: none; } .movies .options .table .item.ignored .delete { background-image: url('../images/icon.undo.png'); @@ -491,6 +550,9 @@ text-align: center; transition: all .6s cubic-bezier(0.9,0,0.1,1); overflow: hidden; + left: 0; + position: absolute; + z-index: 10; } .movies .movie .trailer_container.hide { height: 0 !important; @@ -507,6 +569,7 @@ background: #4e5969; border-radius: 0 0 2px 2px; transition: all .2s cubic-bezier(0.9,0,0.1,1) .2s; + z-index: 11; } .movies .movie .hide_trailer.hide { top: -30px; @@ -543,11 +606,13 @@ right: 135px; z-index: 2; opacity: 0; - text-shadow: none; background: #4e5969; min-width: 300px; text-align: right; + height: 100%; + padding: 3px 0; } + .movies.mass_edit_list .trynext { display: none; } .wanted .movies .movie .trynext { padding-right: 50px; } @@ -555,6 +620,14 @@ opacity: 1; } + .movies.details_list .movie .trynext { + background: #47515f; + padding: 0; + right: 0; + bottom: 35px; + height: auto; + } + .movies .movie .trynext a { background-position: 5px center; padding: 0 5px 0 25px; @@ -562,6 +635,9 @@ color: #FFF; border-radius: 2px; } + .movies .movie .trynext a:last-child { + margin: 0; + } .movies .movie .trynext a:hover { background-color: #369545; } @@ -578,24 +654,33 @@ .movies .alph_nav { transition: box-shadow .4s linear; - position: fixed; + position: relative; z-index: 4; - top: 0; - padding: 100px 60px 7px; - width: 1080px; - margin: 0 -60px; - box-shadow: 0 20px 20px -22px rgba(0,0,0,0.1); - background: #4e5969; + top: 0px; + height: 45px; + right: 0; + margin: 0 auto; + width: 100%; + padding: 10px 0; } - .movies .alph_nav.float { - box-shadow: 0 30px 30px -32px rgba(0,0,0,0.5); - border-radius: 0; + @media all and (max-width: 480px) { + .movies .alph_nav { + display: none; + } } -.movies .alph_nav ul.numbers, + .movies .alph_nav > div { + position: relative; + max-width: 980px; + height: 45px; + margin: 0 auto; + padding: 0; + } + +.movies .alph_nav .numbers, .movies .alph_nav .counter, -.movies .alph_nav ul.actions { +.movies .alph_nav .actions { list-style: none; padding: 0 0 1px; margin: 0; @@ -604,49 +689,62 @@ } .movies .alph_nav .counter { - width: 60px; - text-align: center; + text-align: right; + position: absolute; + right: 270px; + background: #4e5969; + padding: 4px 10px; } .movies .alph_nav .numbers li, .movies .alph_nav .actions li { display: inline-block; vertical-align: top; - width: 20px; height: 24px; - line-height: 26px; + line-height: 23px; text-align: center; cursor: pointer; color: rgba(255,255,255,0.2); border: 1px solid transparent; transition: all 0.1s ease-in-out; - text-shadow: none; } - .movies .alph_nav .numbers li:first-child { - width: 43px; - } + + @media all and (max-width: 900px) { + .movies .alph_nav .numbers { + display: none; + } + } + + .movies .alph_nav .numbers li { + width: auto; + padding: 0 4px; + } + .movies .alph_nav li.available { - color: rgba(255,255,255,0.8); + color: #FFF; font-weight: bolder; } - .movies .alph_nav li.active.available, .movies .alph_nav li.available:hover { - color: #fff; - font-size: 20px; - line-height: 20px; + .movies .alph_nav li.active.available, + .movies .alph_nav li.available:hover { + background: rgba(255,255,255,.1); } - .movies .alph_nav input { + .movies .alph_nav .search { padding: 6px 5px; - margin: 0 0 0 6px; - float: left; - width: 155px; + margin: 0 0 0 20px; + position: absolute; + right: 30px; + width: 154px; height: 25px; + transition: all 0.6s cubic-bezier(0.9,0,0.1,1); } .movies .alph_nav .actions { margin: 0 6px 0 0; -moz-user-select: none; + position: absolute; + right: 183px; } .movies .alph_nav .actions li { border-radius: 1px; @@ -730,10 +828,12 @@ } .movies .alph_nav .more_menu { - margin-left: 48px; + right: 0; + position: absolute; } .movies .alph_nav .more_menu > a { + background-color: #4e5969; background-position: center -158px; } @@ -790,7 +890,6 @@ font-weight: bold; display: inline-block; text-transform: uppercase; - text-shadow: none; font-weight: normal; font-size: 20px; border-left: 1px solid rgba(255, 255, 255, .2); diff --git a/couchpotato/core/plugins/movie/static/movie.js b/couchpotato/core/plugins/movie/static/movie.js index ffdd14d1..4f903226 100644 --- a/couchpotato/core/plugins/movie/static/movie.js +++ b/couchpotato/core/plugins/movie/static/movie.js @@ -126,12 +126,14 @@ var Movie = new Class({ self.thumbnail = File.Select.single('poster', self.data.library.files), self.data_container = new Element('div.data.inlay.light').adopt( self.info_container = new Element('div.info').adopt( - self.title = new Element('div.title', { - 'text': self.getTitle() || 'n/a' - }), - self.year = new Element('div.year', { - 'text': self.data.library.year || 'n/a' - }), + new Element('div.title').adopt( + self.title = new Element('span', { + 'text': self.getTitle() || 'n/a' + }), + self.year = new Element('div.year', { + 'text': self.data.library.year || 'n/a' + }) + ), self.rating = new Element('div.rating.icon', { 'text': self.data.library.rating }), diff --git a/couchpotato/core/plugins/movie/static/search.css b/couchpotato/core/plugins/movie/static/search.css index 23d87b46..e03c6461 100644 --- a/couchpotato/core/plugins/movie/static/search.css +++ b/couchpotato/core/plugins/movie/static/search.css @@ -1,105 +1,143 @@ .search_form { display: inline-block; vertical-align: middle; - width: 25%; + position: absolute; + right: 105px; + top: 0; + text-align: right; + height: 100%; + border-bottom: 4px solid transparent; + transition: all .4s cubic-bezier(0.9,0,0.1,1); + position: absolute; + z-index: 20; + border: 1px solid transparent; + border-width: 0 0 4px; } - - .search_form input { - padding: 4px 20px 4px 4px; - margin: 0; - font-size: 14px; - width: 100%; - height: 24px; + .search_form:hover { + border-color: #047792; } - .search_form input:focus { - padding-right: 83px; + + @media all and (max-width: 480px) { + .search_form { + right: 44px; + } + } + + .search_form.focused, + .search_form.shown { + border-color: #04bce6; + } + + .search_form .input { + height: 100%; + overflow: hidden; + width: 45px; + transition: all .4s cubic-bezier(0.9,0,0.1,1); + } + + .search_form.focused .input, + .search_form.shown .input { + width: 380px; + background: #4e5969; } - .search_form .input .enter { - background: #369545 url('../images/sprite.png') right -188px no-repeat; - padding: 0 20px 0 4px; - border-radius: 2px; - text-transform: uppercase; - font-size: 10px; - margin-left: -78px; - display: inline-block; - opacity: 0; - position: relative; - top: -2px; - cursor: pointer; - vertical-align: middle; - visibility: hidden; - } - .search_form.focused .input .enter { - visibility: visible; + .search_form .input input { + border-radius: 0; + display: block; + width: 100%; + border: 0; + background: rgba(255,255,255,.08); + color: #FFF; + font-size: 25px; + height: 100%; + padding: 10px; + width: 100%; + opacity: 0; + padding: 0 40px 0 10px; + transition: all .4s ease-in-out .2s; } - .search_form.focused.filled .input .enter { - opacity: 1; + .search_form.focused .input input, + .search_form.shown .input input { + opacity: 1; + } + + @media all and (max-width: 480px) { + .search_form .input input { + font-size: 15px; + } + + .search_form.focused .input, + .search_form.shown .input { + width: 277px; + } } - - .search_form .input a { - width: 17px; - height: 20px; - display: inline-block; - margin: -2px 0 0 2px; - top: 4px; - right: 5px; - background: url('../images/sprite.png') left -37px no-repeat; - cursor: pointer; - opacity: 0; - transition: all 0.2s ease-in-out; - vertical-align: middle; + + .search_form .input a { + position: absolute; + top: 0; + right: 0; + width: 44px; + height: 100%; + cursor: pointer; + vertical-align: middle; + text-align: center; + line-height: 66px; + font-size: 15px; + color: #FFF; + } + + .search_form .input a:after { + content: "\e03e"; } - .search_form.filled .input a { - opacity: 1; + .search_form.shown.filled .input a:after { + content: "\e04e"; + } + + @media all and (max-width: 480px) { + .search_form .input a { + line-height: 44px; + } } .search_form .results_container { + text-align: left; position: absolute; background: #5c697b; - margin: 6px 0 0 -230px; + margin: 4px 0 0; width: 470px; min-height: 140px; - border-radius: 3px; box-shadow: 0 20px 20px -10px rgba(0,0,0,0.55); display: none; } + @media all and (max-width: 480px) { + .search_form .results_container { + width: 320px; + } + } + .search_form.focused.filled .results_container, .search_form.shown.filled .results_container { display: block; } - .search_form .results_container:before { - content: ' '; - height: 0; - position: relative; - width: 0; - border: 10px solid transparent; - border-bottom-color: #5c697b; - display: block; - top: -20px; - left: 346px; - } - .search_form .results { max-height: 570px; overflow-x: hidden; - padding: 10px 0; - margin-top: -18px; } .movie_result { overflow: hidden; - height: 140px; + height: 50px; position: relative; } .movie_result .options { position: absolute; height: 100%; - width: 100%; top: 0; - left: 0; + left: 30px; + right: 0; + padding: 13px; border: 1px solid transparent; border-width: 1px 0; border-radius: 0; @@ -107,7 +145,6 @@ } .movie_result .options > div { - padding: 0 15px; border: 0; } @@ -122,6 +159,13 @@ } .movie_result .options select[name=title] { width: 180px; } .movie_result .options select[name=profile] { width: 90px; } + + @media all and (max-width: 480px) { + + .movie_result .options select[name=title] { width: 90px; } + .movie_result .options select[name=profile] { width: 60px; } + + } .movie_result .options .button { vertical-align: middle; @@ -130,25 +174,21 @@ .movie_result .options .message { height: 100%; - line-height: 140px; font-size: 20px; - text-align: center; color: #fff; + line-height: 20px; } .movie_result .data { - padding: 0 15px; position: absolute; height: 100%; - width: 100%; top: 0; - left: 0; + left: 30px; + right: 0; background: #5c697b; cursor: pointer; - - border-bottom: 1px solid #333; - border-top: 1px solid rgba(255,255,255, 0.15); - transition: all .6s cubic-bezier(0.9,0,0.1,1); + border-top: 1px solid rgba(255,255,255, 0.08); + transition: all .4s cubic-bezier(0.9,0,0.1,1); } .movie_result .data.open { left: 100%; @@ -162,49 +202,40 @@ } .movie_result .thumbnail { - width: 17%; - display: inline-block; - margin: 15px 3% 15px 0; + width: 34px; + min-height: 100%; + display: block; + margin: 0; vertical-align: top; - border-radius: 3px; - box-shadow: 0 0 3px rgba(0,0,0,0.35); } .movie_result .info { - width: 80%; - display: inline-block; - vertical-align: top; - padding: 15px 0; - height: 120px; - overflow: hidden; - } - - .movie_result .info .tagline { - max-height: 70px; - overflow: hidden; - display: inline-block; - } - - .movie_result .add +.info { - margin-left: 20%; + position: absolute; + top: 20%; + left: 15px; + right: 60px; + vertical-align: middle; } .movie_result .info h2 { + font-weight: normal; + font-size: 20px; + display: block; margin: 0; - font-size: 17px; - line-height: 20px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + width: 100%; } .movie_result .info h2 span { padding: 0 5px; + position: absolute; + right: -60px; } - .movie_result .info h2 span:before { content: "("; } - .movie_result .info h2 span:after { content: ")"; } - .search_form .mask, .movie_result .mask { - border-radius: 3px; position: absolute; height: 100%; width: 100%; diff --git a/couchpotato/core/plugins/movie/static/search.js b/couchpotato/core/plugins/movie/static/search.js index dd8e7b04..334f8554 100644 --- a/couchpotato/core/plugins/movie/static/search.js +++ b/couchpotato/core/plugins/movie/static/search.js @@ -7,33 +7,30 @@ Block.Search = new Class({ create: function(){ var self = this; + var focus_timer = 0; self.el = new Element('div.search_form').adopt( new Element('div.input').adopt( - self.input = new Element('input.inlay', { + self.input = new Element('input', { 'placeholder': 'Search & add a new movie', 'events': { 'keyup': self.keyup.bind(self), 'focus': function(){ + if(focus_timer) clearTimeout(focus_timer); self.el.addClass('focused') if(this.get('value')) self.hideResults(false) }, 'blur': function(){ - (function(){ + focus_timer = (function(){ self.el.removeClass('focused') - }).delay(2000); + }).delay(100); } } }), - new Element('span.enter', { + new Element('a.icon2', { 'events': { - 'click': self.keyup.bind(self) - }, - 'text':'Enter' - }), - new Element('a', { - 'events': { - 'click': self.clear.bind(self) + 'click': self.clear.bind(self), + 'touchend': self.clear.bind(self) } }) ), @@ -59,13 +56,21 @@ Block.Search = new Class({ var self = this; (e).preventDefault(); - self.last_q = ''; - self.input.set('value', ''); - self.input.focus() + if(self.last_q === ''){ + self.input.blur() + self.last_q = null; + } + else { - self.movies = [] - self.results.empty() - self.el.removeClass('filled') + self.last_q = ''; + self.input.set('value', ''); + self.input.focus() + + self.movies = [] + self.results.empty() + self.el.removeClass('filled') + + } }, hideResults: function(bool){ @@ -92,8 +97,10 @@ Block.Search = new Class({ self.el[self.q() ? 'addClass' : 'removeClass']('filled') - if(self.q() != self.last_q && (['enter'].indexOf(e.key) > -1 || e.type == 'click')) - self.autocomplete() + if(self.q() != self.last_q){ + if(self.autocomplete_timer) clearTimeout(self.autocomplete_timer) + self.autocomplete_timer = self.autocomplete.delay(300, self) + } }, @@ -197,6 +204,11 @@ Block.Search.Item = new Class({ self.el = new Element('div.movie_result', { 'id': info.imdb }).adopt( + self.thumbnail = info.images && info.images.poster.length > 0 ? new Element('img.thumbnail', { + 'src': info.images.poster[0], + 'height': null, + 'width': null + }) : null, self.options_el = new Element('div.options.inlay'), self.data_container = new Element('div.data', { 'tween': { @@ -207,11 +219,6 @@ Block.Search.Item = new Class({ 'click': self.showOptions.bind(self) } }).adopt( - self.thumbnail = info.images && info.images.poster.length > 0 ? new Element('img.thumbnail', { - 'src': info.images.poster[0], - 'height': null, - 'width': null - }) : null, new Element('div.info').adopt( self.title = new Element('h2', { 'text': info.titles[0] @@ -219,28 +226,11 @@ Block.Search.Item = new Class({ self.year = info.year ? new Element('span.year', { 'text': info.year }) : null - ), - self.tagline = new Element('span.tagline', { - 'text': info.tagline ? info.tagline : info.plot, - 'title': info.tagline ? info.tagline : info.plot - }), - self.director = self.info.director ? new Element('span.director', { - 'text': 'Director:' + info.director - }) : null, - self.starring = info.actors ? new Element('span.actors', { - 'text': 'Starring:' - }) : null + ) ) ) ) - if(info.actors){ - Object.each(info.actors, function(actor){ - new Element('span', { - 'text': actor - }).inject(self.starring) - }) - } info.titles.each(function(title){ self.alternativeTitle({ @@ -320,11 +310,6 @@ Block.Search.Item = new Class({ self.options_el.grab( new Element('div').adopt( - self.thumbnail = (info.images && info.images.poster.length > 0) ? new Element('img.thumbnail', { - 'src': info.images.poster[0], - 'height': null, - 'width': null - }) : null, self.info.in_wanted && self.info.in_wanted.profile ? new Element('span.in_wanted', { 'text': 'Already in wanted list: ' + self.info.in_wanted.profile.label }) : (in_library ? new Element('span.in_library', { diff --git a/couchpotato/static/fonts/Elusive-Icons.eot b/couchpotato/static/fonts/Elusive-Icons.eot new file mode 100755 index 0000000000000000000000000000000000000000..282e60896c89e5e148bfcabd7598bb19288e7179 GIT binary patch literal 41988 zcmdqKcbpv6nKoLdsw;O@$Li{wyK8djp6;GJqZ~#F&wP;!Go^jXDc*0E3>kS|DT-iuFb`CRhn6sGk zne&)4m_5wtOgpoHIgL4&IR_~Wqa1e^U{)i?N9?>bN0RAgI+!lx`^Tjq18tjzc5uwH zxpP-8-ZpQ}5r+9JeKk67_MEw7F(crfwmG?UMQ5S&r$5TzrM0+UecIWZcNQhsvp4VEN%k;r<9RRgC(qe@ z_USvm`=t(sx#c~ieQoEt=k304S>Zv3`4sZ23+=w4e^>T=uwj#H@Q;jIo15=m@x9%6 zpP}cYuN{4yWy#NRE7hkCMd9z~M;~W8Smx+!Rfc8llISb-4@ug2lFY9d+HyMG^esA; zqxjJeAxFuL49`ep5!s6SdG+%jnGkcuboii|>F_o_%eKzh!i-KbzhlVc(MhHQZCfxw zOSeC@9^mqGwMyyz-}!~>>E08b@2lUF6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eP#Y{xe~^bI~g^Zsug>YV=@kH&p! literal 0 HcmV?d00001 diff --git a/couchpotato/static/fonts/Elusive-Icons.svg b/couchpotato/static/fonts/Elusive-Icons.svg new file mode 100755 index 00000000..bfc6c9b7 --- /dev/null +++ b/couchpotato/static/fonts/Elusive-Icons.svg @@ -0,0 +1,298 @@ + + + + +This is a custom SVG font generated by IcoMoon. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/couchpotato/static/fonts/Elusive-Icons.ttf b/couchpotato/static/fonts/Elusive-Icons.ttf new file mode 100755 index 0000000000000000000000000000000000000000..ae31768fb97f214499b6bc2445cd84d7e0b34e35 GIT binary patch literal 41804 zcmdqKcbr?*nLm8ay}C_Tx~f-Ky-Rm`kw((=8TT@7xEHX;U~FTW9gK0PgF_sODIwqx zTD*icY?cxN0fzvgq>_Xs3rk2g2?I$;LV%Pd2}}6N@Aq6uy<{goO|x6 z&w2WJhEPI?lS~kvESo!b<>GDg<{Tm9b6rS{&YL}FE?rDS+`Dm~T)LvO(D}0;X9%Hd zaliVsvp4T7%I2$th{(@hy>0V(JC7bkN#t`fp3B?L`smg_W!L|a5C?9rdT;ybo40(( z{p@nw{20ITb|mn>BY2Mq&$`gceGtb_< zcPHIL-p2D@e0tIj{XAoGO0bb-l4xZ`WWfp$kA7;gyXD|*emr9O|ldm ze@$4+(K!65m1~sU;zQ|CdIJ%NOc&9uxSv-)|B-~q73>88Len zdw=@1JT0A-(P(etg!I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(#6=R8alNw2xI=fCM*XpQ)Yodm`_0`_huF_6hSE}t$hp3gjF<+h@Z)723GmWiEAz z)-HCD3$=2AmRdMpj%-y`k)^UqD#}zrhVz{39CvB1nWmaJTVrQA(-|5$-Dy!#dF2uX z$|O6cOG~s#iO7r!krCyiT$GJ6Q99BiElNcyA`zp=0sHN<*B-n5<8MFv$!42uw80vE zd~UT>KC?(~cUtH@?|Q>DuY1j_rkda>PkO?5=de~TFJmf*64Kq}M`wcPJAOj81-=F?SKJ|Cs z`PMhqTW*=9J~q!==9=RrFM7fA9`~3>J>oCB?6kv=3KKhg?^7#%Vuc0X@wWMCtfFj6%Q4Ro=as|f#004NLV`5-nV8V~3ptKO0coURn#G{uDj~p`;c2gE!W51I08 z9Le)$9CO8o@rbdzlhZ{P>P-5njt5*aGamB9qj4n9t8vT?@5Uo0E@s7n6D<{IN)k5g z2-NDZI-J_-Tqc`cs8xPbth4UxW1k!Ln)ei>WXem$@4LVBg?e*Ep^2P(Ee!Q>9h!aV zi!}2~|KkGHi)5Y@SuW?_&)!OJdS|D5ebgPuwrtue)ILwMe{A~%g1krQ004NLV_;^$ J3jhFp00dF8bEyCT literal 0 HcmV?d00001 diff --git a/couchpotato/static/fonts/OpenSans-Bold-webfont.eot b/couchpotato/static/fonts/OpenSans-Bold-webfont.eot new file mode 100755 index 0000000000000000000000000000000000000000..e1c7674430d0dc4eb95a461948412adcd3194385 GIT binary patch literal 21190 zcmbt+3w%`7wfElVoOw?s^UP%OoXI4Fn1mrSgft)!5CH>3h!_J#D#-@U)@63*=N-g~dT z_Imu++UL1u#{AeglNkMz99FYzQY1;?Y_B*qX51->9lbKl8hVR682c4xVcP8oU3EBp zsz>2vm$Lb62D=_NUB;%OT!gDuHjK?<*Rgi&=du=DUx@RwagOe*VSTXm#kGR(c{<$V zS=_?0x$&bgHe$qtu~$Fx^gnUZNe_=4e(?yFWHOGavEfTEi^Vt2z3oCAkHYbk>2s&f zKXYXj9dE_<;`AF9hi$rZIAii+TrZ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*hXQiOP9mwetH(it(i@JotZ7wY^Di0%cd!8w<*Mynoh9Y%5rS&IDUyO zMJ#f+w1u{=S*CF~znbl~+{1R8S7Mut`_1Wc6t2x;la-CE!t7)_=$lgLJ2GoPVIA8> zR)hDfLz|r_6Us1Vl^eS{lq1mRZ?YDXn{7}ESsThWWe;nUL#zUInN7pk25A9%P+HKn zLitAQZ?GI;8|b|9mAHQcJtJ>q8|1Snm$4YGJ*wOXBplSLr;Z1&3h>C zxqNeezx>DYcNdfvOvB&Hh4I3Niux5b7j+c(`hmaU#nXy!D_&o$7XLlW!o$ONhEox@ z_*-96Qqot;mA{e^g%e(8P2 zhw%D*&&TgFpUqo}=cb|0^ufHv-*aEM`y+Wj^l`n+XZbQ8<*V*~Vggz}8=vC~cfTJC zAJ8s3a}Daf9-Gllg9g*k>o8g|OY~(#x=r-CzXfaw-n0;ZGtg7&b8=q9~0vf2iDUM{#bt?hd)BRd;nHUUWgo=!B{uf0L~kR zF&fS;W+TvtQHU@%Vzt*8*gj35{WvzBHKVr^@coGv%>7n25!o77vNq(XJ4~q;f(gFi)I;@;v + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/couchpotato/static/fonts/OpenSans-Bold-webfont.ttf b/couchpotato/static/fonts/OpenSans-Bold-webfont.ttf new file mode 100755 index 0000000000000000000000000000000000000000..2d94f0629db751b8412a814df98fbe82f6fdd1df GIT binary patch literal 21012 zcmbt+3w#vS+4ng!v$NN1_L|M+x|>Z1F$p2Ngft)!5CH>3h!_J#J=fGeE;XnZlwL%?|pyYOPHO@&dhnv zbDr~D{?BukamJVj9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8=TW=(8AX6(JdJ>1KEY%TX&7S5X1t=sk8;>Uh;EbG=ylyNMLm&@YENc`A6ek_k4 zd&G|w@#8h|V`cn!y>Tp!zqhp1K6Tn%3+GLlJaK-lajR^AaV#I8^j|n{HWm7#9tU}Q zgUZ*j8&&J@YDD%P8KVuLwR2S$7T)!Zz{!1Mva!(ZxN3%^nEt9<*iUr?`$v^C60&Jf zNJ7DJU%X&PA*niEu%TeTE?%&rVCxnySWvL$#tUW?EED4e6AEU3ypSC1e~2ldW4!Fd z&1A1pK$c0oHa>bP1$`tT4l-a7s^rCUzBQMM9u&PdUn;s$^b}qyx=?iITq^p-+v?jd fzb$|V{BK=)AQi>H*h|GU6jM7ViepqC=92$E2pMcV literal 0 HcmV?d00001 diff --git a/couchpotato/static/fonts/OpenSans-Italic-webfont.svg b/couchpotato/static/fonts/OpenSans-Italic-webfont.svg new file mode 100755 index 00000000..29c7497f --- /dev/null +++ b/couchpotato/static/fonts/OpenSans-Italic-webfont.svg @@ -0,0 +1,146 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/couchpotato/static/fonts/OpenSans-Italic-webfont.ttf b/couchpotato/static/fonts/OpenSans-Italic-webfont.ttf new file mode 100755 index 0000000000000000000000000000000000000000..63f187e984b225756e2030556c4465eeaf8724e5 GIT binary patch literal 23680 zcmbun33wDm`afRP-E(F#nJbf<%w$LcCM1v{#0Ww}ZV?d?0wO{<49Fq(WsHaswk z7_(;MXuosDlBqUNaTUrP8N2bfwNoZe{_%mA${4%l0`B*y#Rd1DE!Q$OvOCHhYiG`1 z{I8}6YC5tS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zm*RyeKJo1uvvE{6e ztwvqiDt0dxHJP{>*0~j>7Af40#Fmr0P(9*C03psA*&g;hzI?SCU&4BZdr=kRXKQ%C zGH?3Su3h_fP44^CKH9abXk%ZVY)6y(SaRPjxvxm>yC?UR$$gLHzACxzYwXLD?=3G+ znKJc;d9x=^8b7DjxD>51_7yeCfO)fLP-6hbv6r7)uJU`?WvX@PNR9KgqqG|O#+K^F z2fF;jaB%0S9DERK%t*-V&;V5~?yovS1LDdF2_XeE9B4QnN;d3hI7TKLDQMUSCmS|2 zQhFsDRy1r~lMM?R*8F6{jD}@MvSC8Q97r}?Xed6Tf%RX>p#(z%_OVnDNJ7xH<`#@6 z4fh4FYi|b7Osi~f`q2y&w>N!g`t#bGUNn6t+nXLVy(`^2nu literal 0 HcmV?d00001 diff --git a/couchpotato/static/fonts/OpenSans-Regular-webfont.svg b/couchpotato/static/fonts/OpenSans-Regular-webfont.svg new file mode 100755 index 00000000..01038bb1 --- /dev/null +++ b/couchpotato/static/fonts/OpenSans-Regular-webfont.svg @@ -0,0 +1,146 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/couchpotato/static/fonts/OpenSans-Regular-webfont.ttf b/couchpotato/static/fonts/OpenSans-Regular-webfont.ttf new file mode 100755 index 0000000000000000000000000000000000000000..05951e7b36b2352b1a69e2052d08fbffd77d5151 GIT binary patch literal 20688 zcmc(Hd3+Q_`gc`#&y~zfrsv4y&P;|RKte)h2q7Y;T;c&DVn7zT4R|1z3Wx}ZatQ(& z0r5hN7!kWC10stEc!7$DN03z)cXf5Mx-7b`XVSdir+O05*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)SA6&e^Dn% literal 0 HcmV?d00001 diff --git a/couchpotato/static/fonts/OpenSans-Regular-webfont.woff b/couchpotato/static/fonts/OpenSans-Regular-webfont.woff new file mode 100755 index 0000000000000000000000000000000000000000..274664b28e8ed522cf1753f933ca085d8c8cc330 GIT binary patch literal 13988 zcmY*=b8sfj8|@q0&c?QF+qUy28*gme*jO8EoQ-YUwrxAP`F{8QbGz!)^f`T=erjr_ zYpS}RaZ{9#0Du6#8%H4k`M;~u^#A4m_5c4SA)zJ@0D#zht3SShXPDATB`GE@@vVh_ zbNp`*0crtYimHq(-&)Bx*Z+o59)~ZssjaaC000X8tz&&-^jVjV&(zhK2mk>420-XP zzycA#lj#STBY+>y59Sec}?fH)XACN6RC9sod_0RV_VYYC@y zS(+Q00RT+R-yYU)aJ(y2_F8_6-`e>%C;SE(QVztTrLD6&0Kg3Yog?Tw2Rh0kGlGr1 z>9>z1{@e5Zt;6S6)W6yqyMO0pjsDh%{sTw}NV}b}t@*cB@y#E;eVyc7Ldp*IPR;-T zTj4jS`o=gbBEyM;qxp9%`}ntS`CIcIHo~NHUo|x{GBN`MCS|{b61}pm&B{>e!vO^H zAQl1tjhPu4ZG)M>Kq4EN0B&^s$>7q4005X1K;!o$|BVBUjkCJDN4vXuq88Eu0+b0v zSPjjjOy7rl`uisa2ggTy`}=SG15P@?f<)NBz=9x=S+RK_d07Dv1WeTKs=D-&^cv}B@+#t~SfkCCA zYJX$qK9$g9_%rNADhKLtDk+*_8Y=1%>SNk|+6rYg&+h9lL8T5*r45qm)&?OLcvw(a zR9Ked(@()qzvHi-FR0I}kFK+?MJR0~6+$w8DR<;MqFdo@u)l9hmy|U1LK~vsMrNk| zv_LaZRJmhVe*-gPbJL^k{oTWzgFP%{bW}_f47Akv--#&+$w`_@YAPDa>Z(iA^RtUH z3v--IY%Cni?5s`I^|g&P4Rvk~&W^6XT%4Y+?{6P(9`2B!;b9SB5a8m%qa$M@VxknK z$a<4UsJofWhNY}0gChz}R5fzJi)d)9t;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Q|ut;zOQ$G`FG|M0t znpnD7B=#>PMP|)4j9G*5s99=$x{1KAH zbYB&pY)b?&MuymaK`>oUkFusV74;)Qvuz~R0wK?!&JiIZM}c++VVogVc>`qH@Bca% zw$}D5R#-TRYQ2!ckA_*Pqf$P_rZkn6^eG!eyFKJ;{FO@A5e+W`MV$T`B_r&v@b&i| zO#F|t3A(>Y|1emHy#(U0ABznUr(${g`$D literal 0 HcmV?d00001 diff --git a/couchpotato/static/images/sprite.png b/couchpotato/static/images/sprite.png index 782229f0cac959a99925d90229ffbd54c26f02eb..0ef3041378b9e5ebca228110d8bb48593c600054 100644 GIT binary patch literal 2759 zcmV;&3OMzNP)gMhaZ72z=`<;X#sq=~3YdqfO*(@h zUtVemThjIa^dd*AK9yZ8UQ|E@%k zBq{5!AeZ%Hcyh^P*k-+GH^O3TTkCLnG+3cW96cp#Xw*-zJ6u;CF0ZG$=8LtE71J9s z!qnXIirwM1TkTH!x!emYA#XT9*;6v&p}FPlR+}SaYOy*FA33%H@)EIDc#n^aFc{5S zP0f}|mG`Q?PIppclks;Cn=PdNVRPWakB+Wp5;5Cd$*O_EW^Ypt8#e5P5s8Vnb+vUH z2|_+eMiB4#e15X({=J>Q-1O=VDCYunAWxU-)3qXq$V-qs{!DJ(n$+p)zbF+772GF- zp^(CCG96pGaQ;rX-v(%B5wU#ri?Pa1WEpPw1%?VSdldC|3PmGd<9W$$X6?7(dQ+xU^xEfbbDP0h#$J7xuOzf z>R5wTZZfwXu-KhstJM(!7!eZk-e*^U`8>fSVYJy`gQ?XL3Wwvu;czFrTrN|{<*uia zM~;MKfUC{;w1(2{@es(vR8hc3>$yPG-eiV{Mq^%le8SJ@7h|QJ4*NfP(*eQs9oyb% z((6yVp^6BIpW43ltzCGJ*SPYunVd2n@qkz=&kJw@e1I@loAHs+go7AO5u|Kom~YSu zkv*YbK%YPKzN&6XIre;b^r&WTub=3tn1spPGRNid6<6tM$IzK2W#tK>P^hrQVtbiu zj>e}P70nh~p55stEp|us&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f5Vi%H5-+4P5+fXQ!*+2-T zqS;Bc)o=Z!OP5&40=N#habUoPyu7?}Gz}cXbs)yPm7kwqfe1K{V<5ZPR9swKjfL}| z$L1ZQC=|+n12hd1vx-$SNDgC}HLS2EtAA$G^EpM=kTo$do69+SOb(mt=~+#^UOzTx zt2s6{rk|VDBxcXZYEmfwE07&n{dHn0I!roDI!p?M^6cRRuQ!l2Ra8|kvenF^RUks# zHsK?M>oSiX3$pb{+5@y06ly`ZZh@_4PQ=j5f^eO)1BF6)(%boOKwMBh$b;#{FMon| zfc!yTQmM2Z0Xm&-L@X9ZLe?F$6|{ObBfrtn(Gmo}AOBaz$H()K8BkYeFc^NCnwlDi zda+f*va+((GMQ`;nE@9+0MO**AutfhG|lBO`+a zRWYCiIK^cIn1&2(2O(cN!%QR+wW4W6Mn=Y)x4~ru;5js*R;#r$%+8!SbE~PTNex{$ zAc9JzN;GeS%cgmQ9zEdm`MRQ_B9X%*hzEV2m6g?r2uh_=0LgC9LYx}Q1b+^PqY4fV zz5v%8u(SxCRaI3tkPQfhLTPDfX{3WC;BMax-Jd`dtkWZTrO9Wn3$O2U1g#SU6*N1;$Cl&29y zm~+!Py8r=TUsok|} z*B)Fp#tAGItHImbdwQLv7k=B}5Vs0?`G6Q!q^GBcLOd!nGcyF25nuqwxAC{m_Ro%+ zUlW*e(f)e-d-+vJfcG -1){ + self.nav.grab( + new Element('li').grab(el.clone().cloneEvents(el)) + ); + } + }); + + self.added = true; + } + + html.toggleClass('menu_shown'); + + }, + activate: function(name){ var self = this; diff --git a/couchpotato/static/scripts/couchpotato.js b/couchpotato/static/scripts/couchpotato.js index d2e8fa00..5a7dbfba 100644 --- a/couchpotato/static/scripts/couchpotato.js +++ b/couchpotato/static/scripts/couchpotato.js @@ -61,7 +61,7 @@ var CouchPotato = new Class({ new Element('div').adopt( self.block.navigation = new Block.Navigation(self, {}), self.block.search = new Block.Search(self, {}), - self.block.more = new Block.Menu(self, {}) + self.block.more = new Block.Menu(self, {'button_class': 'icon2.cog'}) ) ), self.content = new Element('div.content'), diff --git a/couchpotato/static/scripts/library/question.js b/couchpotato/static/scripts/library/question.js index cab63465..ed53b391 100644 --- a/couchpotato/static/scripts/library/question.js +++ b/couchpotato/static/scripts/library/question.js @@ -7,36 +7,24 @@ var Question = new Class( { self.hint = hint self.answers = answers - self.createQuestion() + self.createQuestion(); self.answers.each(function(answer) { self.createAnswer(answer) }) - self.createMask() }, - createMask : function() { - var self = this - - self.mask = new Element('div.mask').fade('hide').inject(document.body).fade('in'); - }, - createQuestion : function() { + var self = this; - this.container = new Element('div', { - 'class' : 'question' - }).adopt( + self.container = new Element('div.mask.question').adopt( new Element('h3', { 'html': this.question }), new Element('div.hint', { 'html': this.hint }) - ).inject(document.body) - - this.container.position( { - 'position' : 'center' - }); + ).fade('hide').inject(document.body).fade('in') }, @@ -59,17 +47,15 @@ var Question = new Class( { (options.onComplete || function(){})() self.close(); } - })).send(); + })).send(); }); } }, close : function() { var self = this; - self.mask.fade('out'); - (function(){self.mask.destroy()}).delay(1000); - - this.container.destroy(); + self.container.fade('out'); + (function(){self.container.destroy()}).delay(1000); }, toElement : function() { diff --git a/couchpotato/static/style/main.css b/couchpotato/static/style/main.css index 91bd1524..3d016a8d 100644 --- a/couchpotato/static/style/main.css +++ b/couchpotato/static/style/main.css @@ -1,19 +1,14 @@ -html { +body, html { color: #fff; font-size: 12px; line-height: 1.5; - font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif; + font-family: OpenSans, "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif; height: 100%; - text-shadow: 0 1px 0 #000; -} - -body { margin: 0; padding: 0; background: #4e5969; - overflow-y: scroll; - height: 100%; } + body { overflow-y: scroll; } body.noscroll { overflow: hidden; } #clean { @@ -32,14 +27,16 @@ pre { } input, textarea { - font-size: 12px; + font-size: 1em; font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif; } +input:focus, textarea:focus { + outline: none; +} input:-moz-placeholder, textarea:-moz-placeholder { color: rgba(255, 255, 255, 0.6); } - ::-webkit-input-placeholder, ::-webkit-textarea-placeholder { color: rgba(255, 255, 255, 0.6); } @@ -59,53 +56,30 @@ a:hover { color: #f3f3f3; } .page { display: none; - width: 960px; + width: 100%; + max-width: 980px; margin: 0 auto; - line-height: 24px; - padding: 0 0 20px; + line-height: 1.5em; + padding: 0 15px 20px; } .page.active { display: block; } - .page .noticeMe { - background-color: lightgoldenrodyellow; - display: block; - padding: 20px 10px; - margin: 0 -10px 40px; - font-size: 19px; - text-align: center; - } - .content { clear:both; - padding: 80px 0 10px; + padding: 65px 0 10px; + background: #4e5969; } -h2 { - font-size: 30px; - padding: 0; - margin: 20px 0 0 0; -} - -.footer { - text-align:center; - padding: 50px 0 0 0; - color: #999; - font-size: 10px; - clear: both; -} - - .footer .check { - color: #333; + @media all and (max-width: 480px) { + .content { + padding-top: 40px; + } } -#toTop { - background: black; - position: fixed; - bottom: 0; - right: 0; - padding: 10px 10px 10px 40px; - background: #f7f7f7 url('../images/toTop.gif') no-repeat 10px center; - border-radius: 5px 0 0 0; +h2 { + font-size: 2.5em; + padding: 0; + margin: 20px 0 0 0; } form { @@ -126,6 +100,12 @@ body > .spinner, .mask{ width: 100%; padding: 200px; } + + @media all and (max-width: 480px) { + body > .mask { + padding: 20px; + } + } .button { background: #5082bc url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAyCAYAAACd+7GKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAClJREFUeNpi/v//vwMTAwPDfzjBgMpFI/7hFSOT9Y8qRuF3JLoHAQIMAHYtMmRA+CugAAAAAElFTkSuQmCC") repeat-x; @@ -135,8 +115,6 @@ body > .spinner, .mask{ font-weight: bold; line-height: 1; border-radius: 2px; - box-shadow: 0 1px 2px rgba(0,0,0,0.3); - text-shadow: 0 -1px 1px rgba(0,0,0,0.25); cursor: pointer; } .button.red { background-color: #ff0000; } @@ -164,132 +142,300 @@ body > .spinner, .mask{ .icon.spinner { background-image: url('../images/icon.spinner.gif'); } .icon.attention { background-image: url('../images/icon.attention.png'); } +.icon2 { + display: inline-block; + background: center no-repeat; + font-family: 'Elusive-Icons'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + font-size: 15px; +} + +.icon2.cog:before { content: "\e109"; } +.icon2.eye-open:before { content: "\e09d"; } +.icon2.search:before { content: "\e03e"; } +.icon2.return-key:before { content: "\e111"; } +.icon2.menu:before { + content: "\e076 \e076 \e076"; + line-height: 6px; + transform: scaleX(2); + width: 20px; + font-size: 10px; + display: inline-block; + vertical-align: middle; +} + /*** Navigation ***/ .header { - background: #4e5969; - padding: 10px 0; - height: 80px; + height: 66px; position: fixed; margin: 0; width: 100%; z-index: 5; - box-shadow: 0 20px 30px -30px rgba(0,0,0,0.05); - transition: box-shadow .4s cubic-bezier(0.9,0,0.1,1); + background: #4e5969; + box-shadow: 0 0 10px rgba(0,0,0,.1); + transition: all .4s ease-in-out; } .header.with_shadow { - box-shadow: 0 20px 30px -30px rgba(0,0,0,0.3); + background-color: #46505e; + } + + @media all and (max-width: 480px) { + .header { + height: 44px; + } } .header > div { - width: 960px; + width: 100%; + max-width: 980px; margin: 0 auto; - overflow: hidden; + position: relative; + height: 100%; + padding: 0 15px; } + .header .navigation { display: inline-block; vertical-align: middle; - width: 67.2%; + position: absolute; + height: 100%; + left: 0; + bottom: 0; } - .header .navigation ul { - margin: 0; - padding: 0; - } - .header .navigation li { - color: #fff; - display: inline-block; - font-size:20px; - font-weight: bold; - margin: 0; - text-align: center; - } - - .header .navigation li a { - display: block; - padding: 15px; - position: relative; - } - .header .navigation li:first-child a { padding-left: 10px; } - .header .navigation li span { - display: block; - margin-top: 5px; - } - - .header .navigation li a:after { - content: ''; - display: inline-block; - height: 2px; - width: 76%; - left: 12%; - position: absolute; - top: 46px; - background-color: #46505e; - outline: none; - box-shadow: inset 0 1px 8px rgba(0,0,0,0.05), 0 1px 0px rgba(255,255,255,0.15); - transition: all .4s cubic-bezier(0.9,0,0.1,1); - } - - .header .navigation li:hover a:after { background-color: #047792; } - .header .navigation li.active a:after { background-color: #04bce6; } - - .header .navigation li.disabled { color: #e5e5e5; } - .header .navigation li a { color: #fff; } - - .header .navigation .backtotop { - opacity: 0; - display: block; - width: 80px; - left: 50%; - position: absolute; + + .header .foldout { + width: 44px; + height: 100%; text-align: center; - margin: -10px 0 0 -40px; - background: #4e5969; - padding: 5px 0; - border-radius: 0 0 5px 5px; - color: rgba(255,255,255,.4); - text-shadow: none; - font-weight: normal; + border-right: 1px solid rgba(255,255,255,.07); + display: none; + vertical-align: top; + line-height: 42px; + color: #FFF; + } + + .header .logo { + display: inline-block; + font-size: 1.75em; + padding: 13px 30px 0 15px; + height: 100%; + vertical-align: middle; + border-right: 1px solid rgba(255,255,255,.07); + color: #FFF; + font-weight: normal; + } + + @media all and (max-width: 480px) { + .header .foldout { + display: inline-block; + } + + .header .logo { + padding-top: 7px; + border: 0; + } + } + + @media all and (min-width: 481px) and (max-width: 640px) { + + .header .logo { + display: none; + } + + } + + .header .navigation ul { + display: inline-block; + margin: 0; + padding: 0; + height: 100%; + } + + .header .navigation li { + color: #fff; + display: inline-block; + font-size: 1.75em; + margin: 0; + text-align: center; + height: 100%; + border: 1px solid rgba(255,255,255,.07); + border-width: 0 0 0 1px; + } + .header .navigation li:first-child { + border: none; + } + + .header .navigation li a { + display: block; + padding: 15px; + position: relative; + height: 100%; + border: 1px solid transparent; + border-width: 0 0 4px 0; + font-weight: normal; + } + + .header .navigation li:hover a { border-color: #047792; } + .header .navigation li.active a { border-color: #04bce6; } + + .header .navigation li.disabled { color: #e5e5e5; } + .header .navigation li a { color: #fff; } + + .header .navigation .backtotop { + opacity: 0; + display: block; + width: 80px; + left: 50%; + position: fixed; + bottom: 0; + text-align: center; + margin: -10px 0 0 -40px; + background: #4e5969; + padding: 5px 0; + color: rgba(255,255,255,.4); + font-weight: normal; + } + .header:hover .navigation .backtotop { color: #fff; } + + @media all and (max-width: 480px) { + + body { + position: absolute; + width: 100%; + transition: all .5s cubic-bezier(0.9,0,0.1,1); + left: 0; + } + + .menu_shown body { + left: 160px; + } + + .header .navigation { + height: 100%; + } + + .menu_shown .header .navigation .overlay { + position: fixed; + right: 0; + top: 0; + bottom: 0; + left: 160px; + } + + .header .navigation ul { + width: 160px; + position: fixed; + left: -160px; + background: rgba(0,0,0,.5); + transition: all .5s cubic-bezier(0.9,0,0.1,1); + } + + .menu_shown .header .navigation ul { + left: 0; + } + + .header .navigation ul li { + display: block; + text-align: left; + border-width: 1px 0 0 0; + height: 44px; + } + .header .navigation ul li a { + border-width: 0 4px 0 0; + padding: 5px 20px; + } + + .header .navigation ul li.separator { + background-color: rgba(255,255,255, .07); + height: 5px; + } } - .header:hover .navigation .backtotop { color: #fff; } .header .more_menu { - margin-left: 12px; + position: absolute; + right: 15px; + height: 100%; + border-left: 1px solid rgba(255,255,255,.07); } + + @media all and (max-width: 480px) { + .header .more_menu { + display: none; + } + } + + .header .more_menu .button { + height: 100%; + width: 44px; + border: 0; + box-shadow: none; + border-radius: 0; + background: none; + line-height: 66px; + text-align: center; + padding: 0; + border: 1px solid transparent; + border-width: 0 0 4px; + } + .header .more_menu .button:hover { + background: none; + border-color: #047792; + } + .header .more_menu .wrapper { width: 150px; - margin-left: -110px; - } - .header .more_menu .wrapper:before { - margin-left: -34px; + margin-left: -106px; + margin-top: 66px; } + + @media all and (max-width: 480px) { + .header .more_menu .button { + line-height: 44px; + } + + .header .more_menu .wrapper { + margin-top: 44px; + } + } .header .more_menu .red { color: red; } .header .more_menu .orange { color: orange; } .badge { position: absolute; - width: 14px; - height: 14px; + width: 20px; + height: 20px; text-align: center; - line-height: 14px; - border-radius: 50%; - font-size: 8px; - margin: -5px 0 0 15px; - box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 3px rgba(0,0,0,.7); + line-height: 20px; + margin: 0; background-color: #1b79b8; - text-shadow: none; - background-image: -*-linear-gradient(0deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,.1) 100%); + top: 0; + right: 0; } + + .header .notification_menu { + right: 60px; + display: block; + } + + @media all and (max-width: 480px) { + .header .notification_menu { + right: 0; + } + } .header .notification_menu .wrapper { width: 300px; - margin-left: -260px; + margin-left: -255px; text-align: left; } - .header .notification_menu .wrapper:before { - left: 296px; - } - .header .notification_menu ul { max-height: 300px; overflow: auto; @@ -309,7 +455,7 @@ body > .spinner, .mask{ .header .notification_menu li:last-child > span { border: 0; } .header .notification_menu li .added { display: block; - font-size: 10px; + font-size: .85em; color: #aaa; text-align: ; } @@ -454,13 +600,9 @@ body > .spinner, .mask{ display: block; width: 600px; padding: 20px; - background: #f5f5f5; position:fixed; - z-index:101; + z-index: 101; text-align: center; - background: #5c697b; - border-radius: 3px; - box-shadow: 0 0 50px rgba(0,0,0,0.55); } .question h3 { @@ -472,7 +614,6 @@ body > .spinner, .mask{ .question .hint { font-size: 14px; color: #ccc; - text-shadow: none; } .question .answer { @@ -495,88 +636,74 @@ body > .spinner, .mask{ background-color: #4c5766; } - .more_menu { - display: inline-block; - vertical-align: middle; - } +.more_menu { + display: inline-block; + vertical-align: middle; +} - .more_menu > a { +.more_menu > a { + display: block; + background: url('../images/sprite.png') no-repeat center -137px; + height: 25px; + width: 25px; + border: 1px solid rgba(0,0,0,0.3); + transition: all 0.3s ease-in-out; +} +.more_menu.show > a:not(:active), .more_menu > a:hover:not(:active) { + background-color: #406db8; +} + +.more_menu .wrapper { + display: none; + background: rgba(255,255,255,0.98); + padding: 4px; + position: absolute; + z-index: 90; + margin: 32px 0 0 -145px; + width: 185px; + box-shadow: 0 20px 20px -5px rgba(0,0,0,0.1); + text-align: center; + color: #000; + background-image: -*-linear-gradient( + 45deg, + rgb(200,200,200) 0%, + rgb(255,255,255) 100% + ); +} + + .more_menu.show .wrapper { display: block; - background: url('../images/sprite.png') no-repeat center -137px; - height: 25px; - width: 25px; - border: 1px solid rgba(0,0,0,0.3); - transition: all 0.3s ease-in-out; - } - .more_menu.show > a:not(:active), .more_menu > a:hover:not(:active) { - background-color: #406db8; } - .more_menu .wrapper { - display: none; - border: 1px solid #333; - background: rgba(255,255,255,0.98); - border-radius: 3px; - padding: 4px !important; - position: absolute; - z-index: 9; - margin: 32px 0 0 -145px; - width: 185px; - box-shadow: 0 10px 10px -5px rgba(0,0,0,0.4); - text-align: center; - color: #000; - text-shadow: none; - background-image: -*-linear-gradient( - 45deg, - rgb(200,200,200) 0%, - rgb(255,255,255) 100% - ); + .more_menu ul { + padding: 0; + margin: 0; + list-style: none; } - .more_menu .wrapper:before { - content: ' '; - height: 0; - position: relative; - width: 0; - border: 6px solid transparent; - border-bottom-color: #fff; - display: block; - top: -16px; - left: 146px; - } - .more_menu.show .wrapper { + .more_menu .wrapper li { + width: 100%; + height: auto; + } + + .more_menu .wrapper li a { display: block; + border-bottom: 1px solid rgba(255,255,255,0.2); + box-shadow: none; + font-weight: normal; + font-size: 11px; + text-transform: uppercase; + letter-spacing: 1px; + padding: 3px 0; + color: #000; } - .more_menu ul { - padding: 0; - margin: -12px 0 0 0; - list-style: none; + .more_menu .wrapper li:last-child a { + border: none; } - - .more_menu .wrapper li { - width: 100%; - height: auto; + .more_menu .wrapper li a:hover { + background: rgba(0,0,0,0.05); } - - .more_menu .wrapper li a { - display: block; - border-bottom: 1px solid rgba(255,255,255,0.2); - box-shadow: none; - font-weight: normal; - font-size: 11px; - text-transform: uppercase; - letter-spacing: 1px; - padding: 3px 0; - color: #000; - } - - .more_menu .wrapper li:last-child a { - border: none; - } - .more_menu .wrapper li a:hover { - background: rgba(0,0,0,0.05); - } .messages { position: fixed; @@ -619,4 +746,64 @@ body > .spinner, .mask{ .messages .message.hide { margin-left: 240px; opacity: 0; - } \ No newline at end of file + } + +/* Fonts */ +@font-face { + font-family: 'Elusive-Icons'; + src:url('../fonts/Elusive-Icons.eot'); + src:url('../fonts/Elusive-Icons.eot?#iefix') format('embedded-opentype'), + url('../fonts/Elusive-Icons.woff') format('woff'), + url('../fonts/Elusive-Icons.ttf') format('truetype'), + url('../fonts/Elusive-Icons.svg#Elusive-Icons') format('svg'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'OpenSans'; + src: url('../fonts/OpenSans-Regular-webfont.eot'); + src: url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), + url('../fonts/OpenSans-Regular-webfont.ttf') format('truetype'), + url('../fonts/OpenSans-Regular-webfont.svg#OpenSansRegular') format('svg'); + font-weight: normal; + font-style: normal; + +} + +@font-face { + font-family: 'OpenSans'; + src: url('../fonts/OpenSans-Italic-webfont.eot'); + src: url('../fonts/OpenSans-Italic-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Italic-webfont.woff') format('woff'), + url('../fonts/OpenSans-Italic-webfont.ttf') format('truetype'), + url('../fonts/OpenSans-Italic-webfont.svg#OpenSansItalic') format('svg'); + font-weight: normal; + font-style: italic; + +} + +@font-face { + font-family: 'OpenSans'; + src: url('../fonts/OpenSans-Bold-webfont.eot'); + src: url('../fonts/OpenSans-Bold-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Bold-webfont.woff') format('woff'), + url('../fonts/OpenSans-Bold-webfont.ttf') format('truetype'), + url('../fonts/OpenSans-Bold-webfont.svg#OpenSansBold') format('svg'); + font-weight: bold; + font-style: normal; + +} + +@font-face { + font-family: 'OpenSans'; + src: url('../fonts/OpenSans-BoldItalic-webfont.eot'); + src: url('../fonts/OpenSans-BoldItalic-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-BoldItalic-webfont.woff') format('woff'), + url('../fonts/OpenSans-BoldItalic-webfont.ttf') format('truetype'), + url('../fonts/OpenSans-BoldItalic-webfont.svg#OpenSansBoldItalic') format('svg'); + font-weight: bold; + font-style: italic; + +} \ No newline at end of file diff --git a/couchpotato/static/style/settings.css b/couchpotato/static/style/settings.css index a5655f88..638a6585 100644 --- a/couchpotato/static/style/settings.css +++ b/couchpotato/static/style/settings.css @@ -1,5 +1,9 @@ +.page.settings { + min-width: 960px; +} + .page.settings:after { - content: "."; + content: ""; display: block; clear: both; visibility: hidden; @@ -9,15 +13,15 @@ .page.settings .tabs { float: left; - width: 20%; - font-size: 20px; + width: 14.7%; + font-size: 17px; text-align: right; list-style: none; - padding: 40px 0; + padding: 35px 0; margin: 0; min-height: 470px; background-image: -*-linear-gradient( - 20deg, + 14deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.3) 100% ); @@ -60,9 +64,9 @@ .page.settings .containers { - width: 80%; + width: 84%; float: left; - padding: 20px 2%; + padding: 40px 2%; min-height: 300px; } @@ -240,7 +244,7 @@ display: block; text-align: right; height: 20px; - margin: 0; + margin: 0 0 -37px; } .page .advanced_toggle span { padding: 0 5px; } .page.show_advanced .advanced_toggle { diff --git a/couchpotato/templates/index.html b/couchpotato/templates/index.html index 1d618066..4fcb5c9e 100644 --- a/couchpotato/templates/index.html +++ b/couchpotato/templates/index.html @@ -1,6 +1,9 @@ + + + {% for url in fireEvent('clientscript.get_styles', as_html = True, location = 'front', single = True) %} {% endfor %} {% for url in fireEvent('clientscript.get_scripts', as_html = True, location = 'front', single = True) %} From 924bed06cbfc20d170e86d75d58652c684e8ec83 Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 30 Apr 2013 00:29:25 +0200 Subject: [PATCH 23/48] Rewrite font css --- couchpotato/core/_base/clientscript/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/couchpotato/core/_base/clientscript/main.py b/couchpotato/core/_base/clientscript/main.py index f2a30f6f..4938a22a 100644 --- a/couchpotato/core/_base/clientscript/main.py +++ b/couchpotato/core/_base/clientscript/main.py @@ -110,6 +110,7 @@ class ClientScript(Plugin): else: data = cssmin(f) data = data.replace('../images/', '../static/images/') + data = data.replace('../fonts/', '../static/fonts/') raw.append({'file': file_path, 'date': int(os.path.getmtime(file_path)), 'data': data}) From 7b3a1409d59be095299520c0f275541bccba6b3a Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 30 Apr 2013 10:32:22 +0200 Subject: [PATCH 24/48] Force thumbnail view on home --- couchpotato/core/plugins/movie/static/list.js | 5 +++-- couchpotato/static/scripts/page/home.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/plugins/movie/static/list.js b/couchpotato/core/plugins/movie/static/list.js index 46819439..e1cb0d80 100644 --- a/couchpotato/core/plugins/movie/static/list.js +++ b/couchpotato/core/plugins/movie/static/list.js @@ -8,7 +8,8 @@ var MovieList = new Class({ load_more: true, loader: true, menu: [], - add_new: false + add_new: false, + force_view: false }, movies: [], @@ -43,7 +44,7 @@ var MovieList = new Class({ }) : null ); - if($(window).getSize().x < 480) + if($(window).getSize().x < 480 && !self.options.force_view) self.changeView('list'); else self.changeView(self.getSavedView() || self.options.view || 'details'); diff --git a/couchpotato/static/scripts/page/home.js b/couchpotato/static/scripts/page/home.js index 1839e3b0..e1fe63e0 100644 --- a/couchpotato/static/scripts/page/home.js +++ b/couchpotato/static/scripts/page/home.js @@ -59,6 +59,7 @@ Page.Home = new Class({ 'actions': [MA.IMDB, MA.Refresh], 'load_more': false, 'view': 'thumbs', + 'force_view': true, 'api_call': 'dashboard.soon' }); From 12c3fc6ce31a4d2fabde19b249eb56fc78b741cd Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 30 Apr 2013 11:13:47 +0200 Subject: [PATCH 25/48] Don't reverse result order --- couchpotato/core/event.py | 1 - 1 file changed, 1 deletion(-) diff --git a/couchpotato/core/event.py b/couchpotato/core/event.py index 8a5145a6..b46b2b4f 100644 --- a/couchpotato/core/event.py +++ b/couchpotato/core/event.py @@ -102,7 +102,6 @@ def fireEvent(name, *args, **kwargs): # Merge if options['merge'] and len(results) > 0: - results.reverse() # Priority 1 is higher then 100 # Dict if isinstance(results[0], dict): From 30ec8216e15262d6332a7fc0f3faa9b23595776f Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 30 Apr 2013 13:17:03 +0200 Subject: [PATCH 26/48] Minify on backend --- couchpotato/core/_base/clientscript/main.py | 12 +- .../core/plugins/profile/static/profile.css | 12 +- .../static/scripts/library/prefix_free.js | 487 ------- couchpotato/static/style/main.css | 16 +- couchpotato/static/style/settings.css | 16 +- libs/cssprefixer/__init__.py | 20 + libs/cssprefixer/engine.py | 117 ++ libs/cssprefixer/rules.py | 271 ++++ libs/cssutils/__init__.py | 385 +++++ libs/cssutils/_codec2.py | 584 ++++++++ libs/cssutils/_codec3.py | 608 ++++++++ libs/cssutils/_fetch.py | 44 + libs/cssutils/_fetchgae.py | 68 + libs/cssutils/codec.py | 16 + libs/cssutils/css/__init__.py | 80 ++ libs/cssutils/css/colors.py | 184 +++ libs/cssutils/css/csscharsetrule.py | 159 +++ libs/cssutils/css/csscomment.py | 87 ++ libs/cssutils/css/cssfontfacerule.py | 184 +++ libs/cssutils/css/cssimportrule.py | 396 ++++++ libs/cssutils/css/cssmediarule.py | 302 ++++ libs/cssutils/css/cssnamespacerule.py | 295 ++++ libs/cssutils/css/csspagerule.py | 436 ++++++ libs/cssutils/css/cssproperties.py | 122 ++ libs/cssutils/css/cssrule.py | 304 ++++ libs/cssutils/css/cssrulelist.py | 53 + libs/cssutils/css/cssstyledeclaration.py | 697 +++++++++ libs/cssutils/css/cssstylerule.py | 234 +++ libs/cssutils/css/cssstylesheet.py | 804 +++++++++++ libs/cssutils/css/cssunknownrule.py | 209 +++ libs/cssutils/css/cssvalue.py | 1251 +++++++++++++++++ libs/cssutils/css/cssvariablesdeclaration.py | 330 +++++ libs/cssutils/css/cssvariablesrule.py | 198 +++ libs/cssutils/css/marginrule.py | 215 +++ libs/cssutils/css/property.py | 510 +++++++ libs/cssutils/css/selector.py | 813 +++++++++++ libs/cssutils/css/selectorlist.py | 234 +++ libs/cssutils/css/value.py | 871 ++++++++++++ libs/cssutils/css2productions.py | 131 ++ libs/cssutils/cssproductions.py | 124 ++ libs/cssutils/errorhandler.py | 118 ++ libs/cssutils/helper.py | 137 ++ libs/cssutils/parse.py | 232 +++ libs/cssutils/prodparser.py | 733 ++++++++++ libs/cssutils/profiles.py | 791 +++++++++++ libs/cssutils/sac.py | 428 ++++++ libs/cssutils/script.py | 362 +++++ libs/cssutils/scripts/__init__.py | 4 + libs/cssutils/scripts/csscapture.py | 69 + libs/cssutils/scripts/csscombine.py | 94 ++ libs/cssutils/scripts/cssparse.py | 62 + libs/cssutils/serialize.py | 1138 +++++++++++++++ libs/cssutils/settings.py | 15 + libs/cssutils/stylesheets/__init__.py | 11 + libs/cssutils/stylesheets/medialist.py | 235 ++++ libs/cssutils/stylesheets/mediaquery.py | 207 +++ libs/cssutils/stylesheets/stylesheet.py | 123 ++ libs/cssutils/stylesheets/stylesheetlist.py | 32 + libs/cssutils/tokenize2.py | 223 +++ libs/cssutils/util.py | 884 ++++++++++++ libs/encutils/__init__.py | 690 +++++++++ libs/minify/cssmin.py | 223 --- 62 files changed, 17953 insertions(+), 737 deletions(-) delete mode 100644 couchpotato/static/scripts/library/prefix_free.js create mode 100755 libs/cssprefixer/__init__.py create mode 100755 libs/cssprefixer/engine.py create mode 100755 libs/cssprefixer/rules.py create mode 100755 libs/cssutils/__init__.py create mode 100755 libs/cssutils/_codec2.py create mode 100755 libs/cssutils/_codec3.py create mode 100755 libs/cssutils/_fetch.py create mode 100755 libs/cssutils/_fetchgae.py create mode 100755 libs/cssutils/codec.py create mode 100755 libs/cssutils/css/__init__.py create mode 100755 libs/cssutils/css/colors.py create mode 100755 libs/cssutils/css/csscharsetrule.py create mode 100755 libs/cssutils/css/csscomment.py create mode 100755 libs/cssutils/css/cssfontfacerule.py create mode 100755 libs/cssutils/css/cssimportrule.py create mode 100755 libs/cssutils/css/cssmediarule.py create mode 100755 libs/cssutils/css/cssnamespacerule.py create mode 100755 libs/cssutils/css/csspagerule.py create mode 100755 libs/cssutils/css/cssproperties.py create mode 100755 libs/cssutils/css/cssrule.py create mode 100755 libs/cssutils/css/cssrulelist.py create mode 100755 libs/cssutils/css/cssstyledeclaration.py create mode 100755 libs/cssutils/css/cssstylerule.py create mode 100755 libs/cssutils/css/cssstylesheet.py create mode 100755 libs/cssutils/css/cssunknownrule.py create mode 100755 libs/cssutils/css/cssvalue.py create mode 100755 libs/cssutils/css/cssvariablesdeclaration.py create mode 100755 libs/cssutils/css/cssvariablesrule.py create mode 100755 libs/cssutils/css/marginrule.py create mode 100755 libs/cssutils/css/property.py create mode 100755 libs/cssutils/css/selector.py create mode 100755 libs/cssutils/css/selectorlist.py create mode 100755 libs/cssutils/css/value.py create mode 100755 libs/cssutils/css2productions.py create mode 100755 libs/cssutils/cssproductions.py create mode 100755 libs/cssutils/errorhandler.py create mode 100755 libs/cssutils/helper.py create mode 100755 libs/cssutils/parse.py create mode 100755 libs/cssutils/prodparser.py create mode 100755 libs/cssutils/profiles.py create mode 100755 libs/cssutils/sac.py create mode 100755 libs/cssutils/script.py create mode 100755 libs/cssutils/scripts/__init__.py create mode 100755 libs/cssutils/scripts/csscapture.py create mode 100755 libs/cssutils/scripts/csscombine.py create mode 100755 libs/cssutils/scripts/cssparse.py create mode 100755 libs/cssutils/serialize.py create mode 100755 libs/cssutils/settings.py create mode 100755 libs/cssutils/stylesheets/__init__.py create mode 100755 libs/cssutils/stylesheets/medialist.py create mode 100755 libs/cssutils/stylesheets/mediaquery.py create mode 100755 libs/cssutils/stylesheets/stylesheet.py create mode 100755 libs/cssutils/stylesheets/stylesheetlist.py create mode 100755 libs/cssutils/tokenize2.py create mode 100755 libs/cssutils/util.py create mode 100755 libs/encutils/__init__.py delete mode 100644 libs/minify/cssmin.py diff --git a/couchpotato/core/_base/clientscript/main.py b/couchpotato/core/_base/clientscript/main.py index 4938a22a..9536463e 100644 --- a/couchpotato/core/_base/clientscript/main.py +++ b/couchpotato/core/_base/clientscript/main.py @@ -1,10 +1,11 @@ from couchpotato.core.event import addEvent +from couchpotato.core.helpers.encoding import ss from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.environment import Env -from minify.cssmin import cssmin from minify.jsmin import jsmin +import cssprefixer import os import traceback @@ -23,7 +24,6 @@ class ClientScript(Plugin): 'script': [ 'scripts/library/mootools.js', 'scripts/library/mootools_more.js', - 'scripts/library/prefix_free.js', 'scripts/library/uniform.js', 'scripts/library/form_replacement/form_check.js', 'scripts/library/form_replacement/form_radio.js', @@ -69,7 +69,8 @@ class ClientScript(Plugin): addEvent('clientscript.get_styles', self.getStyles) addEvent('clientscript.get_scripts', self.getScripts) - addEvent('app.load', self.minify) + if not Env.get('dev'): + addEvent('app.load', self.minify) self.addCore() @@ -108,9 +109,10 @@ class ClientScript(Plugin): if file_type == 'script': data = jsmin(f) else: - data = cssmin(f) + data = cssprefixer.process(f, debug = False, minify = True) data = data.replace('../images/', '../static/images/') data = data.replace('../fonts/', '../static/fonts/') + data = data.replace('../../static/', '../static/') # Replace inside plugins raw.append({'file': file_path, 'date': int(os.path.getmtime(file_path)), 'data': data}) @@ -120,7 +122,7 @@ class ClientScript(Plugin): data += self.comment.get(file_type) % (r.get('file'), r.get('date')) data += r.get('data') + '\n\n' - self.createFile(out, data.strip()) + self.createFile(out, ss(data.strip())) if not self.minified.get(file_type): self.minified[file_type] = {} diff --git a/couchpotato/core/plugins/profile/static/profile.css b/couchpotato/core/plugins/profile/static/profile.css index 9d50d2fd..26ee64c7 100644 --- a/couchpotato/core/plugins/profile/static/profile.css +++ b/couchpotato/core/plugins/profile/static/profile.css @@ -71,13 +71,13 @@ } .profile .types .type .handle { - background: url('./handle.png') center; + background: url('../../static/profile_plugin/handle.png') center; display: inline-block; height: 20px; width: 20px; - cursor: grab; - cursor: -moz-grab; cursor: -webkit-grab; + cursor: -moz-grab; + cursor: grab; margin: 0; } @@ -105,9 +105,9 @@ } #profile_ordering li { - cursor: grab; - cursor: -moz-grab; cursor: -webkit-grab; + cursor: -moz-grab; + cursor: grab; border-bottom: 1px solid rgba(255,255,255,0.2); padding: 0 5px; } @@ -126,7 +126,7 @@ } #profile_ordering li .handle { - background: url('./handle.png') center; + background: url('../../static/profile_plugin/handle.png') center; width: 20px; float: right; } diff --git a/couchpotato/static/scripts/library/prefix_free.js b/couchpotato/static/scripts/library/prefix_free.js deleted file mode 100644 index b6d9812a..00000000 --- a/couchpotato/static/scripts/library/prefix_free.js +++ /dev/null @@ -1,487 +0,0 @@ -/** - * StyleFix 1.0.3 & PrefixFree 1.0.7 - * @author Lea Verou - * MIT license - */ - -(function(){ - -if(!window.addEventListener) { - return; -} - -var self = window.StyleFix = { - link: function(link) { - try { - // Ignore stylesheets with data-noprefix attribute as well as alternate stylesheets - if(link.rel !== 'stylesheet' || link.hasAttribute('data-noprefix')) { - return; - } - } - catch(e) { - return; - } - - var url = link.href || link.getAttribute('data-href'), - base = url.replace(/[^\/]+$/, ''), - base_scheme = (/^[a-z]{3,10}:/.exec(base) || [''])[0], - base_domain = (/^[a-z]{3,10}:\/\/[^\/]+/.exec(base) || [''])[0], - base_query = /^([^?]*)\??/.exec(url)[1], - parent = link.parentNode, - xhr = new XMLHttpRequest(), - process; - - xhr.onreadystatechange = function() { - if(xhr.readyState === 4) { - process(); - } - }; - - process = function() { - var css = xhr.responseText; - - if(css && link.parentNode && (!xhr.status || xhr.status < 400 || xhr.status > 600)) { - css = self.fix(css, true, link); - - // Convert relative URLs to absolute, if needed - if(base) { - css = css.replace(/url\(\s*?((?:"|')?)(.+?)\1\s*?\)/gi, function($0, quote, url) { - if(/^([a-z]{3,10}:|#)/i.test(url)) { // Absolute & or hash-relative - return $0; - } - else if(/^\/\//.test(url)) { // Scheme-relative - // May contain sequences like /../ and /./ but those DO work - return 'url("' + base_scheme + url + '")'; - } - else if(/^\//.test(url)) { // Domain-relative - return 'url("' + base_domain + url + '")'; - } - else if(/^\?/.test(url)) { // Query-relative - return 'url("' + base_query + url + '")'; - } - else { - // Path-relative - return 'url("' + base + url + '")'; - } - }); - - // behavior URLs shoudn’t be converted (Issue #19) - // base should be escaped before added to RegExp (Issue #81) - var escaped_base = base.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); - css = css.replace(RegExp('\\b(behavior:\\s*?url\\(\'?"?)' + escaped_base, 'gi'), '$1'); - } - - var style = document.createElement('style'); - style.textContent = css; - style.media = link.media; - style.disabled = link.disabled; - style.setAttribute('data-href', link.getAttribute('href')); - - parent.insertBefore(style, link); - parent.removeChild(link); - - style.media = link.media; // Duplicate is intentional. See issue #31 - } - }; - - try { - xhr.open('GET', url); - xhr.send(null); - } catch (e) { - // Fallback to XDomainRequest if available - if (typeof XDomainRequest != "undefined") { - xhr = new XDomainRequest(); - xhr.onerror = xhr.onprogress = function() {}; - xhr.onload = process; - xhr.open("GET", url); - xhr.send(null); - } - } - - link.setAttribute('data-inprogress', ''); - }, - - styleElement: function(style) { - if (style.hasAttribute('data-noprefix')) { - return; - } - var disabled = style.disabled; - - style.textContent = self.fix(style.textContent, true, style); - - style.disabled = disabled; - }, - - styleAttribute: function(element) { - var css = element.getAttribute('style'); - - css = self.fix(css, false, element); - - element.setAttribute('style', css); - }, - - process: function() { - // Linked stylesheets - $('link[rel="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link); - - // Inline stylesheets - $('style').forEach(StyleFix.styleElement); - - // Inline styles - $('[style]').forEach(StyleFix.styleAttribute); - }, - - register: function(fixer, index) { - (self.fixers = self.fixers || []) - .splice(index === undefined? self.fixers.length : index, 0, fixer); - }, - - fix: function(css, raw, element) { - for(var i=0; i -1) { - // Gradients are supported with a prefix, convert angles to legacy - css = css.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/ig, function ($0, delim, repeating, deg) { - return delim + (repeating || '') + 'linear-gradient(' + (90-deg) + 'deg'; - }); - } - - css = fix('functions', '(\\s|:|,)', '\\s*\\(', '$1' + prefix + '$2(', css); - css = fix('keywords', '(\\s|:)', '(\\s|;|\\}|$)', '$1' + prefix + '$2$3', css); - css = fix('properties', '(^|\\{|\\s|;)', '\\s*:', '$1' + prefix + '$2:', css); - - // Prefix properties *inside* values (issue #8) - if (self.properties.length) { - var regex = RegExp('\\b(' + self.properties.join('|') + ')(?!:)', 'gi'); - - css = fix('valueProperties', '\\b', ':(.+?);', function($0) { - return $0.replace(regex, prefix + "$1") - }, css); - } - - if(raw) { - css = fix('selectors', '', '\\b', self.prefixSelector, css); - css = fix('atrules', '@', '\\b', '@' + prefix + '$1', css); - } - - // Fix double prefixing - css = css.replace(RegExp('-' + prefix, 'g'), '-'); - - // Prefix wildcard - css = css.replace(/-\*-(?=[a-z]+)/gi, self.prefix); - - return css; - }, - - property: function(property) { - return (self.properties.indexOf(property)? self.prefix : '') + property; - }, - - value: function(value, property) { - value = fix('functions', '(^|\\s|,)', '\\s*\\(', '$1' + self.prefix + '$2(', value); - value = fix('keywords', '(^|\\s)', '(\\s|$)', '$1' + self.prefix + '$2$3', value); - - // TODO properties inside values - - return value; - }, - - // Warning: Prefixes no matter what, even if the selector is supported prefix-less - prefixSelector: function(selector) { - return selector.replace(/^:{1,2}/, function($0) { return $0 + self.prefix }) - }, - - // Warning: Prefixes no matter what, even if the property is supported prefix-less - prefixProperty: function(property, camelCase) { - var prefixed = self.prefix + property; - - return camelCase? StyleFix.camelCase(prefixed) : prefixed; - } -}; - -/************************************** - * Properties - **************************************/ -(function() { - var prefixes = {}, - properties = [], - shorthands = {}, - style = getComputedStyle(document.documentElement, null), - dummy = document.createElement('div').style; - - // Why are we doing this instead of iterating over properties in a .style object? Cause Webkit won't iterate over those. - var iterate = function(property) { - if(property.charAt(0) === '-') { - properties.push(property); - - var parts = property.split('-'), - prefix = parts[1]; - - // Count prefix uses - prefixes[prefix] = ++prefixes[prefix] || 1; - - // This helps determining shorthands - while(parts.length > 3) { - parts.pop(); - - var shorthand = parts.join('-'); - - if(supported(shorthand) && properties.indexOf(shorthand) === -1) { - properties.push(shorthand); - } - } - } - }, - supported = function(property) { - return StyleFix.camelCase(property) in dummy; - } - - // Some browsers have numerical indices for the properties, some don't - if(style.length > 0) { - for(var i=0; i .spinner, .mask{ border-radius:30px; box-shadow: 0 1px 1px rgba(0,0,0,0.35), inset 0 1px 0px rgba(255,255,255,0.20); - background: url('../images/sprite.png') no-repeat 94% -53px, -*-linear-gradient( - 270deg, + background: url('../images/sprite.png') no-repeat 94% -53px, linear-gradient( + 180deg, #5b9bd1 0%, #406db8 100% ); @@ -583,8 +583,8 @@ body > .spinner, .mask{ border: 1px solid #252930; box-shadow: inset 0 1px 0px rgba(255,255,255,0.20), 0 0 3px rgba(0,0,0, 0.2); background: rgb(55,62,74); - background-image: -*-linear-gradient( - 90deg, + background-image: linear-gradient( + 0, rgb(55,62,74) 0%, rgb(73,83,98) 100% ); @@ -664,8 +664,8 @@ body > .spinner, .mask{ box-shadow: 0 20px 20px -5px rgba(0,0,0,0.1); text-align: center; color: #000; - background-image: -*-linear-gradient( - 45deg, + background-image: linear-gradient( + -45deg, rgb(200,200,200) 0%, rgb(255,255,255) 100% ); @@ -725,8 +725,8 @@ body > .spinner, .mask{ overflow: hidden; transition: all .6s cubic-bezier(0.9,0,0.1,1); box-shadow: 0 1px 1px rgba(0,0,0,0.35), inset 0 1px 0px rgba(255,255,255,0.20); - background-image: -*-linear-gradient( - 270deg, + background-image: linear-gradient( + 180deg, #5b9bd1 0%, #406db8 100% ); diff --git a/couchpotato/static/style/settings.css b/couchpotato/static/style/settings.css index 638a6585..1f001b7c 100644 --- a/couchpotato/static/style/settings.css +++ b/couchpotato/static/style/settings.css @@ -20,8 +20,8 @@ padding: 35px 0; margin: 0; min-height: 470px; - background-image: -*-linear-gradient( - 14deg, + background-image: linear-gradient( + 76deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.3) 100% ); @@ -443,16 +443,16 @@ border-radius: 2px; } .page .tag_input > ul:hover > li.choice { - background: -*-linear-gradient( - 270deg, + background: linear-gradient( + 180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100% ); } .page .tag_input > ul > li.choice:hover, .page .tag_input > ul > li.choice.selected { - background: -*-linear-gradient( - 270deg, + background: linear-gradient( + 180deg, #5b9bd1 0%, #406db8 100% ); @@ -490,8 +490,8 @@ margin: -9px 0 0 -16px; border-radius: 30px 30px 0 0; cursor: pointer; - background: url('../images/icon.delete.png') no-repeat center 2px, -*-linear-gradient( - 270deg, + background: url('../images/icon.delete.png') no-repeat center 2px, linear-gradient( + 180deg, #5b9bd1 0%, #5b9bd1 100% ); diff --git a/libs/cssprefixer/__init__.py b/libs/cssprefixer/__init__.py new file mode 100755 index 00000000..05674329 --- /dev/null +++ b/libs/cssprefixer/__init__.py @@ -0,0 +1,20 @@ +# CSSPrefixer +# Copyright 2010-2012 Greg V. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import engine +import rules +from engine import process + +__all__ = ('process', 'engine', 'rules') diff --git a/libs/cssprefixer/engine.py b/libs/cssprefixer/engine.py new file mode 100755 index 00000000..894f6e7f --- /dev/null +++ b/libs/cssprefixer/engine.py @@ -0,0 +1,117 @@ +# CSSPrefixer +# Copyright 2010-2012 Greg V. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import cssutils +import re +from rules import rules as tr_rules +from rules import prefixRegex + + +keyframesRegex = re.compile(r'@keyframes\s?\w+\s?{(.*)}') +blockRegex = re.compile(r'\w+\s?\{(.*)\}') + + +def magic(ruleset, debug, minify, filt, parser): + if isinstance(ruleset, cssutils.css.CSSUnknownRule): + if ruleset.cssText.startswith('@keyframes'): + inner = parser.parseString(keyframesRegex.split(ruleset.cssText.replace('\n', ''))[1]) + # BUG: doesn't work when minified + s = '' if minify else '\n' + return '@-webkit-keyframes {' + s + \ + ''.join([magic(rs, debug, minify, ['webkit'], parser) for rs in inner]) \ + + '}' + s + '@-moz-keyframes {' + s + \ + ''.join([magic(rs, debug, minify, ['moz'], parser) for rs in inner]) \ + + '}' + s + ruleset.cssText + elif ruleset.cssText.startswith('from') or ruleset.cssText.startswith('to'): + return ''.join([magic(rs, debug, minify, filt, parser) + for rs in parser.parseString(blockRegex.sub(r'\1', ruleset.cssText.replace('\n', ''))[1])]) + else: + return + elif hasattr(ruleset, 'style'): # Comments don't + ruleSet = set() + rules = list() + children = list(ruleset.style.children()) + ruleset.style = cssutils.css.CSSStyleDeclaration() # clear out the styles that were there + for rule in children: + if not hasattr(rule, 'name'): # comments don't have name + rules.append(rule) + continue + name = prefixRegex.sub('', rule.name) + if name in tr_rules: + rule.name = name + if rule.cssText in ruleSet: + continue + ruleSet.add(rule.cssText) + rules.append(rule) + + ruleset.style.seq._readonly = False + for rule in rules: + if not hasattr(rule, 'name'): + ruleset.style.seq.append(rule, 'Comment') + continue + processor = None + try: # try except so if anything goes wrong we don't lose the original property + if rule.name in tr_rules: + processor = tr_rules[rule.name](rule) + [ruleset.style.seq.append(prop, 'Property') for prop in processor.get_prefixed_props(filt) if prop] + # always add the original rule + if processor and hasattr(processor, 'get_base_prop'): + ruleset.style.seq.append(processor.get_base_prop(), 'Property') + else: + ruleset.style.seq.append(rule, 'Property') + except: + if debug: + print 'warning with ' + str(rule) + ruleset.style.seq.append(rule, 'Property') + ruleset.style.seq._readonly = True + elif hasattr(ruleset, 'cssRules'): + for subruleset in ruleset: + magic(subruleset, debug, minify, filt, parser) + cssText = ruleset.cssText + if not cssText: # blank rules return None so return an empty string + return + if minify or not hasattr(ruleset, 'style'): + return unicode(cssText) + return unicode(cssText) + '\n' + + +def process(string, debug = False, minify = False, filt = ['webkit', 'moz', 'o', 'ms'], **prefs): + loglevel = 'DEBUG' if debug else 'ERROR' + parser = cssutils.CSSParser(loglevel = 'CRITICAL') + if minify: + cssutils.ser.prefs.useMinified() + else: + cssutils.ser.prefs.useDefaults() + + # use the passed in prefs + for key, value in prefs.iteritems(): + if hasattr(cssutils.ser.prefs, key): + cssutils.ser.prefs.__dict__[key] = value + + results = [] + sheet = parser.parseString(string) + for ruleset in sheet.cssRules: + cssText = magic(ruleset, debug, minify, filt, parser) + if cssText: + results.append(cssText) + + # format with newlines based on minify + joinStr = '' if minify else '\n' + + # Not using sheet.cssText - it's buggy: + # it skips some prefixed properties. + return joinStr.join(results).rstrip() + +__all__ = ['process'] diff --git a/libs/cssprefixer/rules.py b/libs/cssprefixer/rules.py new file mode 100755 index 00000000..156d4f18 --- /dev/null +++ b/libs/cssprefixer/rules.py @@ -0,0 +1,271 @@ +# CSSPrefixer +# Copyright 2010-2012 Greg V. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import re +import cssutils + +prefixRegex = re.compile('^(-o-|-ms-|-moz-|-webkit-)') + + +class BaseReplacementRule(object): + vendor_prefixes = ['moz', 'webkit'] + + def __init__(self, prop): + self.prop = prop + + def get_prefixed_props(self, filt): + for prefix in [p for p in self.vendor_prefixes if p in filt]: + yield cssutils.css.Property( + name='-%s-%s' % (prefix, self.prop.name), + value=self.prop.value, + priority=self.prop.priority + ) + + @staticmethod + def should_prefix(): + return True + + +class FullReplacementRule(BaseReplacementRule): + vendor_prefixes = sorted(BaseReplacementRule.vendor_prefixes + ['o', 'ms']) + + +class BaseAndIEReplacementRule(BaseReplacementRule): + vendor_prefixes = sorted(BaseReplacementRule.vendor_prefixes + ['ms']) + + +class BaseAndOperaReplacementRule(BaseReplacementRule): + vendor_prefixes = sorted(BaseReplacementRule.vendor_prefixes + ['o']) + + +class WebkitReplacementRule(BaseReplacementRule): + vendor_prefixes = ['webkit'] + + +class OperaAndIEReplacementRule(BaseReplacementRule): + vendor_prefixes = ['ms', 'o'] + + +class MozReplacementRule(BaseReplacementRule): + vendor_prefixes = ['moz'] + + +class BorderRadiusReplacementRule(BaseReplacementRule): + """ + Mozilla's Gecko engine uses different syntax for rounded corners. + """ + vendor_prefixes = ['webkit'] + + def get_prefixed_props(self, filt): + for prop in BaseReplacementRule.get_prefixed_props(self, filt): + yield prop + if 'moz' in filt: + name = '-moz-' + self.prop.name.replace('top-left-radius', 'radius-topleft') \ + .replace('top-right-radius', 'radius-topright') \ + .replace('bottom-right-radius', 'radius-bottomright') \ + .replace('bottom-left-radius', 'radius-bottomleft') + yield cssutils.css.Property( + name=name, + value=self.prop.value, + priority=self.prop.priority + ) + + +class DisplayReplacementRule(BaseReplacementRule): + """ + Flexible Box Model stuff. + CSSUtils parser doesn't support duplicate properties, so that's dirty. + """ + def get_prefixed_props(self, filt): + if self.prop.value == 'box': # only add prefixes if the value is box + for prefix in [p for p in self.vendor_prefixes if p in filt]: + yield cssutils.css.Property( + name='display', + value='-%s-box' % prefix, + priority=self.prop.priority + ) + + +class TransitionReplacementRule(BaseReplacementRule): + vendor_prefixes = ['moz', 'o', 'webkit'] + + def __get_prefixed_prop(self, prefix=None): + name = self.prop.name + if prefix: + name = '-%s-%s' % (prefix, self.prop.name) + newValues = [] + for value in self.prop.value.split(','): + parts = value.strip().split(' ') + parts[0] = prefixRegex.sub('', parts[0]) + if parts[0] in rules and prefix and rules[parts[0]].should_prefix(): + parts[0] = '-%s-%s' % (prefix, parts[0]) + newValues.append(' '.join(parts)) + return cssutils.css.Property( + name=name, + value=', '.join(newValues), + priority=self.prop.priority + ) + + def get_prefixed_props(self, filt): + for prefix in [p for p in self.vendor_prefixes if p in filt]: + yield self.__get_prefixed_prop(prefix) + + def get_base_prop(self): + return self.__get_prefixed_prop() + + +class GradientReplacementRule(BaseReplacementRule): + vendor_prefixes = ['moz', 'o', 'webkit'] + + def __iter_values(self): + valueSplit = self.prop.value.split(',') + index = 0 + # currentString = '' + while(True): + if index >= len(valueSplit): + break + rawValue = valueSplit[index].strip() + snip = prefixRegex.sub('', rawValue) + if snip.startswith('linear-gradient'): + values = [re.sub('^linear-gradient\(', '', snip)] + if valueSplit[index + 1].strip().endswith(')'): + values.append(re.sub('\)+$', '', valueSplit[index + 1].strip())) + else: + values.append(valueSplit[index + 1].strip()) + values.append(re.sub('\)+$', '', valueSplit[index + 2].strip())) + if len(values) == 2: + yield { + 'start': values[0], + 'end': values[1] + } + else: + yield { + 'pos': values[0], + 'start': values[1], + 'end': values[2] + } + index += len(values) + elif snip.startswith('gradient'): + yield { + 'start': re.sub('\)+$', '', valueSplit[index + 4].strip()), + 'end': re.sub('\)+$', '', valueSplit[index + 6].strip()), + } + index += 7 + else: + # not a gradient so just yield the raw string + yield rawValue + index += 1 + + def __get_prefixed_prop(self, values, prefix=None): + gradientName = 'linear-gradient' + if prefix: + gradientName = '-%s-%s' % (prefix, gradientName) + newValues = [] + for value in values: + if isinstance(value, dict): + if 'pos' in value: + newValues.append(gradientName + '(%(pos)s, %(start)s, %(end)s)' % value) + else: + newValues.append(gradientName + '(%(start)s, %(end)s)' % value) + else: + newValues.append(value) + return cssutils.css.Property( + name=self.prop.name, + value=', '.join(newValues), + priority=self.prop.priority + ) + + def get_prefixed_props(self, filt): + values = list(self.__iter_values()) + needPrefix = False + for value in values: # check if there are any gradients + if isinstance(value, dict): + needPrefix = True + break + if needPrefix: + for prefix in [p for p in self.vendor_prefixes if p in filt]: + yield self.__get_prefixed_prop(values, prefix) + if prefix == 'webkit': + newValues = [] + for value in values: + if isinstance(value, dict): + newValues.append('-webkit-gradient(linear, left top, left bottom, color-stop(0, %(start)s), color-stop(1, %(end)s))' % value) + else: + newValues.append(value) + yield cssutils.css.Property( + name=self.prop.name, + value=', '.join(newValues), + priority=self.prop.priority + ) + else: + yield None + + def get_base_prop(self): + values = self.__iter_values() + return self.__get_prefixed_prop(values) + +rules = { + 'border-radius': BaseReplacementRule, + 'border-top-left-radius': BorderRadiusReplacementRule, + 'border-top-right-radius': BorderRadiusReplacementRule, + 'border-bottom-right-radius': BorderRadiusReplacementRule, + 'border-bottom-left-radius': BorderRadiusReplacementRule, + 'border-image': FullReplacementRule, + 'box-shadow': BaseReplacementRule, + 'box-sizing': MozReplacementRule, + 'box-orient': BaseAndIEReplacementRule, + 'box-direction': BaseAndIEReplacementRule, + 'box-ordinal-group': BaseAndIEReplacementRule, + 'box-align': BaseAndIEReplacementRule, + 'box-flex': BaseAndIEReplacementRule, + 'box-flex-group': BaseReplacementRule, + 'box-pack': BaseAndIEReplacementRule, + 'box-lines': BaseAndIEReplacementRule, + 'user-select': BaseReplacementRule, + 'user-modify': BaseReplacementRule, + 'margin-start': BaseReplacementRule, + 'margin-end': BaseReplacementRule, + 'padding-start': BaseReplacementRule, + 'padding-end': BaseReplacementRule, + 'column-count': BaseReplacementRule, + 'column-gap': BaseReplacementRule, + 'column-rule': BaseReplacementRule, + 'column-rule-color': BaseReplacementRule, + 'column-rule-style': BaseReplacementRule, + 'column-rule-width': BaseReplacementRule, + 'column-span': WebkitReplacementRule, + 'column-width': BaseReplacementRule, + 'columns': WebkitReplacementRule, + + 'background-clip': WebkitReplacementRule, + 'background-origin': WebkitReplacementRule, + 'background-size': WebkitReplacementRule, + 'background-image': GradientReplacementRule, + 'background': GradientReplacementRule, + + 'text-overflow': OperaAndIEReplacementRule, + + 'transition': TransitionReplacementRule, + 'transition-delay': BaseAndOperaReplacementRule, + 'transition-duration': BaseAndOperaReplacementRule, + 'transition-property': TransitionReplacementRule, + 'transition-timing-function': BaseAndOperaReplacementRule, + 'transform': FullReplacementRule, + 'transform-origin': FullReplacementRule, + + 'display': DisplayReplacementRule, + 'appearance': WebkitReplacementRule, + 'hyphens': BaseReplacementRule, +} diff --git a/libs/cssutils/__init__.py b/libs/cssutils/__init__.py new file mode 100755 index 00000000..8157ce57 --- /dev/null +++ b/libs/cssutils/__init__.py @@ -0,0 +1,385 @@ +#!/usr/bin/env python +"""cssutils - CSS Cascading Style Sheets library for Python + + Copyright (C) 2004-2013 Christof Hoeke + + cssutils is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + + +A Python package to parse and build CSS Cascading Style Sheets. DOM only, not +any rendering facilities! + +Based upon and partly implementing the following specifications : + +`CSS 2.1 `__ + General CSS rules and properties are defined here +`CSS 2.1 Errata `__ + A few errata, mainly the definition of CHARSET_SYM tokens +`CSS3 Module: Syntax `__ + Used in parts since cssutils 0.9.4. cssutils tries to use the features from + CSS 2.1 and CSS 3 with preference to CSS3 but as this is not final yet some + parts are from CSS 2.1 +`MediaQueries `__ + MediaQueries are part of ``stylesheets.MediaList`` since v0.9.4, used in + @import and @media rules. +`Namespaces `__ + Added in v0.9.1, updated to definition in CSSOM in v0.9.4, updated in 0.9.5 + for dev version +`CSS3 Module: Pages Media `__ + Most properties of this spec are implemented including MarginRules +`Selectors `__ + The selector syntax defined here (and not in CSS 2.1) should be parsable + with cssutils (*should* mind though ;) ) + +`DOM Level 2 Style CSS `__ + DOM for package css. 0.9.8 removes support for CSSValue and related API, + see PropertyValue and Value API for now +`DOM Level 2 Style Stylesheets `__ + DOM for package stylesheets +`CSSOM `__ + A few details (mainly the NamespaceRule DOM) is taken from here. Plan is + to move implementation to the stuff defined here which is newer but still + no REC so might change anytime... + + +The cssutils tokenizer is a customized implementation of `CSS3 Module: Syntax +(W3C Working Draft 13 August 2003) `__ which +itself is based on the CSS 2.1 tokenizer. It tries to be as compliant as +possible but uses some (helpful) parts of the CSS 2.1 tokenizer. + +I guess cssutils is neither CSS 2.1 nor CSS 3 compliant but tries to at least +be able to parse both grammars including some more real world cases (some CSS +hacks are actually parsed and serialized). Both official grammars are not final +nor bugfree but still feasible. cssutils aim is not to be fully compliant to +any CSS specification (the specifications seem to be in a constant flow anyway) +but cssutils *should* be able to read and write as many as possible CSS +stylesheets "in the wild" while at the same time implement the official APIs +which are well documented. Some minor extensions are provided as well. + +Please visit http://cthedot.de/cssutils/ for more details. + + +Tested with Python 2.7.3 and 3.3 on Windows 8 64bit. + + +This library may be used ``from cssutils import *`` which +import subpackages ``css`` and ``stylesheets``, CSSParser and +CSSSerializer classes only. + +Usage may be:: + + >>> from cssutils import * + >>> parser = CSSParser() + >>> sheet = parser.parseString(u'a { color: red}') + >>> print sheet.cssText + a { + color: red + } + +""" +__all__ = ['css', 'stylesheets', 'CSSParser', 'CSSSerializer'] +__docformat__ = 'restructuredtext' +__author__ = 'Christof Hoeke with contributions by Walter Doerwald' +__date__ = '$LastChangedDate:: $:' + +VERSION = '0.9.10' + +__version__ = '%s $Id$' % VERSION + +import sys +if sys.version_info < (2,6): + bytes = str + +import codec +import os.path +import urllib +import urlparse +import xml.dom + +# order of imports is important (partly circular) +from . import util +import errorhandler +log = errorhandler.ErrorHandler() + +import css +import stylesheets +from parse import CSSParser + +from serialize import CSSSerializer +ser = CSSSerializer() + +from profiles import Profiles +profile = Profiles(log=log) + +# used by Selector defining namespace prefix '*' +_ANYNS = -1 + +class DOMImplementationCSS(object): + """This interface allows the DOM user to create a CSSStyleSheet + outside the context of a document. There is no way to associate + the new CSSStyleSheet with a document in DOM Level 2. + + This class is its *own factory*, as it is given to + xml.dom.registerDOMImplementation which simply calls it and receives + an instance of this class then. + """ + _features = [ + ('css', '1.0'), + ('css', '2.0'), + ('stylesheets', '1.0'), + ('stylesheets', '2.0') + ] + + def createCSSStyleSheet(self, title, media): + """ + Creates a new CSSStyleSheet. + + title of type DOMString + The advisory title. See also the Style Sheet Interfaces + section. + media of type DOMString + The comma-separated list of media associated with the new style + sheet. See also the Style Sheet Interfaces section. + + returns + CSSStyleSheet: A new CSS style sheet. + + TODO: DOMException + SYNTAX_ERR: Raised if the specified media string value has a + syntax error and is unparsable. + """ + return css.CSSStyleSheet(title=title, media=media) + + def createDocument(self, *args): + # not needed to HTML, also not for CSS? + raise NotImplementedError + + def createDocumentType(self, *args): + # not needed to HTML, also not for CSS? + raise NotImplementedError + + def hasFeature(self, feature, version): + return (feature.lower(), unicode(version)) in self._features + +xml.dom.registerDOMImplementation('cssutils', DOMImplementationCSS) + + +def parseString(*a, **k): + return CSSParser().parseString(*a, **k) +parseString.__doc__ = CSSParser.parseString.__doc__ + +def parseFile(*a, **k): + return CSSParser().parseFile(*a, **k) +parseFile.__doc__ = CSSParser.parseFile.__doc__ + +def parseUrl(*a, **k): + return CSSParser().parseUrl(*a, **k) +parseUrl.__doc__ = CSSParser.parseUrl.__doc__ + +def parseStyle(*a, **k): + return CSSParser().parseStyle(*a, **k) +parseStyle.__doc__ = CSSParser.parseStyle.__doc__ + +# set "ser", default serializer +def setSerializer(serializer): + """Set the global serializer used by all class in cssutils.""" + global ser + ser = serializer + +def getUrls(sheet): + """Retrieve all ``url(urlstring)`` values (in e.g. + :class:`cssutils.css.CSSImportRule` or :class:`cssutils.css.CSSValue` + objects of given `sheet`. + + :param sheet: + :class:`cssutils.css.CSSStyleSheet` object whose URLs are yielded + + This function is a generator. The generated URL values exclude ``url(`` and + ``)`` and surrounding single or double quotes. + """ + for importrule in (r for r in sheet if r.type == r.IMPORT_RULE): + yield importrule.href + + def styleDeclarations(base): + "recursive generator to find all CSSStyleDeclarations" + if hasattr(base, 'cssRules'): + for rule in base.cssRules: + for s in styleDeclarations(rule): + yield s + elif hasattr(base, 'style'): + yield base.style + + for style in styleDeclarations(sheet): + for p in style.getProperties(all=True): + for v in p.propertyValue: + if v.type == 'URI': + yield v.uri + +def replaceUrls(sheetOrStyle, replacer, ignoreImportRules=False): + """Replace all URLs in :class:`cssutils.css.CSSImportRule` or + :class:`cssutils.css.CSSValue` objects of given `sheetOrStyle`. + + :param sheetOrStyle: + a :class:`cssutils.css.CSSStyleSheet` or a + :class:`cssutils.css.CSSStyleDeclaration` which is changed in place + :param replacer: + a function which is called with a single argument `url` which + is the current value of each url() excluding ``url(``, ``)`` and + surrounding (single or double) quotes. + :param ignoreImportRules: + if ``True`` does not call `replacer` with URLs from @import rules. + """ + if not ignoreImportRules and not isinstance(sheetOrStyle, + css.CSSStyleDeclaration): + for importrule in (r for r in sheetOrStyle if r.type == r.IMPORT_RULE): + importrule.href = replacer(importrule.href) + + def styleDeclarations(base): + "recursive generator to find all CSSStyleDeclarations" + if hasattr(base, 'cssRules'): + for rule in base.cssRules: + for s in styleDeclarations(rule): + yield s + elif hasattr(base, 'style'): + yield base.style + elif isinstance(sheetOrStyle, css.CSSStyleDeclaration): + # base is a style already + yield base + + for style in styleDeclarations(sheetOrStyle): + for p in style.getProperties(all=True): + for v in p.propertyValue: + if v.type == v.URI: + v.uri = replacer(v.uri) + +def resolveImports(sheet, target=None): + """Recurcively combine all rules in given `sheet` into a `target` sheet. + @import rules which use media information are tried to be wrapped into + @media rules so keeping the media information. This may not work in + all instances (if e.g. an @import rule itself contains an @import rule + with different media infos or if it contains rules which may not be + used inside an @media block like @namespace rules.). In these cases + the @import rule is kept as in the original sheet and a WARNING is issued. + + :param sheet: + in this given :class:`cssutils.css.CSSStyleSheet` all import rules are + resolved and added to a resulting *flat* sheet. + :param target: + A :class:`cssutils.css.CSSStyleSheet` object which will be the + resulting *flat* sheet if given + :returns: given `target` or a new :class:`cssutils.css.CSSStyleSheet` + object + """ + if not target: + target = css.CSSStyleSheet(href=sheet.href, + media=sheet.media, + title=sheet.title) + + def getReplacer(targetbase): + "Return a replacer which uses base to return adjusted URLs" + basesch, baseloc, basepath, basequery, basefrag = urlparse.urlsplit(targetbase) + basepath, basepathfilename = os.path.split(basepath) + + def replacer(uri): + scheme, location, path, query, fragment = urlparse.urlsplit(uri) + if not scheme and not location and not path.startswith(u'/'): + # relative + path, filename = os.path.split(path) + combined = os.path.normpath(os.path.join(basepath, path, filename)) + return urllib.pathname2url(combined) + else: + # keep anything absolute + return uri + + return replacer + + for rule in sheet.cssRules: + if rule.type == rule.CHARSET_RULE: + pass + elif rule.type == rule.IMPORT_RULE: + log.info(u'Processing @import %r' % rule.href, neverraise=True) + + if rule.hrefFound: + # add all rules of @import to current sheet + target.add(css.CSSComment(cssText=u'/* START @import "%s" */' + % rule.href)) + + try: + # nested imports + importedSheet = resolveImports(rule.styleSheet) + except xml.dom.HierarchyRequestErr, e: + log.warn(u'@import: Cannot resolve target, keeping rule: %s' + % e, neverraise=True) + target.add(rule) + else: + # adjust relative URI references + log.info(u'@import: Adjusting paths for %r' % rule.href, + neverraise=True) + replaceUrls(importedSheet, + getReplacer(rule.href), + ignoreImportRules=True) + + # might have to wrap rules in @media if media given + if rule.media.mediaText == u'all': + mediaproxy = None + else: + keepimport = False + for r in importedSheet: + # check if rules present which may not be + # combined with media + if r.type not in (r.COMMENT, + r.STYLE_RULE, + r.IMPORT_RULE): + keepimport = True + break + if keepimport: + log.warn(u'Cannot combine imported sheet with' + u' given media as other rules then' + u' comments or stylerules found %r,' + u' keeping %r' % (r, + rule.cssText), + neverraise=True) + target.add(rule) + continue + + # wrap in @media if media is not `all` + log.info(u'@import: Wrapping some rules in @media ' + u' to keep media: %s' + % rule.media.mediaText, neverraise=True) + mediaproxy = css.CSSMediaRule(rule.media.mediaText) + + for r in importedSheet: + if mediaproxy: + mediaproxy.add(r) + else: + # add to top sheet directly but are difficult anyway + target.add(r) + + if mediaproxy: + target.add(mediaproxy) + + else: + # keep @import as it is + log.error(u'Cannot get referenced stylesheet %r, keeping rule' + % rule.href, neverraise=True) + target.add(rule) + + else: + target.add(rule) + + return target + + +if __name__ == '__main__': + print __doc__ diff --git a/libs/cssutils/_codec2.py b/libs/cssutils/_codec2.py new file mode 100755 index 00000000..d0ae617f --- /dev/null +++ b/libs/cssutils/_codec2.py @@ -0,0 +1,584 @@ +#!/usr/bin/env python +"""Python codec for CSS.""" +__docformat__ = 'restructuredtext' +__author__ = 'Walter Doerwald' +__version__ = '$Id: util.py 1114 2008-03-05 13:22:59Z cthedot $' + +import codecs +import marshal + +# We're using bits to store all possible candidate encodings (or variants, i.e. +# we have two bits for the variants of UTF-16 and two for the +# variants of UTF-32). +# +# Prefixes for various CSS encodings +# UTF-8-SIG xEF xBB xBF +# UTF-16 (LE) xFF xFE ~x00|~x00 +# UTF-16 (BE) xFE xFF +# UTF-16-LE @ x00 @ x00 +# UTF-16-BE x00 @ +# UTF-32 (LE) xFF xFE x00 x00 +# UTF-32 (BE) x00 x00 xFE xFF +# UTF-32-LE @ x00 x00 x00 +# UTF-32-BE x00 x00 x00 @ +# CHARSET @ c h a ... + + +def detectencoding_str(input, final=False): + """ + Detect the encoding of the byte string ``input``, which contains the + beginning of a CSS file. This function returns the detected encoding (or + ``None`` if it hasn't got enough data), and a flag that indicates whether + that encoding has been detected explicitely or implicitely. To detect the + encoding the first few bytes are used (or if ``input`` is ASCII compatible + and starts with a charset rule the encoding name from the rule). "Explicit" + detection means that the bytes start with a BOM or a charset rule. + + If the encoding can't be detected yet, ``None`` is returned as the encoding. + ``final`` specifies whether more data will be available in later calls or + not. If ``final`` is true, ``detectencoding_str()`` will never return + ``None`` as the encoding. + """ + + # A bit for every candidate + CANDIDATE_UTF_8_SIG = 1 + CANDIDATE_UTF_16_AS_LE = 2 + CANDIDATE_UTF_16_AS_BE = 4 + CANDIDATE_UTF_16_LE = 8 + CANDIDATE_UTF_16_BE = 16 + CANDIDATE_UTF_32_AS_LE = 32 + CANDIDATE_UTF_32_AS_BE = 64 + CANDIDATE_UTF_32_LE = 128 + CANDIDATE_UTF_32_BE = 256 + CANDIDATE_CHARSET = 512 + + candidates = 1023 # all candidates + + li = len(input) + if li>=1: + # Check first byte + c = input[0] + if c != "\xef": + candidates &= ~CANDIDATE_UTF_8_SIG + if c != "\xff": + candidates &= ~(CANDIDATE_UTF_32_AS_LE|CANDIDATE_UTF_16_AS_LE) + if c != "\xfe": + candidates &= ~CANDIDATE_UTF_16_AS_BE + if c != "@": + candidates &= ~(CANDIDATE_UTF_32_LE|CANDIDATE_UTF_16_LE|CANDIDATE_CHARSET) + if c != "\x00": + candidates &= ~(CANDIDATE_UTF_32_AS_BE|CANDIDATE_UTF_32_BE|CANDIDATE_UTF_16_BE) + if li>=2: + # Check second byte + c = input[1] + if c != "\xbb": + candidates &= ~CANDIDATE_UTF_8_SIG + if c != "\xfe": + candidates &= ~(CANDIDATE_UTF_16_AS_LE|CANDIDATE_UTF_32_AS_LE) + if c != "\xff": + candidates &= ~CANDIDATE_UTF_16_AS_BE + if c != "\x00": + candidates &= ~(CANDIDATE_UTF_16_LE|CANDIDATE_UTF_32_AS_BE|CANDIDATE_UTF_32_LE|CANDIDATE_UTF_32_BE) + if c != "@": + candidates &= ~CANDIDATE_UTF_16_BE + if c != "c": + candidates &= ~CANDIDATE_CHARSET + if li>=3: + # Check third byte + c = input[2] + if c != "\xbf": + candidates &= ~CANDIDATE_UTF_8_SIG + if c != "c": + candidates &= ~CANDIDATE_UTF_16_LE + if c != "\x00": + candidates &= ~(CANDIDATE_UTF_32_AS_LE|CANDIDATE_UTF_32_LE|CANDIDATE_UTF_32_BE) + if c != "\xfe": + candidates &= ~CANDIDATE_UTF_32_AS_BE + if c != "h": + candidates &= ~CANDIDATE_CHARSET + if li>=4: + # Check fourth byte + c = input[3] + if input[2:4] == "\x00\x00": + candidates &= ~CANDIDATE_UTF_16_AS_LE + if c != "\x00": + candidates &= ~(CANDIDATE_UTF_16_LE|CANDIDATE_UTF_32_AS_LE|CANDIDATE_UTF_32_LE) + if c != "\xff": + candidates &= ~CANDIDATE_UTF_32_AS_BE + if c != "@": + candidates &= ~CANDIDATE_UTF_32_BE + if c != "a": + candidates &= ~CANDIDATE_CHARSET + if candidates == 0: + return ("utf-8", False) + if not (candidates & (candidates-1)): # only one candidate remaining + if candidates == CANDIDATE_UTF_8_SIG and li >= 3: + return ("utf-8-sig", True) + elif candidates == CANDIDATE_UTF_16_AS_LE and li >= 2: + return ("utf-16", True) + elif candidates == CANDIDATE_UTF_16_AS_BE and li >= 2: + return ("utf-16", True) + elif candidates == CANDIDATE_UTF_16_LE and li >= 4: + return ("utf-16-le", False) + elif candidates == CANDIDATE_UTF_16_BE and li >= 2: + return ("utf-16-be", False) + elif candidates == CANDIDATE_UTF_32_AS_LE and li >= 4: + return ("utf-32", True) + elif candidates == CANDIDATE_UTF_32_AS_BE and li >= 4: + return ("utf-32", True) + elif candidates == CANDIDATE_UTF_32_LE and li >= 4: + return ("utf-32-le", False) + elif candidates == CANDIDATE_UTF_32_BE and li >= 4: + return ("utf-32-be", False) + elif candidates == CANDIDATE_CHARSET and li >= 4: + prefix = '@charset "' + if input[:len(prefix)] == prefix: + pos = input.find('"', len(prefix)) + if pos >= 0: + return (input[len(prefix):pos], True) + # if this is the last call, and we haven't determined an encoding yet, + # we default to UTF-8 + if final: + return ("utf-8", False) + return (None, False) # dont' know yet + + +def detectencoding_unicode(input, final=False): + """ + Detect the encoding of the unicode string ``input``, which contains the + beginning of a CSS file. The encoding is detected from the charset rule + at the beginning of ``input``. If there is no charset rule, ``"utf-8"`` + will be returned. + + If the encoding can't be detected yet, ``None`` is returned. ``final`` + specifies whether more data will be available in later calls or not. If + ``final`` is true, ``detectencoding_unicode()`` will never return ``None``. + """ + prefix = u'@charset "' + if input.startswith(prefix): + pos = input.find(u'"', len(prefix)) + if pos >= 0: + return (input[len(prefix):pos], True) + elif final or not prefix.startswith(input): + # if this is the last call, and we haven't determined an encoding yet, + # (or the string definitely doesn't start with prefix) we default to UTF-8 + return ("utf-8", False) + return (None, False) # don't know yet + + +def _fixencoding(input, encoding, final=False): + """ + Replace the name of the encoding in the charset rule at the beginning of + ``input`` with ``encoding``. If ``input`` doesn't starts with a charset + rule, ``input`` will be returned unmodified. + + If the encoding can't be found yet, ``None`` is returned. ``final`` + specifies whether more data will be available in later calls or not. + If ``final`` is true, ``_fixencoding()`` will never return ``None``. + """ + prefix = u'@charset "' + if len(input) > len(prefix): + if input.startswith(prefix): + pos = input.find(u'"', len(prefix)) + if pos >= 0: + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = u"utf-8" + return prefix + encoding + input[pos:] + # we haven't seen the end of the encoding name yet => fall through + else: + return input # doesn't start with prefix, so nothing to fix + elif not prefix.startswith(input) or final: + # can't turn out to be a @charset rule later (or there is no "later") + return input + if final: + return input + return None # don't know yet + + +def decode(input, errors="strict", encoding=None, force=True): + if encoding is None or not force: + (_encoding, explicit) = detectencoding_str(input, True) + if _encoding == "css": + raise ValueError("css not allowed as encoding name") + if (explicit and not force) or encoding is None: # Take the encoding from the input + encoding = _encoding + (input, consumed) = codecs.getdecoder(encoding)(input, errors) + return (_fixencoding(input, unicode(encoding), True), consumed) + + +def encode(input, errors="strict", encoding=None): + consumed = len(input) + if encoding is None: + encoding = detectencoding_unicode(input, True)[0] + if encoding.replace("_", "-").lower() == "utf-8-sig": + input = _fixencoding(input, u"utf-8", True) + else: + input = _fixencoding(input, unicode(encoding), True) + if encoding == "css": + raise ValueError("css not allowed as encoding name") + encoder = codecs.getencoder(encoding) + return (encoder(input, errors)[0], consumed) + + +def _bytes2int(bytes): + # Helper: convert an 8 bit string into an ``int``. + i = 0 + for byte in bytes: + i = (i<<8) + ord(byte) + return i + + +def _int2bytes(i): + # Helper: convert an ``int`` into an 8-bit string. + v = [] + while i: + v.insert(0, chr(i&0xff)) + i >>= 8 + return "".join(v) + + +if hasattr(codecs, "IncrementalDecoder"): + class IncrementalDecoder(codecs.IncrementalDecoder): + def __init__(self, errors="strict", encoding=None, force=True): + self.decoder = None + self.encoding = encoding + self.force = force + codecs.IncrementalDecoder.__init__(self, errors) + # Store ``errors`` somewhere else, + # because we have to hide it in a property + self._errors = errors + self.buffer = u"".encode() + self.headerfixed = False + + def iterdecode(self, input): + for part in input: + result = self.decode(part, False) + if result: + yield result + result = self.decode("", True) + if result: + yield result + + def decode(self, input, final=False): + # We're doing basically the same as a ``BufferedIncrementalDecoder``, + # but since the buffer is only relevant until the encoding has been + # detected (in which case the buffer of the underlying codec might + # kick in), we're implementing buffering ourselves to avoid some + # overhead. + if self.decoder is None: + input = self.buffer + input + # Do we have to detect the encoding from the input? + if self.encoding is None or not self.force: + (encoding, explicit) = detectencoding_str(input, final) + if encoding is None: # no encoding determined yet + self.buffer = input # retry the complete input on the next call + return u"" # no encoding determined yet, so no output + elif encoding == "css": + raise ValueError("css not allowed as encoding name") + if (explicit and not self.force) or self.encoding is None: # Take the encoding from the input + self.encoding = encoding + self.buffer = "" # drop buffer, as the decoder might keep its own + decoder = codecs.getincrementaldecoder(self.encoding) + self.decoder = decoder(self._errors) + if self.headerfixed: + return self.decoder.decode(input, final) + # If we haven't fixed the header yet, + # the content of ``self.buffer`` is a ``unicode`` object + output = self.buffer + self.decoder.decode(input, final) + encoding = self.encoding + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = "utf-8" + newoutput = _fixencoding(output, unicode(encoding), final) + if newoutput is None: + # retry fixing the @charset rule (but keep the decoded stuff) + self.buffer = output + return u"" + self.headerfixed = True + return newoutput + + def reset(self): + codecs.IncrementalDecoder.reset(self) + self.decoder = None + self.buffer = u"".encode() + self.headerfixed = False + + def _geterrors(self): + return self._errors + + def _seterrors(self, errors): + # Setting ``errors`` must be done on the real decoder too + if self.decoder is not None: + self.decoder.errors = errors + self._errors = errors + errors = property(_geterrors, _seterrors) + + def getstate(self): + if self.decoder is not None: + state = (self.encoding, self.buffer, self.headerfixed, True, self.decoder.getstate()) + else: + state = (self.encoding, self.buffer, self.headerfixed, False, None) + return ("", _bytes2int(marshal.dumps(state))) + + def setstate(self, state): + state = _int2bytes(marshal.loads(state[1])) # ignore buffered input + self.encoding = state[0] + self.buffer = state[1] + self.headerfixed = state[2] + if state[3] is not None: + self.decoder = codecs.getincrementaldecoder(self.encoding)(self._errors) + self.decoder.setstate(state[4]) + else: + self.decoder = None + + +if hasattr(codecs, "IncrementalEncoder"): + class IncrementalEncoder(codecs.IncrementalEncoder): + def __init__(self, errors="strict", encoding=None): + self.encoder = None + self.encoding = encoding + codecs.IncrementalEncoder.__init__(self, errors) + # Store ``errors`` somewhere else, + # because we have to hide it in a property + self._errors = errors + self.buffer = u"" + + def iterencode(self, input): + for part in input: + result = self.encode(part, False) + if result: + yield result + result = self.encode(u"", True) + if result: + yield result + + def encode(self, input, final=False): + if self.encoder is None: + input = self.buffer + input + if self.encoding is not None: + # Replace encoding in the @charset rule with the specified one + encoding = self.encoding + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = "utf-8" + newinput = _fixencoding(input, unicode(encoding), final) + if newinput is None: # @charset rule incomplete => Retry next time + self.buffer = input + return "" + input = newinput + else: + # Use encoding from the @charset declaration + self.encoding = detectencoding_unicode(input, final)[0] + if self.encoding is not None: + if self.encoding == "css": + raise ValueError("css not allowed as encoding name") + info = codecs.lookup(self.encoding) + encoding = self.encoding + if self.encoding.replace("_", "-").lower() == "utf-8-sig": + input = _fixencoding(input, u"utf-8", True) + self.encoder = info.incrementalencoder(self._errors) + self.buffer = u"" + else: + self.buffer = input + return "" + return self.encoder.encode(input, final) + + def reset(self): + codecs.IncrementalEncoder.reset(self) + self.encoder = None + self.buffer = u"" + + def _geterrors(self): + return self._errors + + def _seterrors(self, errors): + # Setting ``errors ``must be done on the real encoder too + if self.encoder is not None: + self.encoder.errors = errors + self._errors = errors + errors = property(_geterrors, _seterrors) + + def getstate(self): + if self.encoder is not None: + state = (self.encoding, self.buffer, True, self.encoder.getstate()) + else: + state = (self.encoding, self.buffer, False, None) + return _bytes2int(marshal.dumps(state)) + + def setstate(self, state): + state = _int2bytes(marshal.loads(state)) + self.encoding = state[0] + self.buffer = state[1] + if state[2] is not None: + self.encoder = codecs.getincrementalencoder(self.encoding)(self._errors) + self.encoder.setstate(state[4]) + else: + self.encoder = None + + +class StreamWriter(codecs.StreamWriter): + def __init__(self, stream, errors="strict", encoding=None, header=False): + codecs.StreamWriter.__init__(self, stream, errors) + self.streamwriter = None + self.encoding = encoding + self._errors = errors + self.buffer = u"" + + def encode(self, input, errors='strict'): + li = len(input) + if self.streamwriter is None: + input = self.buffer + input + li = len(input) + if self.encoding is not None: + # Replace encoding in the @charset rule with the specified one + encoding = self.encoding + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = "utf-8" + newinput = _fixencoding(input, unicode(encoding), False) + if newinput is None: # @charset rule incomplete => Retry next time + self.buffer = input + return ("", 0) + input = newinput + else: + # Use encoding from the @charset declaration + self.encoding = detectencoding_unicode(input, False)[0] + if self.encoding is not None: + if self.encoding == "css": + raise ValueError("css not allowed as encoding name") + self.streamwriter = codecs.getwriter(self.encoding)(self.stream, self._errors) + encoding = self.encoding + if self.encoding.replace("_", "-").lower() == "utf-8-sig": + input = _fixencoding(input, u"utf-8", True) + self.buffer = u"" + else: + self.buffer = input + return ("", 0) + return (self.streamwriter.encode(input, errors)[0], li) + + def _geterrors(self): + return self._errors + + def _seterrors(self, errors): + # Setting ``errors`` must be done on the streamwriter too + if self.streamwriter is not None: + self.streamwriter.errors = errors + self._errors = errors + + errors = property(_geterrors, _seterrors) + + +class StreamReader(codecs.StreamReader): + def __init__(self, stream, errors="strict", encoding=None, force=True): + codecs.StreamReader.__init__(self, stream, errors) + self.streamreader = None + self.encoding = encoding + self.force = force + self._errors = errors + + def decode(self, input, errors='strict'): + if self.streamreader is None: + if self.encoding is None or not self.force: + (encoding, explicit) = detectencoding_str(input, False) + if encoding is None: # no encoding determined yet + return (u"", 0) # no encoding determined yet, so no output + elif encoding == "css": + raise ValueError("css not allowed as encoding name") + if (explicit and not self.force) or self.encoding is None: # Take the encoding from the input + self.encoding = encoding + streamreader = codecs.getreader(self.encoding) + streamreader = streamreader(self.stream, self._errors) + (output, consumed) = streamreader.decode(input, errors) + encoding = self.encoding + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = "utf-8" + newoutput = _fixencoding(output, unicode(encoding), False) + if newoutput is not None: + self.streamreader = streamreader + return (newoutput, consumed) + return (u"", 0) # we will create a new streamreader on the next call + return self.streamreader.decode(input, errors) + + def _geterrors(self): + return self._errors + + def _seterrors(self, errors): + # Setting ``errors`` must be done on the streamreader too + if self.streamreader is not None: + self.streamreader.errors = errors + self._errors = errors + + errors = property(_geterrors, _seterrors) + + +if hasattr(codecs, "CodecInfo"): + # We're running on Python 2.5 or better + def search_function(name): + if name == "css": + return codecs.CodecInfo( + name="css", + encode=encode, + decode=decode, + incrementalencoder=IncrementalEncoder, + incrementaldecoder=IncrementalDecoder, + streamwriter=StreamWriter, + streamreader=StreamReader, + ) +else: + # If we're running on Python 2.4, define the utf-8-sig codec here + def utf8sig_encode(input, errors='strict'): + return (codecs.BOM_UTF8 + codecs.utf_8_encode(input, errors)[0], len(input)) + + def utf8sig_decode(input, errors='strict'): + prefix = 0 + if input[:3] == codecs.BOM_UTF8: + input = input[3:] + prefix = 3 + (output, consumed) = codecs.utf_8_decode(input, errors, True) + return (output, consumed+prefix) + + class UTF8SigStreamWriter(codecs.StreamWriter): + def reset(self): + codecs.StreamWriter.reset(self) + try: + del self.encode + except AttributeError: + pass + + def encode(self, input, errors='strict'): + self.encode = codecs.utf_8_encode + return utf8sig_encode(input, errors) + + class UTF8SigStreamReader(codecs.StreamReader): + def reset(self): + codecs.StreamReader.reset(self) + try: + del self.decode + except AttributeError: + pass + + def decode(self, input, errors='strict'): + if len(input) < 3 and codecs.BOM_UTF8.startswith(input): + # not enough data to decide if this is a BOM + # => try again on the next call + return (u"", 0) + self.decode = codecs.utf_8_decode + return utf8sig_decode(input, errors) + + def search_function(name): + import encodings + name = encodings.normalize_encoding(name) + if name == "css": + return (encode, decode, StreamReader, StreamWriter) + elif name == "utf_8_sig": + return (utf8sig_encode, utf8sig_decode, UTF8SigStreamReader, UTF8SigStreamWriter) + + +codecs.register(search_function) + + +# Error handler for CSS escaping + +def cssescape(exc): + if not isinstance(exc, UnicodeEncodeError): + raise TypeError("don't know how to handle %r" % exc) + return (u"".join(u"\\%06x" % ord(c) for c in exc.object[exc.start:exc.end]), exc.end) + +codecs.register_error("cssescape", cssescape) diff --git a/libs/cssutils/_codec3.py b/libs/cssutils/_codec3.py new file mode 100755 index 00000000..878a7b29 --- /dev/null +++ b/libs/cssutils/_codec3.py @@ -0,0 +1,608 @@ +#!/usr/bin/env python +"""Python codec for CSS.""" +__docformat__ = 'restructuredtext' +__author__ = 'Walter Doerwald' +__version__ = '$Id: util.py 1114 2008-03-05 13:22:59Z cthedot $' + +import sys +import codecs +import marshal + +# We're using bits to store all possible candidate encodings (or variants, i.e. +# we have two bits for the variants of UTF-16 and two for the +# variants of UTF-32). +# +# Prefixes for various CSS encodings +# UTF-8-SIG xEF xBB xBF +# UTF-16 (LE) xFF xFE ~x00|~x00 +# UTF-16 (BE) xFE xFF +# UTF-16-LE @ x00 @ x00 +# UTF-16-BE x00 @ +# UTF-32 (LE) xFF xFE x00 x00 +# UTF-32 (BE) x00 x00 xFE xFF +# UTF-32-LE @ x00 x00 x00 +# UTF-32-BE x00 x00 x00 @ +# CHARSET @ c h a ... + + +def chars(bytestring): + return ''.join(chr(byte) for byte in bytestring) + + +def detectencoding_str(input, final=False): + """ + Detect the encoding of the byte string ``input``, which contains the + beginning of a CSS file. This function returns the detected encoding (or + ``None`` if it hasn't got enough data), and a flag that indicates whether + that encoding has been detected explicitely or implicitely. To detect the + encoding the first few bytes are used (or if ``input`` is ASCII compatible + and starts with a charset rule the encoding name from the rule). "Explicit" + detection means that the bytes start with a BOM or a charset rule. + + If the encoding can't be detected yet, ``None`` is returned as the encoding. + ``final`` specifies whether more data will be available in later calls or + not. If ``final`` is true, ``detectencoding_str()`` will never return + ``None`` as the encoding. + """ + + # A bit for every candidate + CANDIDATE_UTF_8_SIG = 1 + CANDIDATE_UTF_16_AS_LE = 2 + CANDIDATE_UTF_16_AS_BE = 4 + CANDIDATE_UTF_16_LE = 8 + CANDIDATE_UTF_16_BE = 16 + CANDIDATE_UTF_32_AS_LE = 32 + CANDIDATE_UTF_32_AS_BE = 64 + CANDIDATE_UTF_32_LE = 128 + CANDIDATE_UTF_32_BE = 256 + CANDIDATE_CHARSET = 512 + + candidates = 1023 # all candidates + + #input = chars(input) + li = len(input) + if li>=1: + # Check first byte + c = input[0] + if c != b"\xef"[0]: + candidates &= ~CANDIDATE_UTF_8_SIG + if c != b"\xff"[0]: + candidates &= ~(CANDIDATE_UTF_32_AS_LE|CANDIDATE_UTF_16_AS_LE) + if c != b"\xfe"[0]: + candidates &= ~CANDIDATE_UTF_16_AS_BE + if c != b"@"[0]: + candidates &= ~(CANDIDATE_UTF_32_LE|CANDIDATE_UTF_16_LE|CANDIDATE_CHARSET) + if c != b"\x00"[0]: + candidates &= ~(CANDIDATE_UTF_32_AS_BE|CANDIDATE_UTF_32_BE|CANDIDATE_UTF_16_BE) + if li>=2: + # Check second byte + c = input[1] + if c != b"\xbb"[0]: + candidates &= ~CANDIDATE_UTF_8_SIG + if c != b"\xfe"[0]: + candidates &= ~(CANDIDATE_UTF_16_AS_LE|CANDIDATE_UTF_32_AS_LE) + if c != b"\xff"[0]: + candidates &= ~CANDIDATE_UTF_16_AS_BE + if c != b"\x00"[0]: + candidates &= ~(CANDIDATE_UTF_16_LE|CANDIDATE_UTF_32_AS_BE|CANDIDATE_UTF_32_LE|CANDIDATE_UTF_32_BE) + if c != b"@"[0]: + candidates &= ~CANDIDATE_UTF_16_BE + if c != b"c"[0]: + candidates &= ~CANDIDATE_CHARSET + if li>=3: + # Check third byte + c = input[2] + if c != b"\xbf"[0]: + candidates &= ~CANDIDATE_UTF_8_SIG + if c != b"c"[0]: + candidates &= ~CANDIDATE_UTF_16_LE + if c != b"\x00"[0]: + candidates &= ~(CANDIDATE_UTF_32_AS_LE|CANDIDATE_UTF_32_LE|CANDIDATE_UTF_32_BE) + if c != b"\xfe"[0]: + candidates &= ~CANDIDATE_UTF_32_AS_BE + if c != b"h"[0]: + candidates &= ~CANDIDATE_CHARSET + if li>=4: + # Check fourth byte + c = input[3] + if input[2:4] == b"\x00\x00"[0:2]: + candidates &= ~CANDIDATE_UTF_16_AS_LE + if c != b"\x00"[0]: + candidates &= ~(CANDIDATE_UTF_16_LE|CANDIDATE_UTF_32_AS_LE|CANDIDATE_UTF_32_LE) + if c != b"\xff"[0]: + candidates &= ~CANDIDATE_UTF_32_AS_BE + if c != b"@"[0]: + candidates &= ~CANDIDATE_UTF_32_BE + if c != b"a"[0]: + candidates &= ~CANDIDATE_CHARSET + if candidates == 0: + return ("utf-8", False) + if not (candidates & (candidates-1)): # only one candidate remaining + if candidates == CANDIDATE_UTF_8_SIG and li >= 3: + return ("utf-8-sig", True) + elif candidates == CANDIDATE_UTF_16_AS_LE and li >= 2: + return ("utf-16", True) + elif candidates == CANDIDATE_UTF_16_AS_BE and li >= 2: + return ("utf-16", True) + elif candidates == CANDIDATE_UTF_16_LE and li >= 4: + return ("utf-16-le", False) + elif candidates == CANDIDATE_UTF_16_BE and li >= 2: + return ("utf-16-be", False) + elif candidates == CANDIDATE_UTF_32_AS_LE and li >= 4: + return ("utf-32", True) + elif candidates == CANDIDATE_UTF_32_AS_BE and li >= 4: + return ("utf-32", True) + elif candidates == CANDIDATE_UTF_32_LE and li >= 4: + return ("utf-32-le", False) + elif candidates == CANDIDATE_UTF_32_BE and li >= 4: + return ("utf-32-be", False) + elif candidates == CANDIDATE_CHARSET and li >= 4: + prefix = '@charset "' + charsinput = chars(input) + if charsinput[:len(prefix)] == prefix: + pos = charsinput.find('"', len(prefix)) + if pos >= 0: + # TODO: return str and not bytes! + return (charsinput[len(prefix):pos], True) + # if this is the last call, and we haven't determined an encoding yet, + # we default to UTF-8 + if final: + return ("utf-8", False) + return (None, False) # dont' know yet + + +def detectencoding_unicode(input, final=False): + """ + Detect the encoding of the unicode string ``input``, which contains the + beginning of a CSS file. The encoding is detected from the charset rule + at the beginning of ``input``. If there is no charset rule, ``"utf-8"`` + will be returned. + + If the encoding can't be detected yet, ``None`` is returned. ``final`` + specifies whether more data will be available in later calls or not. If + ``final`` is true, ``detectencoding_unicode()`` will never return ``None``. + """ + prefix = '@charset "' + if input.startswith(prefix): + pos = input.find('"', len(prefix)) + if pos >= 0: + return (input[len(prefix):pos], True) + elif final or not prefix.startswith(input): + # if this is the last call, and we haven't determined an encoding yet, + # (or the string definitely doesn't start with prefix) we default to UTF-8 + return ("utf-8", False) + return (None, False) # don't know yet + + +def _fixencoding(input, encoding, final=False): + """ + Replace the name of the encoding in the charset rule at the beginning of + ``input`` with ``encoding``. If ``input`` doesn't starts with a charset + rule, ``input`` will be returned unmodified. + + If the encoding can't be found yet, ``None`` is returned. ``final`` + specifies whether more data will be available in later calls or not. + If ``final`` is true, ``_fixencoding()`` will never return ``None``. + """ + prefix = '@charset "' + if len(input) > len(prefix): + if input.startswith(prefix): + pos = input.find('"', len(prefix)) + if pos >= 0: + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = "utf-8" + return prefix + encoding + input[pos:] + # we haven't seen the end of the encoding name yet => fall through + else: + return input # doesn't start with prefix, so nothing to fix + elif not prefix.startswith(input) or final: + # can't turn out to be a @charset rule later (or there is no "later") + return input + if final: + return input + return None # don't know yet + + +def decode(input, errors="strict", encoding=None, force=True): + try: + # py 3 only, memory?! object to bytes + input = input.tobytes() + except AttributeError as e: + pass + + if encoding is None or not force: + (_encoding, explicit) = detectencoding_str(input, True) + if _encoding == "css": + raise ValueError("css not allowed as encoding name") + if (explicit and not force) or encoding is None: # Take the encoding from the input + encoding = _encoding + + # NEEDS: change in parse.py (str to bytes!) + (input, consumed) = codecs.getdecoder(encoding)(input, errors) + return (_fixencoding(input, str(encoding), True), consumed) + + +def encode(input, errors="strict", encoding=None): + consumed = len(input) + if encoding is None: + encoding = detectencoding_unicode(input, True)[0] + if encoding.replace("_", "-").lower() == "utf-8-sig": + input = _fixencoding(input, "utf-8", True) + else: + input = _fixencoding(input, str(encoding), True) + if encoding == "css": + raise ValueError("css not allowed as encoding name") + encoder = codecs.getencoder(encoding) + return (encoder(input, errors)[0], consumed) + + +def _bytes2int(bytes): + # Helper: convert an 8 bit string into an ``int``. + i = 0 + for byte in bytes: + i = (i<<8) + ord(byte) + return i + + +def _int2bytes(i): + # Helper: convert an ``int`` into an 8-bit string. + v = [] + while i: + v.insert(0, chr(i&0xff)) + i >>= 8 + return "".join(v) + + +if hasattr(codecs, "IncrementalDecoder"): + class IncrementalDecoder(codecs.IncrementalDecoder): + def __init__(self, errors="strict", encoding=None, force=True): + self.decoder = None + self.encoding = encoding + self.force = force + codecs.IncrementalDecoder.__init__(self, errors) + # Store ``errors`` somewhere else, + # because we have to hide it in a property + self._errors = errors + self.buffer = b"" + self.headerfixed = False + + def iterdecode(self, input): + for part in input: + result = self.decode(part, False) + if result: + yield result + result = self.decode("", True) + if result: + yield result + + def decode(self, input, final=False): + # We're doing basically the same as a ``BufferedIncrementalDecoder``, + # but since the buffer is only relevant until the encoding has been + # detected (in which case the buffer of the underlying codec might + # kick in), we're implementing buffering ourselves to avoid some + # overhead. + if self.decoder is None: + input = self.buffer + input + # Do we have to detect the encoding from the input? + if self.encoding is None or not self.force: + (encoding, explicit) = detectencoding_str(input, final) + if encoding is None: # no encoding determined yet + self.buffer = input # retry the complete input on the next call + return "" # no encoding determined yet, so no output + elif encoding == "css": + raise ValueError("css not allowed as encoding name") + if (explicit and not self.force) or self.encoding is None: # Take the encoding from the input + self.encoding = encoding + self.buffer = "" # drop buffer, as the decoder might keep its own + decoder = codecs.getincrementaldecoder(self.encoding) + self.decoder = decoder(self._errors) + if self.headerfixed: + return self.decoder.decode(input, final) + # If we haven't fixed the header yet, + # the content of ``self.buffer`` is a ``unicode`` object + output = self.buffer + self.decoder.decode(input, final) + encoding = self.encoding + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = "utf-8" + newoutput = _fixencoding(output, str(encoding), final) + if newoutput is None: + # retry fixing the @charset rule (but keep the decoded stuff) + self.buffer = output + return "" + self.headerfixed = True + return newoutput + + def reset(self): + codecs.IncrementalDecoder.reset(self) + self.decoder = None + self.buffer = b"" + self.headerfixed = False + + def _geterrors(self): + return self._errors + + def _seterrors(self, errors): + # Setting ``errors`` must be done on the real decoder too + if self.decoder is not None: + self.decoder.errors = errors + self._errors = errors + errors = property(_geterrors, _seterrors) + + def getstate(self): + if self.decoder is not None: + state = (self.encoding, self.buffer, self.headerfixed, True, self.decoder.getstate()) + else: + state = (self.encoding, self.buffer, self.headerfixed, False, None) + return ("", _bytes2int(marshal.dumps(state))) + + def setstate(self, state): + state = _int2bytes(marshal.loads(state[1])) # ignore buffered input + self.encoding = state[0] + self.buffer = state[1] + self.headerfixed = state[2] + if state[3] is not None: + self.decoder = codecs.getincrementaldecoder(self.encoding)(self._errors) + self.decoder.setstate(state[4]) + else: + self.decoder = None + + +if hasattr(codecs, "IncrementalEncoder"): + class IncrementalEncoder(codecs.IncrementalEncoder): + def __init__(self, errors="strict", encoding=None): + self.encoder = None + self.encoding = encoding + codecs.IncrementalEncoder.__init__(self, errors) + # Store ``errors`` somewhere else, + # because we have to hide it in a property + self._errors = errors + self.buffer = "" + + def iterencode(self, input): + for part in input: + result = self.encode(part, False) + if result: + yield result + result = self.encode("", True) + if result: + yield result + + def encode(self, input, final=False): + if self.encoder is None: + input = self.buffer + input + if self.encoding is not None: + # Replace encoding in the @charset rule with the specified one + encoding = self.encoding + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = "utf-8" + newinput = _fixencoding(input, str(encoding), final) + if newinput is None: # @charset rule incomplete => Retry next time + self.buffer = input + return "" + input = newinput + else: + # Use encoding from the @charset declaration + self.encoding = detectencoding_unicode(input, final)[0] + if self.encoding is not None: + if self.encoding == "css": + raise ValueError("css not allowed as encoding name") + info = codecs.lookup(self.encoding) + encoding = self.encoding + if self.encoding.replace("_", "-").lower() == "utf-8-sig": + input = _fixencoding(input, "utf-8", True) + self.encoder = info.incrementalencoder(self._errors) + self.buffer = "" + else: + self.buffer = input + return "" + return self.encoder.encode(input, final) + + def reset(self): + codecs.IncrementalEncoder.reset(self) + self.encoder = None + self.buffer = "" + + def _geterrors(self): + return self._errors + + def _seterrors(self, errors): + # Setting ``errors ``must be done on the real encoder too + if self.encoder is not None: + self.encoder.errors = errors + self._errors = errors + errors = property(_geterrors, _seterrors) + + def getstate(self): + if self.encoder is not None: + state = (self.encoding, self.buffer, True, self.encoder.getstate()) + else: + state = (self.encoding, self.buffer, False, None) + return _bytes2int(marshal.dumps(state)) + + def setstate(self, state): + state = _int2bytes(marshal.loads(state)) + self.encoding = state[0] + self.buffer = state[1] + if state[2] is not None: + self.encoder = codecs.getincrementalencoder(self.encoding)(self._errors) + self.encoder.setstate(state[4]) + else: + self.encoder = None + + +class StreamWriter(codecs.StreamWriter): + def __init__(self, stream, errors="strict", encoding=None, header=False): + codecs.StreamWriter.__init__(self, stream, errors) + self.streamwriter = None + self.encoding = encoding + self._errors = errors + self.buffer = "" + + def encode(self, input, errors='strict'): + li = len(input) + if self.streamwriter is None: + input = self.buffer + input + li = len(input) + if self.encoding is not None: + # Replace encoding in the @charset rule with the specified one + encoding = self.encoding + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = "utf-8" + newinput = _fixencoding(input, str(encoding), False) + if newinput is None: # @charset rule incomplete => Retry next time + self.buffer = input + return ("", 0) + input = newinput + else: + # Use encoding from the @charset declaration + self.encoding = detectencoding_unicode(input, False)[0] + if self.encoding is not None: + if self.encoding == "css": + raise ValueError("css not allowed as encoding name") + self.streamwriter = codecs.getwriter(self.encoding)(self.stream, self._errors) + encoding = self.encoding + if self.encoding.replace("_", "-").lower() == "utf-8-sig": + input = _fixencoding(input, "utf-8", True) + self.buffer = "" + else: + self.buffer = input + return ("", 0) + return (self.streamwriter.encode(input, errors)[0], li) + + def _geterrors(self): + return self._errors + + def _seterrors(self, errors): + # Setting ``errors`` must be done on the streamwriter too + try: + if self.streamwriter is not None: + self.streamwriter.errors = errors + except AttributeError as e: + # TODO: py3 only exception? + pass + + self._errors = errors + errors = property(_geterrors, _seterrors) + + +class StreamReader(codecs.StreamReader): + def __init__(self, stream, errors="strict", encoding=None, force=True): + codecs.StreamReader.__init__(self, stream, errors) + self.streamreader = None + self.encoding = encoding + self.force = force + self._errors = errors + + def decode(self, input, errors='strict'): + if self.streamreader is None: + if self.encoding is None or not self.force: + (encoding, explicit) = detectencoding_str(input, False) + if encoding is None: # no encoding determined yet + return ("", 0) # no encoding determined yet, so no output + elif encoding == "css": + raise ValueError("css not allowed as encoding name") + if (explicit and not self.force) or self.encoding is None: # Take the encoding from the input + self.encoding = encoding + streamreader = codecs.getreader(self.encoding) + streamreader = streamreader(self.stream, self._errors) + (output, consumed) = streamreader.decode(input, errors) + encoding = self.encoding + if encoding.replace("_", "-").lower() == "utf-8-sig": + encoding = "utf-8" + newoutput = _fixencoding(output, str(encoding), False) + if newoutput is not None: + self.streamreader = streamreader + return (newoutput, consumed) + return ("", 0) # we will create a new streamreader on the next call + return self.streamreader.decode(input, errors) + + def _geterrors(self): + return self._errors + + def _seterrors(self, errors): + # Setting ``errors`` must be done on the streamreader too + try: + if self.streamreader is not None: + self.streamreader.errors = errors + except AttributeError as e: + # TODO: py3 only exception? + pass + + self._errors = errors + errors = property(_geterrors, _seterrors) + + +if hasattr(codecs, "CodecInfo"): + # We're running on Python 2.5 or better + def search_function(name): + if name == "css": + return codecs.CodecInfo( + name="css", + encode=encode, + decode=decode, + incrementalencoder=IncrementalEncoder, + incrementaldecoder=IncrementalDecoder, + streamwriter=StreamWriter, + streamreader=StreamReader, + ) +else: + # If we're running on Python 2.4, define the utf-8-sig codec here + def utf8sig_encode(input, errors='strict'): + return (codecs.BOM_UTF8 + codecs.utf_8_encode(input, errors)[0], len(input)) + + def utf8sig_decode(input, errors='strict'): + prefix = 0 + if input[:3] == codecs.BOM_UTF8: + input = input[3:] + prefix = 3 + (output, consumed) = codecs.utf_8_decode(input, errors, True) + return (output, consumed+prefix) + + class UTF8SigStreamWriter(codecs.StreamWriter): + def reset(self): + codecs.StreamWriter.reset(self) + try: + del self.encode + except AttributeError: + pass + + def encode(self, input, errors='strict'): + self.encode = codecs.utf_8_encode + return utf8sig_encode(input, errors) + + class UTF8SigStreamReader(codecs.StreamReader): + def reset(self): + codecs.StreamReader.reset(self) + try: + del self.decode + except AttributeError: + pass + + def decode(self, input, errors='strict'): + if len(input) < 3 and codecs.BOM_UTF8.startswith(input): + # not enough data to decide if this is a BOM + # => try again on the next call + return ("", 0) + self.decode = codecs.utf_8_decode + return utf8sig_decode(input, errors) + + def search_function(name): + import encodings + name = encodings.normalize_encoding(name) + if name == "css": + return (encode, decode, StreamReader, StreamWriter) + elif name == "utf_8_sig": + return (utf8sig_encode, utf8sig_decode, UTF8SigStreamReader, UTF8SigStreamWriter) + + +codecs.register(search_function) + + +# Error handler for CSS escaping + +def cssescape(exc): + if not isinstance(exc, UnicodeEncodeError): + raise TypeError("don't know how to handle %r" % exc) + return ("".join("\\%06x" % ord(c) for c in exc.object[exc.start:exc.end]), exc.end) + +codecs.register_error("cssescape", cssescape) diff --git a/libs/cssutils/_fetch.py b/libs/cssutils/_fetch.py new file mode 100755 index 00000000..a9138fe3 --- /dev/null +++ b/libs/cssutils/_fetch.py @@ -0,0 +1,44 @@ +"""Default URL reading functions""" +__all__ = ['_defaultFetcher'] +__docformat__ = 'restructuredtext' +__version__ = '$Id: tokenize2.py 1547 2008-12-10 20:42:26Z cthedot $' + +import cssutils +from cssutils import VERSION +import encutils +import errorhandler +import urllib2 + +log = errorhandler.ErrorHandler() + +def _defaultFetcher(url): + """Retrieve data from ``url``. cssutils default implementation of fetch + URL function. + + Returns ``(encoding, string)`` or ``None`` + """ + try: + request = urllib2.Request(url) + request.add_header('User-agent', + 'cssutils %s (http://www.cthedot.de/cssutils/)' % VERSION) + res = urllib2.urlopen(request) + except OSError, e: + # e.g if file URL and not found + log.warn(e, error=OSError) + except (OSError, ValueError), e: + # invalid url, e.g. "1" + log.warn(u'ValueError, %s' % e.args[0], error=ValueError) + except urllib2.HTTPError, e: + # http error, e.g. 404, e can be raised + log.warn(u'HTTPError opening url=%s: %s %s' % + (url, e.code, e.msg), error=e) + except urllib2.URLError, e: + # URLError like mailto: or other IO errors, e can be raised + log.warn(u'URLError, %s' % e.reason, error=e) + else: + if res: + mimeType, encoding = encutils.getHTTPInfo(res) + if mimeType != u'text/css': + log.error(u'Expected "text/css" mime type for url=%r but found: %r' % + (url, mimeType), error=ValueError) + return encoding, res.read() diff --git a/libs/cssutils/_fetchgae.py b/libs/cssutils/_fetchgae.py new file mode 100755 index 00000000..ef91d412 --- /dev/null +++ b/libs/cssutils/_fetchgae.py @@ -0,0 +1,68 @@ +"""GAE specific URL reading functions""" +__all__ = ['_defaultFetcher'] +__docformat__ = 'restructuredtext' +__version__ = '$Id: tokenize2.py 1547 2008-12-10 20:42:26Z cthedot $' + +# raises ImportError of not on GAE +from google.appengine.api import urlfetch +import cgi +import errorhandler +import util + +log = errorhandler.ErrorHandler() + +def _defaultFetcher(url): + """ + uses GoogleAppEngine (GAE) + fetch(url, payload=None, method=GET, headers={}, allow_truncated=False) + + Response + content + The body content of the response. + content_was_truncated + True if the allow_truncated parameter to fetch() was True and + the response exceeded the maximum response size. In this case, + the content attribute contains the truncated response. + status_code + The HTTP status code. + headers + The HTTP response headers, as a mapping of names to values. + + Exceptions + exception InvalidURLError() + The URL of the request was not a valid URL, or it used an + unsupported method. Only http and https URLs are supported. + exception DownloadError() + There was an error retrieving the data. + + This exception is not raised if the server returns an HTTP + error code: In that case, the response data comes back intact, + including the error code. + + exception ResponseTooLargeError() + The response data exceeded the maximum allowed size, and the + allow_truncated parameter passed to fetch() was False. + """ + #from google.appengine.api import urlfetch + try: + r = urlfetch.fetch(url, method=urlfetch.GET) + except urlfetch.Error, e: + log.warn(u'Error opening url=%r: %s' % (url, e), + error=IOError) + else: + if r.status_code == 200: + # find mimetype and encoding + mimetype = 'application/octet-stream' + try: + mimetype, params = cgi.parse_header(r.headers['content-type']) + encoding = params['charset'] + except KeyError: + encoding = None + if mimetype != u'text/css': + log.error(u'Expected "text/css" mime type for url %r but found: %r' % + (url, mimetype), error=ValueError) + return encoding, r.content + else: + # TODO: 301 etc + log.warn(u'Error opening url=%r: HTTP status %s' % + (url, r.status_code), error=IOError) diff --git a/libs/cssutils/codec.py b/libs/cssutils/codec.py new file mode 100755 index 00000000..c694e1fc --- /dev/null +++ b/libs/cssutils/codec.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +"""Python codec for CSS.""" +__docformat__ = 'restructuredtext' +__author__ = 'Walter Doerwald' +__version__ = '$Id: util.py 1114 2008-03-05 13:22:59Z cthedot $' + +import sys + +if sys.version_info < (3,): + from _codec2 import * + # for tests + from _codec2 import _fixencoding +else: + from _codec3 import * + # for tests + from _codec3 import _fixencoding diff --git a/libs/cssutils/css/__init__.py b/libs/cssutils/css/__init__.py new file mode 100755 index 00000000..4cc4a904 --- /dev/null +++ b/libs/cssutils/css/__init__.py @@ -0,0 +1,80 @@ +"""Implements Document Object Model Level 2 CSS +http://www.w3.org/TR/2000/PR-DOM-Level-2-Style-20000927/css.html + +currently implemented + - CSSStyleSheet + - CSSRuleList + - CSSRule + - CSSComment (cssutils addon) + - CSSCharsetRule + - CSSFontFaceRule + - CSSImportRule + - CSSMediaRule + - CSSNamespaceRule (WD) + - CSSPageRule + - CSSStyleRule + - CSSUnkownRule + - Selector and SelectorList + - CSSStyleDeclaration + - CSS2Properties + - CSSValue + - CSSPrimitiveValue + - CSSValueList + - CSSVariablesRule + - CSSVariablesDeclaration + +todo + - RGBColor, Rect, Counter +""" +__all__ = [ + 'CSSStyleSheet', + 'CSSRuleList', + 'CSSRule', + 'CSSComment', + 'CSSCharsetRule', + 'CSSFontFaceRule' + 'CSSImportRule', + 'CSSMediaRule', + 'CSSNamespaceRule', + 'CSSPageRule', + 'MarginRule', + 'CSSStyleRule', + 'CSSUnknownRule', + 'CSSVariablesRule', + 'CSSVariablesDeclaration', + 'Selector', 'SelectorList', + 'CSSStyleDeclaration', 'Property', + #'CSSValue', 'CSSPrimitiveValue', 'CSSValueList' + 'PropertyValue', + 'Value', + 'ColorValue', + 'DimensionValue', + 'URIValue', + 'CSSFunction', + 'CSSVariable', + 'MSValue' + ] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssstylesheet import * +from cssrulelist import * +from cssrule import * +from csscomment import * +from csscharsetrule import * +from cssfontfacerule import * +from cssimportrule import * +from cssmediarule import * +from cssnamespacerule import * +from csspagerule import * +from marginrule import * +from cssstylerule import * +from cssvariablesrule import * +from cssunknownrule import * +from selector import * +from selectorlist import * +from cssstyledeclaration import * +from cssvariablesdeclaration import * +from property import * +#from cssvalue import * +from value import * diff --git a/libs/cssutils/css/colors.py b/libs/cssutils/css/colors.py new file mode 100755 index 00000000..5f8dd899 --- /dev/null +++ b/libs/cssutils/css/colors.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +""" +Built from something like this: + + print [ + ( + row[2].text_content().strip(), + eval(row[4].text_content().strip()) + ) + for row in lxml.html.parse('http://www.w3.org/TR/css3-color/') + .xpath("//*[@class='colortable']//tr[position()>1]") + ] + +by Simon Sapin +""" + +COLORS = { + 'transparent': (0, 0, 0, 0.0), + + 'black': (0, 0, 0, 1.0), + 'silver': (192, 192, 192, 1.0), + 'gray': (128, 128, 128, 1.0), + 'white': (255, 255, 255, 1.0), + 'maroon': (128, 0, 0, 1.0), + 'red': (255, 0, 0, 1.0), + 'purple': (128, 0, 128, 1.0), + 'fuchsia': (255, 0, 255, 1.0), + 'green': (0, 128, 0, 1.0), + 'lime': (0, 255, 0, 1.0), + 'olive': (128, 128, 0, 1.0), + 'yellow': (255, 255, 0, 1.0), + 'navy': (0, 0, 128, 1.0), + 'blue': (0, 0, 255, 1.0), + 'teal': (0, 128, 128, 1.0), + + 'aqua': (0, 255, 255, 1.0), + 'aliceblue': (240, 248, 255, 1.0), + 'antiquewhite': (250, 235, 215, 1.0), + 'aqua': (0, 255, 255, 1.0), + 'aquamarine': (127, 255, 212, 1.0), + 'azure': (240, 255, 255, 1.0), + 'beige': (245, 245, 220, 1.0), + 'bisque': (255, 228, 196, 1.0), + 'black': (0, 0, 0, 1.0), + 'blanchedalmond': (255, 235, 205, 1.0), + 'blue': (0, 0, 255, 1.0), + 'blueviolet': (138, 43, 226, 1.0), + 'brown': (165, 42, 42, 1.0), + 'burlywood': (222, 184, 135, 1.0), + 'cadetblue': (95, 158, 160, 1.0), + 'chartreuse': (127, 255, 0, 1.0), + 'chocolate': (210, 105, 30, 1.0), + 'coral': (255, 127, 80, 1.0), + 'cornflowerblue': (100, 149, 237, 1.0), + 'cornsilk': (255, 248, 220, 1.0), + 'crimson': (220, 20, 60, 1.0), + 'cyan': (0, 255, 255, 1.0), + 'darkblue': (0, 0, 139, 1.0), + 'darkcyan': (0, 139, 139, 1.0), + 'darkgoldenrod': (184, 134, 11, 1.0), + 'darkgray': (169, 169, 169, 1.0), + 'darkgreen': (0, 100, 0, 1.0), + 'darkgrey': (169, 169, 169, 1.0), + 'darkkhaki': (189, 183, 107, 1.0), + 'darkmagenta': (139, 0, 139, 1.0), + 'darkolivegreen': (85, 107, 47, 1.0), + 'darkorange': (255, 140, 0, 1.0), + 'darkorchid': (153, 50, 204, 1.0), + 'darkred': (139, 0, 0, 1.0), + 'darksalmon': (233, 150, 122, 1.0), + 'darkseagreen': (143, 188, 143, 1.0), + 'darkslateblue': (72, 61, 139, 1.0), + 'darkslategray': (47, 79, 79, 1.0), + 'darkslategrey': (47, 79, 79, 1.0), + 'darkturquoise': (0, 206, 209, 1.0), + 'darkviolet': (148, 0, 211, 1.0), + 'deeppink': (255, 20, 147, 1.0), + 'deepskyblue': (0, 191, 255, 1.0), + 'dimgray': (105, 105, 105, 1.0), + 'dimgrey': (105, 105, 105, 1.0), + 'dodgerblue': (30, 144, 255, 1.0), + 'firebrick': (178, 34, 34, 1.0), + 'floralwhite': (255, 250, 240, 1.0), + 'forestgreen': (34, 139, 34, 1.0), + 'fuchsia': (255, 0, 255, 1.0), + 'gainsboro': (220, 220, 220, 1.0), + 'ghostwhite': (248, 248, 255, 1.0), + 'gold': (255, 215, 0, 1.0), + 'goldenrod': (218, 165, 32, 1.0), + 'gray': (128, 128, 128, 1.0), + 'green': (0, 128, 0, 1.0), + 'greenyellow': (173, 255, 47, 1.0), + 'grey': (128, 128, 128, 1.0), + 'honeydew': (240, 255, 240, 1.0), + 'hotpink': (255, 105, 180, 1.0), + 'indianred': (205, 92, 92, 1.0), + 'indigo': (75, 0, 130, 1.0), + 'ivory': (255, 255, 240, 1.0), + 'khaki': (240, 230, 140, 1.0), + 'lavender': (230, 230, 250, 1.0), + 'lavenderblush': (255, 240, 245, 1.0), + 'lawngreen': (124, 252, 0, 1.0), + 'lemonchiffon': (255, 250, 205, 1.0), + 'lightblue': (173, 216, 230, 1.0), + 'lightcoral': (240, 128, 128, 1.0), + 'lightcyan': (224, 255, 255, 1.0), + 'lightgoldenrodyellow': (250, 250, 210, 1.0), + 'lightgray': (211, 211, 211, 1.0), + 'lightgreen': (144, 238, 144, 1.0), + 'lightgrey': (211, 211, 211, 1.0), + 'lightpink': (255, 182, 193, 1.0), + 'lightsalmon': (255, 160, 122, 1.0), + 'lightseagreen': (32, 178, 170, 1.0), + 'lightskyblue': (135, 206, 250, 1.0), + 'lightslategray': (119, 136, 153, 1.0), + 'lightslategrey': (119, 136, 153, 1.0), + 'lightsteelblue': (176, 196, 222, 1.0), + 'lightyellow': (255, 255, 224, 1.0), + 'lime': (0, 255, 0, 1.0), + 'limegreen': (50, 205, 50, 1.0), + 'linen': (250, 240, 230, 1.0), + 'magenta': (255, 0, 255, 1.0), + 'maroon': (128, 0, 0, 1.0), + 'mediumaquamarine': (102, 205, 170, 1.0), + 'mediumblue': (0, 0, 205, 1.0), + 'mediumorchid': (186, 85, 211, 1.0), + 'mediumpurple': (147, 112, 219, 1.0), + 'mediumseagreen': (60, 179, 113, 1.0), + 'mediumslateblue': (123, 104, 238, 1.0), + 'mediumspringgreen': (0, 250, 154, 1.0), + 'mediumturquoise': (72, 209, 204, 1.0), + 'mediumvioletred': (199, 21, 133, 1.0), + 'midnightblue': (25, 25, 112, 1.0), + 'mintcream': (245, 255, 250, 1.0), + 'mistyrose': (255, 228, 225, 1.0), + 'moccasin': (255, 228, 181, 1.0), + 'navajowhite': (255, 222, 173, 1.0), + 'navy': (0, 0, 128, 1.0), + 'oldlace': (253, 245, 230, 1.0), + 'olive': (128, 128, 0, 1.0), + 'olivedrab': (107, 142, 35, 1.0), + 'orange': (255, 165, 0, 1.0), + 'orangered': (255, 69, 0, 1.0), + 'orchid': (218, 112, 214, 1.0), + 'palegoldenrod': (238, 232, 170, 1.0), + 'palegreen': (152, 251, 152, 1.0), + 'paleturquoise': (175, 238, 238, 1.0), + 'palevioletred': (219, 112, 147, 1.0), + 'papayawhip': (255, 239, 213, 1.0), + 'peachpuff': (255, 218, 185, 1.0), + 'peru': (205, 133, 63, 1.0), + 'pink': (255, 192, 203, 1.0), + 'plum': (221, 160, 221, 1.0), + 'powderblue': (176, 224, 230, 1.0), + 'purple': (128, 0, 128, 1.0), + 'red': (255, 0, 0, 1.0), + 'rosybrown': (188, 143, 143, 1.0), + 'royalblue': (65, 105, 225, 1.0), + 'saddlebrown': (139, 69, 19, 1.0), + 'salmon': (250, 128, 114, 1.0), + 'sandybrown': (244, 164, 96, 1.0), + 'seagreen': (46, 139, 87, 1.0), + 'seashell': (255, 245, 238, 1.0), + 'sienna': (160, 82, 45, 1.0), + 'silver': (192, 192, 192, 1.0), + 'skyblue': (135, 206, 235, 1.0), + 'slateblue': (106, 90, 205, 1.0), + 'slategray': (112, 128, 144, 1.0), + 'slategrey': (112, 128, 144, 1.0), + 'snow': (255, 250, 250, 1.0), + 'springgreen': (0, 255, 127, 1.0), + 'steelblue': (70, 130, 180, 1.0), + 'tan': (210, 180, 140, 1.0), + 'teal': (0, 128, 128, 1.0), + 'thistle': (216, 191, 216, 1.0), + 'tomato': (255, 99, 71, 1.0), + 'turquoise': (64, 224, 208, 1.0), + 'violet': (238, 130, 238, 1.0), + 'wheat': (245, 222, 179, 1.0), + 'white': (255, 255, 255, 1.0), + 'whitesmoke': (245, 245, 245, 1.0), + 'yellow': (255, 255, 0, 1.0), + 'yellowgreen': (154, 205, 50, 1.0), +} diff --git a/libs/cssutils/css/csscharsetrule.py b/libs/cssutils/css/csscharsetrule.py new file mode 100755 index 00000000..fa6b7c4d --- /dev/null +++ b/libs/cssutils/css/csscharsetrule.py @@ -0,0 +1,159 @@ +"""CSSCharsetRule implements DOM Level 2 CSS CSSCharsetRule.""" +__all__ = ['CSSCharsetRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +import codecs +import cssrule +import cssutils +import xml.dom + +class CSSCharsetRule(cssrule.CSSRule): + """ + The CSSCharsetRule interface represents an @charset rule in a CSS style + sheet. The value of the encoding attribute does not affect the encoding + of text data in the DOM objects; this encoding is always UTF-16 + (also in Python?). After a stylesheet is loaded, the value of the + encoding attribute is the value found in the @charset rule. If there + was no @charset in the original document, then no CSSCharsetRule is + created. The value of the encoding attribute may also be used as a hint + for the encoding used on serialization of the style sheet. + + The value of the @charset rule (and therefore of the CSSCharsetRule) + may not correspond to the encoding the document actually came in; + character encoding information e.g. in an HTTP header, has priority + (see CSS document representation) but this is not reflected in the + CSSCharsetRule. + + This rule is not really needed anymore as setting + :attr:`CSSStyleSheet.encoding` is much easier. + + Format:: + + charsetrule: + CHARSET_SYM S* STRING S* ';' + + BUT: Only valid format is (single space, double quotes!):: + + @charset "ENCODING"; + """ + def __init__(self, encoding=None, parentRule=None, + parentStyleSheet=None, readonly=False): + """ + :param encoding: + a valid character encoding + :param readonly: + defaults to False, not used yet + """ + super(CSSCharsetRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + self._atkeyword = '@charset' + + if encoding: + self.encoding = encoding + else: + self._encoding = None + + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(encoding=%r)" % ( + self.__class__.__name__, + self.encoding) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.encoding, + id(self)) + + def _getCssText(self): + """The parsable textual representation.""" + return cssutils.ser.do_CSSCharsetRule(self) + + def _setCssText(self, cssText): + """ + :param cssText: + A parsable DOMString. + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + super(CSSCharsetRule, self)._setCssText(cssText) + + wellformed = True + tokenizer = self._tokenize2(cssText) + + if self._type(self._nexttoken(tokenizer)) != self._prods.CHARSET_SYM: + wellformed = False + self._log.error(u'CSSCharsetRule must start with "@charset "', + error=xml.dom.InvalidModificationErr) + + encodingtoken = self._nexttoken(tokenizer) + encodingtype = self._type(encodingtoken) + encoding = self._stringtokenvalue(encodingtoken) + if self._prods.STRING != encodingtype or not encoding: + wellformed = False + self._log.error(u'CSSCharsetRule: no encoding found; %r.' % + self._valuestr(cssText)) + + semicolon = self._tokenvalue(self._nexttoken(tokenizer)) + EOFtype = self._type(self._nexttoken(tokenizer)) + if u';' != semicolon or EOFtype not in ('EOF', None): + wellformed = False + self._log.error(u'CSSCharsetRule: Syntax Error: %r.' % + self._valuestr(cssText)) + + if wellformed: + self.encoding = encoding + + cssText = property(fget=_getCssText, fset=_setCssText, + doc=u"(DOM) The parsable textual representation.") + + def _setEncoding(self, encoding): + """ + :param encoding: + a valid encoding to be used. Currently only valid Python encodings + are allowed. + :exceptions: + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this encoding rule is readonly. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified encoding value has a syntax error and + is unparsable. + """ + self._checkReadonly() + tokenizer = self._tokenize2(encoding) + encodingtoken = self._nexttoken(tokenizer) + unexpected = self._nexttoken(tokenizer) + + if not encodingtoken or unexpected or\ + self._prods.IDENT != self._type(encodingtoken): + self._log.error(u'CSSCharsetRule: Syntax Error in encoding value ' + u'%r.' % encoding) + else: + try: + codecs.lookup(encoding) + except LookupError: + self._log.error(u'CSSCharsetRule: Unknown (Python) encoding %r.' + % encoding) + else: + self._encoding = encoding.lower() + + encoding = property(lambda self: self._encoding, _setEncoding, + doc=u"(DOM)The encoding information used in this @charset rule.") + + type = property(lambda self: self.CHARSET_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + wellformed = property(lambda self: bool(self.encoding)) diff --git a/libs/cssutils/css/csscomment.py b/libs/cssutils/css/csscomment.py new file mode 100755 index 00000000..311df0fd --- /dev/null +++ b/libs/cssutils/css/csscomment.py @@ -0,0 +1,87 @@ +"""CSSComment is not defined in DOM Level 2 at all but a cssutils defined +class only. + +Implements CSSRule which is also extended for a CSSComment rule type. +""" +__all__ = ['CSSComment'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +import cssrule +import cssutils +import xml.dom + +class CSSComment(cssrule.CSSRule): + """ + Represents a CSS comment (cssutils only). + + Format:: + + /*...*/ + """ + def __init__(self, cssText=None, parentRule=None, + parentStyleSheet=None, readonly=False): + super(CSSComment, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + + self._cssText = None + if cssText: + self._setCssText(cssText) + + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(cssText=%r)" % ( + self.__class__.__name__, + self.cssText) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.cssText, + id(self)) + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_CSSComment(self) + + def _setCssText(self, cssText): + """ + :param cssText: + textual text to set or tokenlist which is not tokenized + anymore. May also be a single token for this rule + + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + super(CSSComment, self)._setCssText(cssText) + tokenizer = self._tokenize2(cssText) + + commenttoken = self._nexttoken(tokenizer) + unexpected = self._nexttoken(tokenizer) + + if not commenttoken or\ + self._type(commenttoken) != self._prods.COMMENT or\ + unexpected: + self._log.error(u'CSSComment: Not a CSSComment: %r' % + self._valuestr(cssText), + error=xml.dom.InvalidModificationErr) + else: + self._cssText = self._tokenvalue(commenttoken) + + cssText = property(_getCssText, _setCssText, + doc=u"The parsable textual representation of this rule.") + + type = property(lambda self: self.COMMENT, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + # constant but needed: + wellformed = property(lambda self: True) diff --git a/libs/cssutils/css/cssfontfacerule.py b/libs/cssutils/css/cssfontfacerule.py new file mode 100755 index 00000000..1e936066 --- /dev/null +++ b/libs/cssutils/css/cssfontfacerule.py @@ -0,0 +1,184 @@ +"""CSSFontFaceRule implements DOM Level 2 CSS CSSFontFaceRule. + +From cssutils 0.9.6 additions from CSS Fonts Module Level 3 are +added http://www.w3.org/TR/css3-fonts/. +""" +__all__ = ['CSSFontFaceRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssstyledeclaration import CSSStyleDeclaration +import cssrule +import cssutils +import xml.dom + +class CSSFontFaceRule(cssrule.CSSRule): + """ + The CSSFontFaceRule interface represents a @font-face rule in a CSS + style sheet. The @font-face rule is used to hold a set of font + descriptions. + + Format:: + + font_face + : FONT_FACE_SYM S* + '{' S* declaration [ ';' S* declaration ]* '}' S* + ; + + cssutils uses a :class:`~cssutils.css.CSSStyleDeclaration` to + represent the font descriptions. For validation a specific profile + is used though were some properties have other valid values than + when used in e.g. a :class:`~cssutils.css.CSSStyleRule`. + """ + def __init__(self, style=None, parentRule=None, + parentStyleSheet=None, readonly=False): + """ + If readonly allows setting of properties in constructor only. + + :param style: + CSSStyleDeclaration used to hold any font descriptions + for this CSSFontFaceRule + """ + super(CSSFontFaceRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + self._atkeyword = u'@font-face' + + if style: + self.style = style + else: + self.style = CSSStyleDeclaration() + + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(style=%r)" % ( + self.__class__.__name__, + self.style.cssText) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.style.cssText, + self.valid, + id(self)) + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_CSSFontFaceRule(self) + + def _setCssText(self, cssText): + """ + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + super(CSSFontFaceRule, self)._setCssText(cssText) + + tokenizer = self._tokenize2(cssText) + attoken = self._nexttoken(tokenizer, None) + if self._type(attoken) != self._prods.FONT_FACE_SYM: + self._log.error(u'CSSFontFaceRule: No CSSFontFaceRule found: %s' % + self._valuestr(cssText), + error=xml.dom.InvalidModificationErr) + else: + newStyle = CSSStyleDeclaration(parentRule=self) + ok = True + + beforetokens, brace = self._tokensupto2(tokenizer, + blockstartonly=True, + separateEnd=True) + if self._tokenvalue(brace) != u'{': + ok = False + self._log.error(u'CSSFontFaceRule: No start { of style ' + u'declaration found: %r' + % self._valuestr(cssText), brace) + + # parse stuff before { which should be comments and S only + new = {'wellformed': True} + newseq = self._tempSeq() + + beforewellformed, expected = self._parse(expected=':', + seq=newseq, tokenizer=self._tokenize2(beforetokens), + productions={}) + ok = ok and beforewellformed and new['wellformed'] + + styletokens, braceorEOFtoken = self._tokensupto2(tokenizer, + blockendonly=True, + separateEnd=True) + + val, type_ = self._tokenvalue(braceorEOFtoken),\ + self._type(braceorEOFtoken) + if val != u'}' and type_ != 'EOF': + ok = False + self._log.error(u'CSSFontFaceRule: No "}" after style ' + u'declaration found: %r' + % self._valuestr(cssText)) + + nonetoken = self._nexttoken(tokenizer) + if nonetoken: + ok = False + self._log.error(u'CSSFontFaceRule: Trailing content found.', + token=nonetoken) + + if 'EOF' == type_: + # add again as style needs it + styletokens.append(braceorEOFtoken) + + # SET, may raise: + newStyle.cssText = styletokens + + if ok: + # contains probably comments only (upto ``{``) + self._setSeq(newseq) + self.style = newStyle + + cssText = property(_getCssText, _setCssText, + doc=u"(DOM) The parsable textual representation of this " + u"rule.") + + def _setStyle(self, style): + """ + :param style: + a CSSStyleDeclaration or string + """ + self._checkReadonly() + if isinstance(style, basestring): + self._style = CSSStyleDeclaration(cssText=style, parentRule=self) + else: + style._parentRule = self + self._style = style + + style = property(lambda self: self._style, _setStyle, + doc=u"(DOM) The declaration-block of this rule set, " + u"a :class:`~cssutils.css.CSSStyleDeclaration`.") + + type = property(lambda self: self.FONT_FACE_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + def _getValid(self): + needed = ['font-family', 'src'] + for p in self.style.getProperties(all=True): + if not p.valid: + return False + try: + needed.remove(p.name) + except ValueError: + pass + return not bool(needed) + + valid = property(_getValid, + doc=u"CSSFontFace is valid if properties `font-family` " + u"and `src` are set and all properties are valid.") + + # constant but needed: + wellformed = property(lambda self: True) diff --git a/libs/cssutils/css/cssimportrule.py b/libs/cssutils/css/cssimportrule.py new file mode 100755 index 00000000..59fe2564 --- /dev/null +++ b/libs/cssutils/css/cssimportrule.py @@ -0,0 +1,396 @@ +"""CSSImportRule implements DOM Level 2 CSS CSSImportRule plus the +``name`` property from http://www.w3.org/TR/css3-cascade/#cascading.""" +__all__ = ['CSSImportRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +import cssrule +import cssutils +import os +import urlparse +import xml.dom + +class CSSImportRule(cssrule.CSSRule): + """ + Represents an @import rule within a CSS style sheet. The @import rule + is used to import style rules from other style sheets. + + Format:: + + import + : IMPORT_SYM S* + [STRING|URI] S* [ medium [ COMMA S* medium]* ]? S* STRING? S* ';' S* + ; + """ + def __init__(self, href=None, mediaText=None, name=None, + parentRule=None, parentStyleSheet=None, readonly=False): + """ + If readonly allows setting of properties in constructor only + + :param href: + location of the style sheet to be imported. + :param mediaText: + A list of media types for which this style sheet may be used + as a string + :param name: + Additional name of imported style sheet + """ + super(CSSImportRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + self._atkeyword = u'@import' + self._styleSheet = None + + # string or uri used for reserialization + self.hreftype = None + + # prepare seq + seq = self._tempSeq() + seq.append(None, 'href') + #seq.append(None, 'media') + seq.append(None, 'name') + self._setSeq(seq) + + # 1. media + if mediaText: + self.media = mediaText + else: + # must be all for @import + self.media = cssutils.stylesheets.MediaList(mediaText=u'all') + # 2. name + self.name = name + # 3. href and styleSheet + self.href = href + + self._readonly = readonly + + def __repr__(self): + if self._usemedia: + mediaText = self.media.mediaText + else: + mediaText = None + return u"cssutils.css.%s(href=%r, mediaText=%r, name=%r)" % ( + self.__class__.__name__, + self.href, + self.media.mediaText, + self.name) + + def __str__(self): + if self._usemedia: + mediaText = self.media.mediaText + else: + mediaText = None + return u""\ + % (self.__class__.__name__, + self.href, + mediaText, + self.name, + id(self)) + + _usemedia = property(lambda self: self.media.mediaText not in (u'', u'all'), + doc="if self.media is used (or simply empty)") + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_CSSImportRule(self) + + def _setCssText(self, cssText): + """ + :exceptions: + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + """ + super(CSSImportRule, self)._setCssText(cssText) + tokenizer = self._tokenize2(cssText) + attoken = self._nexttoken(tokenizer, None) + if self._type(attoken) != self._prods.IMPORT_SYM: + self._log.error(u'CSSImportRule: No CSSImportRule found: %s' % + self._valuestr(cssText), + error=xml.dom.InvalidModificationErr) + else: + # for closures: must be a mutable + new = {'keyword': self._tokenvalue(attoken), + 'href': None, + 'hreftype': None, + 'media': None, + 'name': None, + 'wellformed': True + } + + def __doname(seq, token): + # called by _string or _ident + new['name'] = self._stringtokenvalue(token) + seq.append(new['name'], 'name') + return ';' + + def _string(expected, seq, token, tokenizer=None): + if 'href' == expected: + # href + new['href'] = self._stringtokenvalue(token) + new['hreftype'] = 'string' + seq.append(new['href'], 'href') + return 'media name ;' + elif 'name' in expected: + # name + return __doname(seq, token) + else: + new['wellformed'] = False + self._log.error( + u'CSSImportRule: Unexpected string.', token) + return expected + + def _uri(expected, seq, token, tokenizer=None): + # href + if 'href' == expected: + uri = self._uritokenvalue(token) + new['hreftype'] = 'uri' + new['href'] = uri + seq.append(new['href'], 'href') + return 'media name ;' + else: + new['wellformed'] = False + self._log.error( + u'CSSImportRule: Unexpected URI.', token) + return expected + + def _ident(expected, seq, token, tokenizer=None): + # medialist ending with ; which is checked upon too + if expected.startswith('media'): + mediatokens = self._tokensupto2( + tokenizer, importmediaqueryendonly=True) + mediatokens.insert(0, token) # push found token + + last = mediatokens.pop() # retrieve ; + lastval, lasttyp = self._tokenvalue(last), self._type(last) + if lastval != u';' and lasttyp not in ('EOF', + self._prods.STRING): + new['wellformed'] = False + self._log.error(u'CSSImportRule: No ";" found: %s' % + self._valuestr(cssText), token=token) + + newMedia = cssutils.stylesheets.MediaList(parentRule=self) + newMedia.mediaText = mediatokens + if newMedia.wellformed: + new['media'] = newMedia + seq.append(newMedia, 'media') + else: + new['wellformed'] = False + self._log.error(u'CSSImportRule: Invalid MediaList: %s' % + self._valuestr(cssText), token=token) + + if lasttyp == self._prods.STRING: + # name + return __doname(seq, last) + else: + return 'EOF' # ';' is token "last" + else: + new['wellformed'] = False + self._log.error(u'CSSImportRule: Unexpected ident.', token) + return expected + + def _char(expected, seq, token, tokenizer=None): + # final ; + val = self._tokenvalue(token) + if expected.endswith(';') and u';' == val: + return 'EOF' + else: + new['wellformed'] = False + self._log.error( + u'CSSImportRule: Unexpected char.', token) + return expected + + # import : IMPORT_SYM S* [STRING|URI] + # S* [ medium [ ',' S* medium]* ]? ';' S* + # STRING? # see http://www.w3.org/TR/css3-cascade/#cascading + # ; + newseq = self._tempSeq() + wellformed, expected = self._parse(expected='href', + seq=newseq, tokenizer=tokenizer, + productions={'STRING': _string, + 'URI': _uri, + 'IDENT': _ident, + 'CHAR': _char}, + new=new) + + # wellformed set by parse + ok = wellformed and new['wellformed'] + + # post conditions + if not new['href']: + ok = False + self._log.error(u'CSSImportRule: No href found: %s' % + self._valuestr(cssText)) + + if expected != 'EOF': + ok = False + self._log.error(u'CSSImportRule: No ";" found: %s' % + self._valuestr(cssText)) + + # set all + if ok: + self._setSeq(newseq) + + self.atkeyword = new['keyword'] + self.hreftype = new['hreftype'] + self.name = new['name'] + + if new['media']: + self.media = new['media'] + else: + # must be all for @import + self.media = cssutils.stylesheets.MediaList(mediaText=u'all') + + # needs new self.media + self.href = new['href'] + + cssText = property(fget=_getCssText, fset=_setCssText, + doc="(DOM) The parsable textual representation of this rule.") + + def _setHref(self, href): + # set new href + self._href = href + # update seq + for i, item in enumerate(self.seq): + val, type_ = item.value, item.type + if 'href' == type_: + self._seq[i] = (href, type_, item.line, item.col) + break + + importedSheet = cssutils.css.CSSStyleSheet(media=self.media, + ownerRule=self, + title=self.name) + self.hrefFound = False + # set styleSheet + if href and self.parentStyleSheet: + # loading errors are all catched! + + # relative href + parentHref = self.parentStyleSheet.href + if parentHref is None: + # use cwd instead + parentHref = cssutils.helper.path2url(os.getcwd()) + '/' + + fullhref = urlparse.urljoin(parentHref, self.href) + + # all possible exceptions are ignored + try: + usedEncoding, enctype, cssText = \ + self.parentStyleSheet._resolveImport(fullhref) + + if cssText is None: + # catched in next except below! + raise IOError('Cannot read Stylesheet.') + + # contentEncoding with parentStyleSheet.overrideEncoding, + # HTTP or parent + encodingOverride, encoding = None, None + + if enctype == 0: + encodingOverride = usedEncoding + elif 0 < enctype < 5: + encoding = usedEncoding + + # inherit fetcher for @imports in styleSheet + importedSheet._href = fullhref + importedSheet._setFetcher(self.parentStyleSheet._fetcher) + importedSheet._setCssTextWithEncodingOverride( + cssText, + encodingOverride=encodingOverride, + encoding=encoding) + + except (OSError, IOError, ValueError), e: + self._log.warn(u'CSSImportRule: While processing imported ' + u'style sheet href=%s: %r' + % (self.href, e), neverraise=True) + + else: + # used by resolveImports if to keep unprocessed href + self.hrefFound = True + + self._styleSheet = importedSheet + + _href = None # needs to be set + href = property(lambda self: self._href, _setHref, + doc=u"Location of the style sheet to be imported.") + + def _setMedia(self, media): + """ + :param media: + a :class:`~cssutils.stylesheets.MediaList` or string + """ + self._checkReadonly() + if isinstance(media, basestring): + self._media = cssutils.stylesheets.MediaList(mediaText=media, + parentRule=self) + else: + media._parentRule = self + self._media = media + + # update seq + ihref = 0 + for i, item in enumerate(self.seq): + if item.type == 'href': + ihref = i + elif item.type == 'media': + self.seq[i] = (self._media, 'media', None, None) + break + else: + # if no media until now add after href + self.seq.insert(ihref+1, + self._media, 'media', None, None) + + media = property(lambda self: self._media, _setMedia, + doc=u"(DOM) A list of media types for this rule " + u"of type :class:`~cssutils.stylesheets.MediaList`.") + + def _setName(self, name=u''): + """Raises xml.dom.SyntaxErr if name is not a string.""" + if name is None or isinstance(name, basestring): + # "" or '' handled as None + if not name: + name = None + + # save name + self._name = name + + # update seq + for i, item in enumerate(self.seq): + val, typ = item.value, item.type + if 'name' == typ: + self._seq[i] = (name, typ, item.line, item.col) + break + + # set title of imported sheet + if self.styleSheet: + self.styleSheet.title = name + + else: + self._log.error(u'CSSImportRule: Not a valid name: %s' % name) + + name = property(lambda self: self._name, _setName, + doc=u"An optional name for the imported sheet.") + + styleSheet = property(lambda self: self._styleSheet, + doc=u"(readonly) The style sheet referred to by this " + u"rule.") + + type = property(lambda self: self.IMPORT_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + def _getWellformed(self): + "Depending on if media is used at all." + if self._usemedia: + return bool(self.href and self.media.wellformed) + else: + return bool(self.href) + + wellformed = property(_getWellformed) diff --git a/libs/cssutils/css/cssmediarule.py b/libs/cssutils/css/cssmediarule.py new file mode 100755 index 00000000..a7ebf463 --- /dev/null +++ b/libs/cssutils/css/cssmediarule.py @@ -0,0 +1,302 @@ +"""CSSMediaRule implements DOM Level 2 CSS CSSMediaRule.""" +__all__ = ['CSSMediaRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +import cssrule +import cssutils +import xml.dom + +class CSSMediaRule(cssrule.CSSRuleRules): + """ + Objects implementing the CSSMediaRule interface can be identified by the + MEDIA_RULE constant. On these objects the type attribute must return the + value of that constant. + + Format:: + + : MEDIA_SYM S* medium [ COMMA S* medium ]* + + STRING? # the name + + LBRACE S* ruleset* '}' S*; + + ``cssRules`` + All Rules in this media rule, a :class:`~cssutils.css.CSSRuleList`. + """ + def __init__(self, mediaText='all', name=None, + parentRule=None, parentStyleSheet=None, readonly=False): + """constructor""" + super(CSSMediaRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + self._atkeyword = u'@media' + + # 1. media + if mediaText: + self.media = mediaText + else: + self.media = cssutils.stylesheets.MediaList() + + self.name = name + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(mediaText=%r)" % ( + self.__class__.__name__, + self.media.mediaText) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.media.mediaText, + id(self)) + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_CSSMediaRule(self) + + def _setCssText(self, cssText): + """ + :param cssText: + a parseable string or a tuple of (cssText, dict-of-namespaces) + :Exceptions: + - :exc:`~xml.dom.NamespaceErr`: + Raised if a specified selector uses an unknown namespace + prefix. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + # media "name"? { cssRules } + super(CSSMediaRule, self)._setCssText(cssText) + + # might be (cssText, namespaces) + cssText, namespaces = self._splitNamespacesOff(cssText) + + try: + # use parent style sheet ones if available + namespaces = self.parentStyleSheet.namespaces + except AttributeError: + pass + + tokenizer = self._tokenize2(cssText) + attoken = self._nexttoken(tokenizer, None) + if self._type(attoken) != self._prods.MEDIA_SYM: + self._log.error(u'CSSMediaRule: No CSSMediaRule found: %s' % + self._valuestr(cssText), + error=xml.dom.InvalidModificationErr) + + else: + # save if parse goes wrong + oldMedia = self._media + oldName = self._name + oldCssRules = self._cssRules + + ok = True + + # media + mediatokens, end = self._tokensupto2(tokenizer, + mediaqueryendonly=True, + separateEnd=True) + if u'{' == self._tokenvalue(end)\ + or self._prods.STRING == self._type(end): + self.media = cssutils.stylesheets.MediaList(parentRule=self) + # TODO: remove special case + self.media.mediaText = mediatokens + ok = ok and self.media.wellformed + else: + ok = False + + # name (optional) + name = None + nameseq = self._tempSeq() + if self._prods.STRING == self._type(end): + name = self._stringtokenvalue(end) + # TODO: for now comments are lost after name + nametokens, end = self._tokensupto2(tokenizer, + blockstartonly=True, + separateEnd=True) + wellformed, expected = self._parse(None, + nameseq, + nametokens, + {}) + if not wellformed: + ok = False + self._log.error(u'CSSMediaRule: Syntax Error: %s' % + self._valuestr(cssText)) + + + # check for { + if u'{' != self._tokenvalue(end): + self._log.error(u'CSSMediaRule: No "{" found: %s' % + self._valuestr(cssText)) + return + + # cssRules + cssrulestokens, braceOrEOF = self._tokensupto2(tokenizer, + mediaendonly=True, + separateEnd=True) + nonetoken = self._nexttoken(tokenizer, None) + if 'EOF' == self._type(braceOrEOF): + # HACK!!! + # TODO: Not complete, add EOF to rule and } to @media + cssrulestokens.append(braceOrEOF) + braceOrEOF = ('CHAR', '}', 0, 0) + self._log.debug(u'CSSMediaRule: Incomplete, adding "}".', + token=braceOrEOF, neverraise=True) + + if u'}' != self._tokenvalue(braceOrEOF): + self._log.error(u'CSSMediaRule: No "}" found.', + token=braceOrEOF) + elif nonetoken: + self._log.error(u'CSSMediaRule: Trailing content found.', + token=nonetoken) + else: + # for closures: must be a mutable + new = {'wellformed': True } + + def COMMENT(expected, seq, token, tokenizer=None): + self.insertRule(cssutils.css.CSSComment([token], + parentRule=self, + parentStyleSheet=self.parentStyleSheet)) + return expected + + def ruleset(expected, seq, token, tokenizer): + rule = cssutils.css.CSSStyleRule(parentRule=self, + parentStyleSheet=self.parentStyleSheet) + rule.cssText = self._tokensupto2(tokenizer, token) + if rule.wellformed: + self.insertRule(rule) + return expected + + def atrule(expected, seq, token, tokenizer): + # TODO: get complete rule! + tokens = self._tokensupto2(tokenizer, token) + atval = self._tokenvalue(token) + if atval in ('@charset ', '@font-face', '@import', + '@namespace', '@page', '@media', '@variables'): + self._log.error(u'CSSMediaRule: This rule is not ' + u'allowed in CSSMediaRule - ignored: ' + u'%s.' % self._valuestr(tokens), + token = token, + error=xml.dom.HierarchyRequestErr) + else: + rule = cssutils.css.CSSUnknownRule(tokens, + parentRule=self, + parentStyleSheet=self.parentStyleSheet) + if rule.wellformed: + self.insertRule(rule) + return expected + + # save for possible reset + oldCssRules = self.cssRules + + self.cssRules = cssutils.css.CSSRuleList() + seq = [] # not used really + + tokenizer = iter(cssrulestokens) + wellformed, expected = self._parse(braceOrEOF, + seq, + tokenizer, { + 'COMMENT': COMMENT, + 'CHARSET_SYM': atrule, + 'FONT_FACE_SYM': atrule, + 'IMPORT_SYM': atrule, + 'NAMESPACE_SYM': atrule, + 'PAGE_SYM': atrule, + 'MEDIA_SYM': atrule, + 'ATKEYWORD': atrule + }, + default=ruleset, + new=new) + ok = ok and wellformed + + if ok: + self.name = name + self._setSeq(nameseq) + else: + self._media = oldMedia + self._cssRules = oldCssRules + + cssText = property(_getCssText, _setCssText, + doc=u"(DOM) The parsable textual representation of this " + u"rule.") + + def _setName(self, name): + if isinstance(name, basestring) or name is None: + # "" or '' + if not name: + name = None + + self._name = name + else: + self._log.error(u'CSSImportRule: Not a valid name: %s' % name) + + name = property(lambda self: self._name, _setName, + doc=u"An optional name for this media rule.") + + def _setMedia(self, media): + """ + :param media: + a :class:`~cssutils.stylesheets.MediaList` or string + """ + self._checkReadonly() + if isinstance(media, basestring): + self._media = cssutils.stylesheets.MediaList(mediaText=media, + parentRule=self) + else: + media._parentRule = self + self._media = media + + # NOT IN @media seq at all?! +# # update seq +# for i, item in enumerate(self.seq): +# if item.type == 'media': +# self._seq[i] = (self._media, 'media', None, None) +# break +# else: +# # insert after @media if not in seq at all +# self.seq.insert(0, +# self._media, 'media', None, None) + + media = property(lambda self: self._media, _setMedia, + doc=u"(DOM) A list of media types for this rule " + u"of type :class:`~cssutils.stylesheets.MediaList`.") + + + def insertRule(self, rule, index=None): + """Implements base ``insertRule``.""" + rule, index = self._prepareInsertRule(rule, index) + + if rule is False or rule is True: + # done or error + return + + # check hierarchy + if isinstance(rule, cssutils.css.CSSCharsetRule) or \ + isinstance(rule, cssutils.css.CSSFontFaceRule) or \ + isinstance(rule, cssutils.css.CSSImportRule) or \ + isinstance(rule, cssutils.css.CSSNamespaceRule) or \ + isinstance(rule, cssutils.css.CSSPageRule) or \ + isinstance(rule, cssutils.css.MarginRule) or \ + isinstance(rule, CSSMediaRule): + self._log.error(u'%s: This type of rule is not allowed here: %s' + % (self.__class__.__name__, rule.cssText), + error=xml.dom.HierarchyRequestErr) + return + + return self._finishInsertRule(rule, index) + + type = property(lambda self: self.MEDIA_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + wellformed = property(lambda self: self.media.wellformed) diff --git a/libs/cssutils/css/cssnamespacerule.py b/libs/cssutils/css/cssnamespacerule.py new file mode 100755 index 00000000..a2610fc2 --- /dev/null +++ b/libs/cssutils/css/cssnamespacerule.py @@ -0,0 +1,295 @@ +"""CSSNamespaceRule currently implements http://dev.w3.org/csswg/css3-namespace/ +""" +__all__ = ['CSSNamespaceRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +import cssrule +import cssutils +import xml.dom + +class CSSNamespaceRule(cssrule.CSSRule): + """ + Represents an @namespace rule within a CSS style sheet. + + The @namespace at-rule declares a namespace prefix and associates + it with a given namespace (a string). This namespace prefix can then be + used in namespace-qualified names such as those described in the + Selectors Module [SELECT] or the Values and Units module [CSS3VAL]. + + Dealing with these rules directly is not needed anymore, easier is + the use of :attr:`cssutils.css.CSSStyleSheet.namespaces`. + + Format:: + + namespace + : NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S* + ; + namespace_prefix + : IDENT + ; + """ + def __init__(self, namespaceURI=None, prefix=None, cssText=None, + parentRule=None, parentStyleSheet=None, readonly=False): + """ + :Parameters: + namespaceURI + The namespace URI (a simple string!) which is bound to the + given prefix. If no prefix is set + (``CSSNamespaceRule.prefix==''``) the namespace defined by + namespaceURI is set as the default namespace + prefix + The prefix used in the stylesheet for the given + ``CSSNamespaceRule.uri``. + cssText + if no namespaceURI is given cssText must be given to set + a namespaceURI as this is readonly later on + parentStyleSheet + sheet where this rule belongs to + + Do not use as positional but as keyword parameters only! + + If readonly allows setting of properties in constructor only + + format namespace:: + + namespace + : NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S* + ; + namespace_prefix + : IDENT + ; + """ + super(CSSNamespaceRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + self._atkeyword = u'@namespace' + self._prefix = u'' + self._namespaceURI = None + + if namespaceURI: + self.namespaceURI = namespaceURI + self.prefix = prefix + tempseq = self._tempSeq() + tempseq.append(self.prefix, 'prefix') + tempseq.append(self.namespaceURI, 'namespaceURI') + self._setSeq(tempseq) + + elif cssText is not None: + self.cssText = cssText + + if parentStyleSheet: + self._parentStyleSheet = parentStyleSheet + + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(namespaceURI=%r, prefix=%r)" % ( + self.__class__.__name__, + self.namespaceURI, + self.prefix) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.namespaceURI, + self.prefix, + id(self)) + + def _getCssText(self): + """Return serialized property cssText""" + return cssutils.ser.do_CSSNamespaceRule(self) + + def _setCssText(self, cssText): + """ + :param cssText: initial value for this rules cssText which is parsed + :exceptions: + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + """ + super(CSSNamespaceRule, self)._setCssText(cssText) + tokenizer = self._tokenize2(cssText) + attoken = self._nexttoken(tokenizer, None) + if self._type(attoken) != self._prods.NAMESPACE_SYM: + self._log.error(u'CSSNamespaceRule: No CSSNamespaceRule found: %s' % + self._valuestr(cssText), + error=xml.dom.InvalidModificationErr) + else: + # for closures: must be a mutable + new = {'keyword': self._tokenvalue(attoken), + 'prefix': u'', + 'uri': None, + 'wellformed': True + } + + def _ident(expected, seq, token, tokenizer=None): + # the namespace prefix, optional + if 'prefix or uri' == expected: + new['prefix'] = self._tokenvalue(token) + seq.append(new['prefix'], 'prefix') + return 'uri' + else: + new['wellformed'] = False + self._log.error( + u'CSSNamespaceRule: Unexpected ident.', token) + return expected + + def _string(expected, seq, token, tokenizer=None): + # the namespace URI as a STRING + if expected.endswith('uri'): + new['uri'] = self._stringtokenvalue(token) + seq.append(new['uri'], 'namespaceURI') + return ';' + + else: + new['wellformed'] = False + self._log.error( + u'CSSNamespaceRule: Unexpected string.', token) + return expected + + def _uri(expected, seq, token, tokenizer=None): + # the namespace URI as URI which is DEPRECATED + if expected.endswith('uri'): + uri = self._uritokenvalue(token) + new['uri'] = uri + seq.append(new['uri'], 'namespaceURI') + return ';' + else: + new['wellformed'] = False + self._log.error( + u'CSSNamespaceRule: Unexpected URI.', token) + return expected + + def _char(expected, seq, token, tokenizer=None): + # final ; + val = self._tokenvalue(token) + if ';' == expected and u';' == val: + return 'EOF' + else: + new['wellformed'] = False + self._log.error( + u'CSSNamespaceRule: Unexpected char.', token) + return expected + + # "NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S*" + newseq = self._tempSeq() + wellformed, expected = self._parse(expected='prefix or uri', + seq=newseq, tokenizer=tokenizer, + productions={'IDENT': _ident, + 'STRING': _string, + 'URI': _uri, + 'CHAR': _char}, + new=new) + + # wellformed set by parse + wellformed = wellformed and new['wellformed'] + + # post conditions + if new['uri'] is None: + wellformed = False + self._log.error(u'CSSNamespaceRule: No namespace URI found: %s' + % self._valuestr(cssText)) + + if expected != 'EOF': + wellformed = False + self._log.error(u'CSSNamespaceRule: No ";" found: %s' % + self._valuestr(cssText)) + + # set all + if wellformed: + self.atkeyword = new['keyword'] + self._prefix = new['prefix'] + self.namespaceURI = new['uri'] + self._setSeq(newseq) + + cssText = property(fget=_getCssText, fset=_setCssText, + doc=u"(DOM) The parsable textual representation of this " + u"rule.") + + def _setNamespaceURI(self, namespaceURI): + """ + :param namespaceURI: the initial value for this rules namespaceURI + :exceptions: + - :exc:`~xml.dom.NoModificationAllowedErr`: + (CSSRule) Raised if this rule is readonly or a namespaceURI is + already set in this rule. + """ + self._checkReadonly() + if not self._namespaceURI: + # initial setting + self._namespaceURI = namespaceURI + tempseq = self._tempSeq() + tempseq.append(namespaceURI, 'namespaceURI') + self._setSeq(tempseq) # makes seq readonly! + elif self._namespaceURI != namespaceURI: + self._log.error(u'CSSNamespaceRule: namespaceURI is readonly.', + error=xml.dom.NoModificationAllowedErr) + + namespaceURI = property(lambda self: self._namespaceURI, _setNamespaceURI, + doc="URI (handled as simple string) of the defined namespace.") + + def _replaceNamespaceURI(self, namespaceURI): + """Used during parse of new sheet only! + + :param namespaceURI: the new value for this rules namespaceURI + """ + self._namespaceURI = namespaceURI + for i, x in enumerate(self._seq): + if 'namespaceURI' == x.type: + self._seq._readonly = False + self._seq.replace(i, namespaceURI, 'namespaceURI') + self._seq._readonly = True + break + + def _setPrefix(self, prefix=None): + """ + :param prefix: the new prefix + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this rule is readonly. + """ + self._checkReadonly() + if not prefix: + prefix = u'' + else: + tokenizer = self._tokenize2(prefix) + prefixtoken = self._nexttoken(tokenizer, None) + if not prefixtoken or self._type(prefixtoken) != self._prods.IDENT: + self._log.error(u'CSSNamespaceRule: No valid prefix "%s".' % + self._valuestr(prefix), + error=xml.dom.SyntaxErr) + return + else: + prefix = self._tokenvalue(prefixtoken) + # update seq + for i, x in enumerate(self._seq): + if x == self._prefix: + self._seq[i] = (prefix, 'prefix', None, None) + break + else: + # put prefix at the beginning! + self._seq[0] = (prefix, 'prefix', None, None) + + # set new prefix + self._prefix = prefix + + prefix = property(lambda self: self._prefix, _setPrefix, + doc=u"Prefix used for the defined namespace.") + + type = property(lambda self: self.NAMESPACE_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + wellformed = property(lambda self: self.namespaceURI is not None) + \ No newline at end of file diff --git a/libs/cssutils/css/csspagerule.py b/libs/cssutils/css/csspagerule.py new file mode 100755 index 00000000..cc2f4516 --- /dev/null +++ b/libs/cssutils/css/csspagerule.py @@ -0,0 +1,436 @@ +"""CSSPageRule implements DOM Level 2 CSS CSSPageRule.""" +__all__ = ['CSSPageRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from itertools import chain +from cssstyledeclaration import CSSStyleDeclaration +from marginrule import MarginRule +import cssrule +import cssutils +import xml.dom + +class CSSPageRule(cssrule.CSSRuleRules): + """ + The CSSPageRule interface represents a @page rule within a CSS style + sheet. The @page rule is used to specify the dimensions, orientation, + margins, etc. of a page box for paged media. + + Format:: + + page : + PAGE_SYM S* IDENT? pseudo_page? S* + '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S* + ; + + pseudo_page : + ':' [ "left" | "right" | "first" ] + ; + + margin : + margin_sym S* '{' declaration [ ';' S* declaration? ]* '}' S* + ; + + margin_sym : + TOPLEFTCORNER_SYM | + TOPLEFT_SYM | + TOPCENTER_SYM | + TOPRIGHT_SYM | + TOPRIGHTCORNER_SYM | + BOTTOMLEFTCORNER_SYM | + BOTTOMLEFT_SYM | + BOTTOMCENTER_SYM | + BOTTOMRIGHT_SYM | + BOTTOMRIGHTCORNER_SYM | + LEFTTOP_SYM | + LEFTMIDDLE_SYM | + LEFTBOTTOM_SYM | + RIGHTTOP_SYM | + RIGHTMIDDLE_SYM | + RIGHTBOTTOM_SYM + ; + + `cssRules` contains a list of `MarginRule` objects. + """ + def __init__(self, selectorText=None, style=None, parentRule=None, + parentStyleSheet=None, readonly=False): + """ + If readonly allows setting of properties in constructor only. + + :param selectorText: + type string + :param style: + CSSStyleDeclaration for this CSSStyleRule + """ + super(CSSPageRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + self._atkeyword = u'@page' + self._specificity = (0, 0, 0) + + tempseq = self._tempSeq() + + if selectorText: + self.selectorText = selectorText + tempseq.append(self.selectorText, 'selectorText') + else: + self._selectorText = self._tempSeq() + + if style: + self.style = style + else: + self.style = CSSStyleDeclaration() + + tempseq.append(self.style, 'style') + + self._setSeq(tempseq) + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(selectorText=%r, style=%r)" % ( + self.__class__.__name__, + self.selectorText, + self.style.cssText) + + def __str__(self): + return (u"") % ( + self.__class__.__name__, + self.selectorText, + self.specificity, + self.style.cssText, + len(self.cssRules), + id(self)) + + def __contains__(self, margin): + """Check if margin is set in the rule.""" + return margin in self.keys() + + def keys(self): + "Return list of all set margins (MarginRule)." + return list(r.margin for r in self.cssRules) + + def __getitem__(self, margin): + """Retrieve the style (of MarginRule) + for `margin` (which must be normalized). + """ + for r in self.cssRules: + if r.margin == margin: + return r.style + + def __setitem__(self, margin, style): + """Set the style (of MarginRule) + for `margin` (which must be normalized). + """ + for i, r in enumerate(self.cssRules): + if r.margin == margin: + r.style = style + return i + else: + return self.add(MarginRule(margin, style)) + + def __delitem__(self, margin): + """Delete the style (the MarginRule) + for `margin` (which must be normalized). + """ + for r in self.cssRules: + if r.margin == margin: + self.deleteRule(r) + + def __parseSelectorText(self, selectorText): + """ + Parse `selectorText` which may also be a list of tokens + and returns (selectorText, seq). + + see _setSelectorText for details + """ + # for closures: must be a mutable + new = {'wellformed': True, 'last-S': False, + 'name': 0, 'first': 0, 'lr': 0} + specificity = (0, 0, 0) + + def _char(expected, seq, token, tokenizer=None): + # pseudo_page, :left, :right or :first + val = self._tokenvalue(token) + if not new['last-S'] and expected in ['page', ': or EOF']\ + and u':' == val: + try: + identtoken = tokenizer.next() + except StopIteration: + self._log.error( + u'CSSPageRule selectorText: No IDENT found.', token) + else: + ival, ityp = self._tokenvalue(identtoken),\ + self._type(identtoken) + if self._prods.IDENT != ityp: + self._log.error(u'CSSPageRule selectorText: Expected ' + u'IDENT but found: %r' % ival, token) + else: + if not ival in (u'first', u'left', u'right'): + self._log.warn(u'CSSPageRule: Unknown @page ' + u'selector: %r' + % (u':'+ival,), neverraise=True) + if ival == u'first': + new['first'] = 1 + else: + new['lr'] = 1 + seq.append(val + ival, 'pseudo') + return 'EOF' + return expected + else: + new['wellformed'] = False + self._log.error(u'CSSPageRule selectorText: Unexpected CHAR: %r' + % val, token) + return expected + + def S(expected, seq, token, tokenizer=None): + "Does not raise if EOF is found." + if expected == ': or EOF': + # pseudo must directly follow IDENT if given + new['last-S'] = True + return expected + + def IDENT(expected, seq, token, tokenizer=None): + "" + val = self._tokenvalue(token) + if 'page' == expected: + if self._normalize(val) == u'auto': + self._log.error(u'CSSPageRule selectorText: Invalid pagename.', + token) + else: + new['name'] = 1 + seq.append(val, 'IDENT') + + return ': or EOF' + else: + new['wellformed'] = False + self._log.error(u'CSSPageRule selectorText: Unexpected IDENT: ' + u'%r' % val, token) + return expected + + def COMMENT(expected, seq, token, tokenizer=None): + "Does not raise if EOF is found." + seq.append(cssutils.css.CSSComment([token]), 'COMMENT') + return expected + + newseq = self._tempSeq() + wellformed, expected = self._parse(expected='page', + seq=newseq, tokenizer=self._tokenize2(selectorText), + productions={'CHAR': _char, + 'IDENT': IDENT, + 'COMMENT': COMMENT, + 'S': S}, + new=new) + wellformed = wellformed and new['wellformed'] + + # post conditions + if expected == 'ident': + self._log.error( + u'CSSPageRule selectorText: No valid selector: %r' % + self._valuestr(selectorText)) + + return wellformed, newseq, (new['name'], new['first'], new['lr']) + + + def __parseMarginAndStyle(self, tokens): + "tokens is a list, no generator (yet)" + g = iter(tokens) + styletokens = [] + + # new rules until parse done + cssRules = [] + + for token in g: + if token[0] == 'ATKEYWORD' and \ + self._normalize(token[1]) in MarginRule.margins: + + # MarginRule + m = MarginRule(parentRule=self, + parentStyleSheet=self.parentStyleSheet) + m.cssText = chain([token], g) + + # merge if margin set more than once + for r in cssRules: + if r.margin == m.margin: + for p in m.style: + r.style.setProperty(p, replace=False) + break + else: + cssRules.append(m) + + continue + + # TODO: Properties? + styletokens.append(token) + + return cssRules, styletokens + + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_CSSPageRule(self) + + def _setCssText(self, cssText): + """ + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + super(CSSPageRule, self)._setCssText(cssText) + + tokenizer = self._tokenize2(cssText) + if self._type(self._nexttoken(tokenizer)) != self._prods.PAGE_SYM: + self._log.error(u'CSSPageRule: No CSSPageRule found: %s' % + self._valuestr(cssText), + error=xml.dom.InvalidModificationErr) + else: + newStyle = CSSStyleDeclaration(parentRule=self) + ok = True + + selectortokens, startbrace = self._tokensupto2(tokenizer, + blockstartonly=True, + separateEnd=True) + styletokens, braceorEOFtoken = self._tokensupto2(tokenizer, + blockendonly=True, + separateEnd=True) + nonetoken = self._nexttoken(tokenizer) + if self._tokenvalue(startbrace) != u'{': + ok = False + self._log.error(u'CSSPageRule: No start { of style declaration ' + u'found: %r' % + self._valuestr(cssText), startbrace) + elif nonetoken: + ok = False + self._log.error(u'CSSPageRule: Trailing content found.', + token=nonetoken) + + selok, newselseq, specificity = self.__parseSelectorText(selectortokens) + ok = ok and selok + + val, type_ = self._tokenvalue(braceorEOFtoken),\ + self._type(braceorEOFtoken) + + if val != u'}' and type_ != 'EOF': + ok = False + self._log.error( + u'CSSPageRule: No "}" after style declaration found: %r' % + self._valuestr(cssText)) + else: + if 'EOF' == type_: + # add again as style needs it + styletokens.append(braceorEOFtoken) + + # filter pagemargin rules out first + cssRules, styletokens = self.__parseMarginAndStyle(styletokens) + + # SET, may raise: + newStyle.cssText = styletokens + + if ok: + self._selectorText = newselseq + self._specificity = specificity + self.style = newStyle + self.cssRules = cssutils.css.CSSRuleList() + for r in cssRules: + self.cssRules.append(r) + + cssText = property(_getCssText, _setCssText, + doc=u"(DOM) The parsable textual representation of this rule.") + + + def _getSelectorText(self): + """Wrapper for cssutils Selector object.""" + return cssutils.ser.do_CSSPageRuleSelector(self._selectorText) + + def _setSelectorText(self, selectorText): + """Wrapper for cssutils Selector object. + + :param selectorText: + DOM String, in CSS 2.1 one of + + - :first + - :left + - :right + - empty + + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error + and is unparsable. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this rule is readonly. + """ + self._checkReadonly() + + # may raise SYNTAX_ERR + wellformed, newseq, specificity = self.__parseSelectorText(selectorText) + if wellformed: + self._selectorText = newseq + self._specificity = specificity + + selectorText = property(_getSelectorText, _setSelectorText, + doc=u"(DOM) The parsable textual representation of " + u"the page selector for the rule.") + + def _setStyle(self, style): + """ + :param style: + a CSSStyleDeclaration or string + """ + self._checkReadonly() + if isinstance(style, basestring): + self._style = CSSStyleDeclaration(cssText=style, parentRule=self) + else: + style._parentRule = self + self._style = style + + style = property(lambda self: self._style, _setStyle, + doc=u"(DOM) The declaration-block of this rule set, " + u"a :class:`~cssutils.css.CSSStyleDeclaration`.") + + + def insertRule(self, rule, index=None): + """Implements base ``insertRule``.""" + rule, index = self._prepareInsertRule(rule, index) + + if rule is False or rule is True: + # done or error + return + + # check hierarchy + if isinstance(rule, cssutils.css.CSSCharsetRule) or \ + isinstance(rule, cssutils.css.CSSFontFaceRule) or \ + isinstance(rule, cssutils.css.CSSImportRule) or \ + isinstance(rule, cssutils.css.CSSNamespaceRule) or \ + isinstance(rule, CSSPageRule) or \ + isinstance(rule, cssutils.css.CSSMediaRule): + self._log.error(u'%s: This type of rule is not allowed here: %s' + % (self.__class__.__name__, rule.cssText), + error=xml.dom.HierarchyRequestErr) + return + + return self._finishInsertRule(rule, index) + + specificity = property(lambda self: self._specificity, + doc=u"""Specificity of this page rule (READONLY). +Tuple of (f, g, h) where: + + - if the page selector has a named page, f=1; else f=0 + - if the page selector has a ':first' pseudo-class, g=1; else g=0 + - if the page selector has a ':left' or ':right' pseudo-class, h=1; else h=0 +""") + + type = property(lambda self: self.PAGE_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + # constant but needed: + wellformed = property(lambda self: True) \ No newline at end of file diff --git a/libs/cssutils/css/cssproperties.py b/libs/cssutils/css/cssproperties.py new file mode 100755 index 00000000..7454daff --- /dev/null +++ b/libs/cssutils/css/cssproperties.py @@ -0,0 +1,122 @@ +"""CSS2Properties (partly!) implements DOM Level 2 CSS CSS2Properties used +by CSSStyleDeclaration + +TODO: CSS2Properties + If an implementation does implement this interface, it is expected to + understand the specific syntax of the shorthand properties, and apply + their semantics; when the margin property is set, for example, the + marginTop, marginRight, marginBottom and marginLeft properties are + actually being set by the underlying implementation. + + When dealing with CSS "shorthand" properties, the shorthand properties + should be decomposed into their component longhand properties as + appropriate, and when querying for their value, the form returned + should be the shortest form exactly equivalent to the declarations made + in the ruleset. However, if there is no shorthand declaration that + could be added to the ruleset without changing in any way the rules + already declared in the ruleset (i.e., by adding longhand rules that + were previously not declared in the ruleset), then the empty string + should be returned for the shorthand property. + + For example, querying for the font property should not return + "normal normal normal 14pt/normal Arial, sans-serif", when + "14pt Arial, sans-serif" suffices. (The normals are initial values, and + are implied by use of the longhand property.) + + If the values for all the longhand properties that compose a particular + string are the initial values, then a string consisting of all the + initial values should be returned (e.g. a border-width value of + "medium" should be returned as such, not as ""). + + For some shorthand properties that take missing values from other + sides, such as the margin, padding, and border-[width|style|color] + properties, the minimum number of sides possible should be used; i.e., + "0px 10px" will be returned instead of "0px 10px 0px 10px". + + If the value of a shorthand property can not be decomposed into its + component longhand properties, as is the case for the font property + with a value of "menu", querying for the values of the component + longhand properties should return the empty string. + +TODO: CSS2Properties DOMImplementation + The interface found within this section are not mandatory. A DOM + application can use the hasFeature method of the DOMImplementation + interface to determine whether it is supported or not. The feature + string for this extended interface listed in this section is "CSS2" + and the version is "2.0". + +""" +__all__ = ['CSS2Properties'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +import cssutils.profiles +import re + +class CSS2Properties(object): + """The CSS2Properties interface represents a convenience mechanism + for retrieving and setting properties within a CSSStyleDeclaration. + The attributes of this interface correspond to all the properties + specified in CSS2. Getting an attribute of this interface is + equivalent to calling the getPropertyValue method of the + CSSStyleDeclaration interface. Setting an attribute of this + interface is equivalent to calling the setProperty method of the + CSSStyleDeclaration interface. + + cssutils actually also allows usage of ``del`` to remove a CSS property + from a CSSStyleDeclaration. + + This is an abstract class, the following functions need to be present + in inheriting class: + + - ``_getP`` + - ``_setP`` + - ``_delP`` + """ + # actual properties are set after the class definition! + def _getP(self, CSSname): pass + def _setP(self, CSSname, value): pass + def _delP(self, CSSname): pass + + +_reCSStoDOMname = re.compile('-[a-z]', re.I) +def _toDOMname(CSSname): + """Returns DOMname for given CSSname e.g. for CSSname 'font-style' returns + 'fontStyle'. + """ + def _doCSStoDOMname2(m): return m.group(0)[1].capitalize() + return _reCSStoDOMname.sub(_doCSStoDOMname2, CSSname) + +_reDOMtoCSSname = re.compile('([A-Z])[a-z]+') +def _toCSSname(DOMname): + """Return CSSname for given DOMname e.g. for DOMname 'fontStyle' returns + 'font-style'. + """ + def _doDOMtoCSSname2(m): return '-' + m.group(0).lower() + return _reDOMtoCSSname.sub(_doDOMtoCSSname2, DOMname) + +# add list of DOMname properties to CSS2Properties +# used for CSSStyleDeclaration to check if allowed properties +# but somehow doubled, any better way? +CSS2Properties._properties = [] +for group in cssutils.profiles.properties: + for name in cssutils.profiles.properties[group]: + CSS2Properties._properties.append(_toDOMname(name)) + + +# add CSS2Properties to CSSStyleDeclaration: +def __named_property_def(DOMname): + """ + Closure to keep name known in each properties accessor function + DOMname is converted to CSSname here, so actual calls use CSSname. + """ + CSSname = _toCSSname(DOMname) + def _get(self): return self._getP(CSSname) + def _set(self, value): self._setP(CSSname, value) + def _del(self): self._delP(CSSname) + return _get, _set, _del + +# add all CSS2Properties to CSSStyleDeclaration +for DOMname in CSS2Properties._properties: + setattr(CSS2Properties, DOMname, + property(*__named_property_def(DOMname))) diff --git a/libs/cssutils/css/cssrule.py b/libs/cssutils/css/cssrule.py new file mode 100755 index 00000000..1d3ab6fb --- /dev/null +++ b/libs/cssutils/css/cssrule.py @@ -0,0 +1,304 @@ +"""CSSRule implements DOM Level 2 CSS CSSRule.""" +__all__ = ['CSSRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +import cssutils +import xml.dom + +class CSSRule(cssutils.util.Base2): + """Abstract base interface for any type of CSS statement. This includes + both rule sets and at-rules. An implementation is expected to preserve + all rules specified in a CSS style sheet, even if the rule is not + recognized by the parser. Unrecognized rules are represented using the + :class:`CSSUnknownRule` interface. + """ + + """ + CSSRule type constants. + An integer indicating which type of rule this is. + """ + UNKNOWN_RULE = 0 + ":class:`cssutils.css.CSSUnknownRule` (not used in CSSOM anymore)" + STYLE_RULE = 1 + ":class:`cssutils.css.CSSStyleRule`" + CHARSET_RULE = 2 + ":class:`cssutils.css.CSSCharsetRule` (not used in CSSOM anymore)" + IMPORT_RULE = 3 + ":class:`cssutils.css.CSSImportRule`" + MEDIA_RULE = 4 + ":class:`cssutils.css.CSSMediaRule`" + FONT_FACE_RULE = 5 + ":class:`cssutils.css.CSSFontFaceRule`" + PAGE_RULE = 6 + ":class:`cssutils.css.CSSPageRule`" + NAMESPACE_RULE = 10 + """:class:`cssutils.css.CSSNamespaceRule`, + Value has changed in 0.9.7a3 due to a change in the CSSOM spec.""" + COMMENT = 1001 # was -1, cssutils only + """:class:`cssutils.css.CSSComment` - not in the offical spec, + Value has changed in 0.9.7a3""" + VARIABLES_RULE = 1008 + """:class:`cssutils.css.CSSVariablesRule` - experimental rule + not in the offical spec""" + + MARGIN_RULE = 1006 + """:class:`cssutils.css.MarginRule` - experimental rule + not in the offical spec""" + + _typestrings = {UNKNOWN_RULE: u'UNKNOWN_RULE', + STYLE_RULE: u'STYLE_RULE', + CHARSET_RULE: u'CHARSET_RULE', + IMPORT_RULE: u'IMPORT_RULE', + MEDIA_RULE: u'MEDIA_RULE', + FONT_FACE_RULE: u'FONT_FACE_RULE', + PAGE_RULE: u'PAGE_RULE', + NAMESPACE_RULE: u'NAMESPACE_RULE', + COMMENT: u'COMMENT', + VARIABLES_RULE: u'VARIABLES_RULE', + MARGIN_RULE: u'MARGIN_RULE' + } + + def __init__(self, parentRule=None, parentStyleSheet=None, readonly=False): + """Set common attributes for all rules.""" + super(CSSRule, self).__init__() + self._parent = parentRule + self._parentRule = parentRule + self._parentStyleSheet = parentStyleSheet + self._setSeq(self._tempSeq()) + #self._atkeyword = None + # must be set after initialization of #inheriting rule is done + self._readonly = False + + def _setAtkeyword(self, keyword): + """Check if new keyword fits the rule it is used for.""" + atkeyword = self._normalize(keyword) + if not self.atkeyword or (self.atkeyword == atkeyword): + self._atkeyword = atkeyword + self._keyword = keyword + else: + self._log.error(u'%s: Invalid atkeyword for this rule: %r' % + (self.atkeyword, keyword), + error=xml.dom.InvalidModificationErr) + + atkeyword = property(lambda self: self._atkeyword, _setAtkeyword, + doc=u"Normalized keyword of an @rule (e.g. ``@import``).") + + def _setCssText(self, cssText): + """ + :param cssText: + A parsable DOMString. + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + self._checkReadonly() + + cssText = property(lambda self: u'', _setCssText, + doc=u"(DOM) The parsable textual representation of the " + u"rule. This reflects the current state of the rule " + u"and not its initial value.") + + parent = property(lambda self: self._parent, + doc=u"The Parent Node of this CSSRule or None.") + + parentRule = property(lambda self: self._parentRule, + doc=u"If this rule is contained inside another rule " + u"(e.g. a style rule inside an @media block), this " + u"is the containing rule. If this rule is not nested " + u"inside any other rules, this returns None.") + + def _getParentStyleSheet(self): + # rules contained in other rules (@media) use that rules parent + if (self.parentRule): + return self.parentRule._parentStyleSheet + else: + return self._parentStyleSheet + + parentStyleSheet = property(_getParentStyleSheet, + doc=u"The style sheet that contains this rule.") + + type = property(lambda self: self.UNKNOWN_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + typeString = property(lambda self: CSSRule._typestrings[self.type], + doc=u"Descriptive name of this rule's type.") + + wellformed = property(lambda self: False, + doc=u"If the rule is wellformed.") + + + +class CSSRuleRules(CSSRule): + """Abstract base interface for rules that contain other rules + like @media or @page. Methods may be overwritten if a rule + has specific stuff to do like checking the order of insertion like + @media does. + """ + + def __init__(self, parentRule=None, parentStyleSheet=None): + + super(CSSRuleRules, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + + self.cssRules = cssutils.css.CSSRuleList() + + def __iter__(self): + """Generator iterating over these rule's cssRules.""" + for rule in self._cssRules: + yield rule + + def _setCssRules(self, cssRules): + "Set new cssRules and update contained rules refs." + cssRules.append = self.insertRule + cssRules.extend = self.insertRule + cssRules.__delitem__ == self.deleteRule + + for rule in cssRules: + rule._parentRule = self + rule._parentStyleSheet = None + + self._cssRules = cssRules + + cssRules = property(lambda self: self._cssRules, _setCssRules, + "All Rules in this style sheet, a " + ":class:`~cssutils.css.CSSRuleList`.") + + def deleteRule(self, index): + """ + Delete the rule at `index` from rules ``cssRules``. + + :param index: + The `index` of the rule to be removed from the rules cssRules + list. For an `index` < 0 **no** :exc:`~xml.dom.IndexSizeErr` is + raised but rules for normal Python lists are used. E.g. + ``deleteRule(-1)`` removes the last rule in cssRules. + + `index` may also be a CSSRule object which will then be removed. + + :Exceptions: + - :exc:`~xml.dom.IndexSizeErr`: + Raised if the specified index does not correspond to a rule in + the media rule list. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this media rule is readonly. + """ + self._checkReadonly() + + if isinstance(index, CSSRule): + for i, r in enumerate(self.cssRules): + if index == r: + index = i + break + else: + raise xml.dom.IndexSizeErr(u"%s: Not a rule in " + u"this rule'a cssRules list: %s" + % (self.__class__.__name__, index)) + + try: + # detach + self._cssRules[index]._parentRule = None + del self._cssRules[index] + + except IndexError: + raise xml.dom.IndexSizeErr(u'%s: %s is not a valid index ' + u'in the rulelist of length %i' + % (self.__class__.__name__, + index, self._cssRules.length)) + + def _prepareInsertRule(self, rule, index=None): + "return checked `index` and optional parsed `rule`" + self._checkReadonly() + + # check index + if index is None: + index = len(self._cssRules) + + elif index < 0 or index > self._cssRules.length: + raise xml.dom.IndexSizeErr(u'%s: Invalid index %s for ' + u'CSSRuleList with a length of %s.' + % (self.__class__.__name__, + index, self._cssRules.length)) + + # check and optionally parse rule + if isinstance(rule, basestring): + tempsheet = cssutils.css.CSSStyleSheet() + tempsheet.cssText = rule + if len(tempsheet.cssRules) != 1 or (tempsheet.cssRules and + not isinstance(tempsheet.cssRules[0], cssutils.css.CSSRule)): + self._log.error(u'%s: Invalid Rule: %s' % (self.__class__.__name__, + rule)) + return False, False + rule = tempsheet.cssRules[0] + + elif isinstance(rule, cssutils.css.CSSRuleList): + # insert all rules + for i, r in enumerate(rule): + self.insertRule(r, index + i) + return True, True + + elif not isinstance(rule, cssutils.css.CSSRule): + self._log.error(u'%s: Not a CSSRule: %s' % (rule, + self.__class__.__name__)) + return False, False + + return rule, index + + def _finishInsertRule(self, rule, index): + "add `rule` at `index`" + rule._parentRule = self + rule._parentStyleSheet = None + self._cssRules.insert(index, rule) + return index + + def add(self, rule): + """Add `rule` to page rule. Same as ``insertRule(rule)``.""" + return self.insertRule(rule) + + def insertRule(self, rule, index=None): + """ + Insert `rule` into the rules ``cssRules``. + + :param rule: + the parsable text representing the `rule` to be inserted. For rule + sets this contains both the selector and the style declaration. + For at-rules, this specifies both the at-identifier and the rule + content. + + cssutils also allows rule to be a valid + :class:`~cssutils.css.CSSRule` object. + + :param index: + before the `index` the specified `rule` will be inserted. + If the specified `index` is equal to the length of the rules + rule collection, the rule will be added to the end of the rule. + If index is not given or None rule will be appended to rule + list. + + :returns: + the index of the newly inserted rule. + + :exceptions: + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the `rule` cannot be inserted at the specified `index`, + e.g., if an @import rule is inserted after a standard rule set + or other at-rule. + - :exc:`~xml.dom.IndexSizeErr`: + Raised if the specified `index` is not a valid insertion point. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this rule is readonly. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified `rule` has a syntax error and is + unparsable. + """ + return self._prepareInsertRule(rule, index) diff --git a/libs/cssutils/css/cssrulelist.py b/libs/cssutils/css/cssrulelist.py new file mode 100755 index 00000000..f9daff49 --- /dev/null +++ b/libs/cssutils/css/cssrulelist.py @@ -0,0 +1,53 @@ +"""CSSRuleList implements DOM Level 2 CSS CSSRuleList. +Partly also http://dev.w3.org/csswg/cssom/#the-cssrulelist.""" +__all__ = ['CSSRuleList'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +class CSSRuleList(list): + """The CSSRuleList object represents an (ordered) list of statements. + + The items in the CSSRuleList are accessible via an integral index, + starting from 0. + + Subclasses a standard Python list so theoretically all standard list + methods are available. Setting methods like ``__init__``, ``append``, + ``extend`` or ``__setslice__`` are added later on instances of this + class if so desired. + E.g. CSSStyleSheet adds ``append`` which is not available in a simple + instance of this class! + """ + def __init__(self, *ignored): + "Nothing is set as this must also be defined later." + pass + + def __notimplemented(self, *ignored): + "Implemented in class using a CSSRuleList only." + raise NotImplementedError( + 'Must be implemented by class using an instance of this class.') + + append = extend = __setitem__ = __setslice__ = __notimplemented + + def item(self, index): + """(DOM) Retrieve a CSS rule by ordinal `index`. The order in this + collection represents the order of the rules in the CSS style + sheet. If index is greater than or equal to the number of rules in + the list, this returns None. + + Returns CSSRule, the style rule at the index position in the + CSSRuleList, or None if that is not a valid index. + """ + try: + return self[index] + except IndexError: + return None + + length = property(lambda self: len(self), + doc=u"(DOM) The number of CSSRules in the list.") + + def rulesOfType(self, type): + """Yield the rules which have the given `type` only, one of the + constants defined in :class:`cssutils.css.CSSRule`.""" + for r in self: + if r.type == type: + yield r diff --git a/libs/cssutils/css/cssstyledeclaration.py b/libs/cssutils/css/cssstyledeclaration.py new file mode 100755 index 00000000..7573487a --- /dev/null +++ b/libs/cssutils/css/cssstyledeclaration.py @@ -0,0 +1,697 @@ +"""CSSStyleDeclaration implements DOM Level 2 CSS CSSStyleDeclaration and +extends CSS2Properties + +see + http://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#parsing-errors + +Unknown properties +------------------ +User agents must ignore a declaration with an unknown property. +For example, if the style sheet is:: + + H1 { color: red; rotation: 70minutes } + +the user agent will treat this as if the style sheet had been:: + + H1 { color: red } + +Cssutils gives a message about any unknown properties but +keeps any property (if syntactically correct). + +Illegal values +-------------- +User agents must ignore a declaration with an illegal value. For example:: + + IMG { float: left } /* correct CSS2 */ + IMG { float: left here } /* "here" is not a value of 'float' */ + IMG { background: "red" } /* keywords cannot be quoted in CSS2 */ + IMG { border-width: 3 } /* a unit must be specified for length values */ + +A CSS2 parser would honor the first rule and ignore the rest, as if the +style sheet had been:: + + IMG { float: left } + IMG { } + IMG { } + IMG { } + +Cssutils again will issue a message (WARNING in this case) about invalid +CSS2 property values. + +TODO: + This interface is also used to provide a read-only access to the + computed values of an element. See also the ViewCSS interface. + + - return computed values and not literal values + - simplify unit pairs/triples/quadruples + 2px 2px 2px 2px -> 2px for border/padding... + - normalize compound properties like: + background: no-repeat left url() #fff + -> background: #fff url() no-repeat left +""" +__all__ = ['CSSStyleDeclaration', 'Property'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssproperties import CSS2Properties +from property import Property +import cssutils +import xml.dom + +class CSSStyleDeclaration(CSS2Properties, cssutils.util.Base2): + """The CSSStyleDeclaration class represents a single CSS declaration + block. This class may be used to determine the style properties + currently set in a block or to set style properties explicitly + within the block. + + While an implementation may not recognize all CSS properties within + a CSS declaration block, it is expected to provide access to all + specified properties in the style sheet through the + CSSStyleDeclaration interface. + Furthermore, implementations that support a specific level of CSS + should correctly handle CSS shorthand properties for that level. For + a further discussion of shorthand properties, see the CSS2Properties + interface. + + Additionally the CSS2Properties interface is implemented. + + $css2propertyname + All properties defined in the CSS2Properties class are available + as direct properties of CSSStyleDeclaration with their respective + DOM name, so e.g. ``fontStyle`` for property 'font-style'. + + These may be used as:: + + >>> style = CSSStyleDeclaration(cssText='color: red') + >>> style.color = 'green' + >>> print style.color + green + >>> del style.color + >>> print style.color + + + Format:: + + [Property: Value Priority?;]* [Property: Value Priority?]? + """ + def __init__(self, cssText=u'', parentRule=None, readonly=False, + validating=None): + """ + :param cssText: + Shortcut, sets CSSStyleDeclaration.cssText + :param parentRule: + The CSS rule that contains this declaration block or + None if this CSSStyleDeclaration is not attached to a CSSRule. + :param readonly: + defaults to False + :param validating: + a flag defining if this sheet should be validated on change. + Defaults to None, which means defer to the parent stylesheet. + """ + super(CSSStyleDeclaration, self).__init__() + self._parentRule = parentRule + self.validating = validating + self.cssText = cssText + self._readonly = readonly + + def __contains__(self, nameOrProperty): + """Check if a property (or a property with given name) is in style. + + :param name: + a string or Property, uses normalized name and not literalname + """ + if isinstance(nameOrProperty, Property): + name = nameOrProperty.name + else: + name = self._normalize(nameOrProperty) + return name in self.__nnames() + + def __iter__(self): + """Iterator of set Property objects with different normalized names.""" + def properties(): + for name in self.__nnames(): + yield self.getProperty(name) + return properties() + + def keys(self): + """Analoguous to standard dict returns property names which are set in + this declaration.""" + return list(self.__nnames()) + + def __getitem__(self, CSSName): + """Retrieve the value of property ``CSSName`` from this declaration. + + ``CSSName`` will be always normalized. + """ + return self.getPropertyValue(CSSName) + + def __setitem__(self, CSSName, value): + """Set value of property ``CSSName``. ``value`` may also be a tuple of + (value, priority), e.g. style['color'] = ('red', 'important') + + ``CSSName`` will be always normalized. + """ + priority = None + if isinstance(value, tuple): + value, priority = value + + return self.setProperty(CSSName, value, priority) + + def __delitem__(self, CSSName): + """Delete property ``CSSName`` from this declaration. + If property is not in this declaration return u'' just like + removeProperty. + + ``CSSName`` will be always normalized. + """ + return self.removeProperty(CSSName) + + def __setattr__(self, n, v): + """Prevent setting of unknown properties on CSSStyleDeclaration + which would not work anyway. For these + ``CSSStyleDeclaration.setProperty`` MUST be called explicitly! + + TODO: + implementation of known is not really nice, any alternative? + """ + known = ['_tokenizer', '_log', '_ttypes', + '_seq', 'seq', 'parentRule', '_parentRule', 'cssText', + 'valid', 'wellformed', 'validating', + '_readonly', '_profiles', '_validating'] + known.extend(CSS2Properties._properties) + if n in known: + super(CSSStyleDeclaration, self).__setattr__(n, v) + else: + raise AttributeError(u'Unknown CSS Property, ' + u'``CSSStyleDeclaration.setProperty("%s", ' + u'...)`` MUST be used.' % n) + + def __repr__(self): + return u"cssutils.css.%s(cssText=%r)" % ( + self.__class__.__name__, + self.getCssText(separator=u' ')) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.length, + len(self.getProperties(all=True)), + id(self)) + + def __nnames(self): + """Return iterator for all different names in order as set + if names are set twice the last one is used (double reverse!) + """ + names = [] + for item in reversed(self.seq): + val = item.value + if isinstance(val, Property) and not val.name in names: + names.append(val.name) + return reversed(names) + + # overwritten accessor functions for CSS2Properties' properties + def _getP(self, CSSName): + """(DOM CSS2Properties) Overwritten here and effectively the same as + ``self.getPropertyValue(CSSname)``. + + Parameter is in CSSname format ('font-style'), see CSS2Properties. + + Example:: + + >>> style = CSSStyleDeclaration(cssText='font-style:italic;') + >>> print style.fontStyle + italic + """ + return self.getPropertyValue(CSSName) + + def _setP(self, CSSName, value): + """(DOM CSS2Properties) Overwritten here and effectively the same as + ``self.setProperty(CSSname, value)``. + + Only known CSS2Properties may be set this way, otherwise an + AttributeError is raised. + For these unknown properties ``setPropertyValue(CSSname, value)`` + has to be called explicitly. + Also setting the priority of properties needs to be done with a + call like ``setPropertyValue(CSSname, value, priority)``. + + Example:: + + >>> style = CSSStyleDeclaration() + >>> style.fontStyle = 'italic' + >>> # or + >>> style.setProperty('font-style', 'italic', '!important') + + """ + self.setProperty(CSSName, value) + # TODO: Shorthand ones + + def _delP(self, CSSName): + """(cssutils only) Overwritten here and effectively the same as + ``self.removeProperty(CSSname)``. + + Example:: + + >>> style = CSSStyleDeclaration(cssText='font-style:italic;') + >>> del style.fontStyle + >>> print style.fontStyle + + + """ + self.removeProperty(CSSName) + + def children(self): + """Generator yielding any known child in this declaration including + *all* properties, comments or CSSUnknownrules. + """ + for item in self._seq: + yield item.value + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_css_CSSStyleDeclaration(self) + + def _setCssText(self, cssText): + """Setting this attribute will result in the parsing of the new value + and resetting of all the properties in the declaration block + including the removal or addition of properties. + + :exceptions: + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this declaration is readonly or a property is readonly. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + """ + self._checkReadonly() + tokenizer = self._tokenize2(cssText) + + # for closures: must be a mutable + new = {'wellformed': True} + def ident(expected, seq, token, tokenizer=None): + # a property + + tokens = self._tokensupto2(tokenizer, starttoken=token, + semicolon=True) + if self._tokenvalue(tokens[-1]) == u';': + tokens.pop() + property = Property(parent=self) + property.cssText = tokens + if property.wellformed: + seq.append(property, 'Property') + else: + self._log.error(u'CSSStyleDeclaration: Syntax Error in ' + u'Property: %s' % self._valuestr(tokens)) + # does not matter in this case + return expected + + def unexpected(expected, seq, token, tokenizer=None): + # error, find next ; or } to omit upto next property + ignored = self._tokenvalue(token) + self._valuestr( + self._tokensupto2(tokenizer, + propertyvalueendonly=True)) + self._log.error(u'CSSStyleDeclaration: Unexpected token, ignoring ' + 'upto %r.' % ignored,token) + # does not matter in this case + return expected + + def char(expected, seq, token, tokenizer=None): + # a standalone ; or error... + if self._tokenvalue(token) == u';': + self._log.info(u'CSSStyleDeclaration: Stripped standalone semicolon' + u': %s' % self._valuestr([token]), neverraise=True) + return expected + else: + return unexpected(expected, seq, token, tokenizer) + + # [Property: Value;]* Property: Value? + newseq = self._tempSeq() + wellformed, expected = self._parse(expected=None, + seq=newseq, tokenizer=tokenizer, + productions={'IDENT': ident, 'CHAR': char}, + default=unexpected) + # wellformed set by parse + + for item in newseq: + item.value._parent = self + + # do not check wellformed as invalid things are removed anyway + self._setSeq(newseq) + + cssText = property(_getCssText, _setCssText, + doc=u"(DOM) A parsable textual representation of the " + u"declaration block excluding the surrounding curly " + u"braces.") + + def getCssText(self, separator=None): + """ + :returns: + serialized property cssText, each property separated by + given `separator` which may e.g. be ``u''`` to be able to use + cssText directly in an HTML style attribute. ``;`` is part of + each property (except the last one) and **cannot** be set with + separator! + """ + return cssutils.ser.do_css_CSSStyleDeclaration(self, separator) + + def _setParentRule(self, parentRule): + self._parentRule = parentRule +# for x in self.children(): +# x.parent = self + + parentRule = property(lambda self: self._parentRule, _setParentRule, + doc="(DOM) The CSS rule that contains this declaration block or " + "None if this CSSStyleDeclaration is not attached to a CSSRule.") + + def getProperties(self, name=None, all=False): + """ + :param name: + optional `name` of properties which are requested. + Only properties with this **always normalized** `name` are returned. + If `name` is ``None`` all properties are returned (at least one for + each set name depending on parameter `all`). + :param all: + if ``False`` (DEFAULT) only the effective properties are returned. + If name is given a list with only one property is returned. + + if ``True`` all properties including properties set multiple times + with different values or priorities for different UAs are returned. + The order of the properties is fully kept as in the original + stylesheet. + :returns: + a list of :class:`~cssutils.css.Property` objects set in + this declaration. + """ + if name and not all: + # single prop but list + p = self.getProperty(name) + if p: + return [p] + else: + return [] + elif not all: + # effective Properties in name order + return [self.getProperty(name) for name in self.__nnames()] + else: + # all properties or all with this name + nname = self._normalize(name) + properties = [] + for item in self.seq: + val = item.value + if isinstance(val, Property) and ( + (bool(nname) == False) or (val.name == nname)): + properties.append(val) + return properties + + def getProperty(self, name, normalize=True): + """ + :param name: + of the CSS property, always lowercase (even if not normalized) + :param normalize: + if ``True`` (DEFAULT) name will be normalized (lowercase, no simple + escapes) so "color", "COLOR" or "C\olor" will all be equivalent + + If ``False`` may return **NOT** the effective value but the + effective for the unnormalized name. + :returns: + the effective :class:`~cssutils.css.Property` object. + """ + nname = self._normalize(name) + found = None + for item in reversed(self.seq): + val = item.value + if isinstance(val, Property): + if (normalize and nname == val.name) or name == val.literalname: + if val.priority: + return val + elif not found: + found = val + return found + + def getPropertyCSSValue(self, name, normalize=True): + """ + :param name: + of the CSS property, always lowercase (even if not normalized) + :param normalize: + if ``True`` (DEFAULT) name will be normalized (lowercase, no simple + escapes) so "color", "COLOR" or "C\olor" will all be equivalent + + If ``False`` may return **NOT** the effective value but the + effective for the unnormalized name. + :returns: + :class:`~cssutils.css.CSSValue`, the value of the effective + property if it has been explicitly set for this declaration block. + + (DOM) + Used to retrieve the object representation of the value of a CSS + property if it has been explicitly set within this declaration + block. Returns None if the property has not been set. + + (This method returns None if the property is a shorthand + property. Shorthand property values can only be accessed and + modified as strings, using the getPropertyValue and setProperty + methods.) + + **cssutils currently always returns a CSSValue if the property is + set.** + + for more on shorthand properties see + http://www.dustindiaz.com/css-shorthand/ + """ + nname = self._normalize(name) + if nname in self._SHORTHANDPROPERTIES: + self._log.info(u'CSSValue for shorthand property "%s" should be ' + u'None, this may be implemented later.' % + nname, neverraise=True) + + p = self.getProperty(name, normalize) + if p: + return p.cssValue + else: + return None + + def getPropertyValue(self, name, normalize=True): + """ + :param name: + of the CSS property, always lowercase (even if not normalized) + :param normalize: + if ``True`` (DEFAULT) name will be normalized (lowercase, no simple + escapes) so "color", "COLOR" or "C\olor" will all be equivalent + + If ``False`` may return **NOT** the effective value but the + effective for the unnormalized name. + :returns: + the value of the effective property if it has been explicitly set + for this declaration block. Returns the empty string if the + property has not been set. + """ + p = self.getProperty(name, normalize) + if p: + return p.value + else: + return u'' + + def getPropertyPriority(self, name, normalize=True): + """ + :param name: + of the CSS property, always lowercase (even if not normalized) + :param normalize: + if ``True`` (DEFAULT) name will be normalized (lowercase, no simple + escapes) so "color", "COLOR" or "C\olor" will all be equivalent + + If ``False`` may return **NOT** the effective value but the + effective for the unnormalized name. + :returns: + the priority of the effective CSS property (e.g. the + "important" qualifier) if the property has been explicitly set in + this declaration block. The empty string if none exists. + """ + p = self.getProperty(name, normalize) + if p: + return p.priority + else: + return u'' + + def removeProperty(self, name, normalize=True): + """ + (DOM) + Used to remove a CSS property if it has been explicitly set within + this declaration block. + + :param name: + of the CSS property + :param normalize: + if ``True`` (DEFAULT) name will be normalized (lowercase, no simple + escapes) so "color", "COLOR" or "C\olor" will all be equivalent. + The effective Property value is returned and *all* Properties + with ``Property.name == name`` are removed. + + If ``False`` may return **NOT** the effective value but the + effective for the unnormalized `name` only. Also only the + Properties with the literal name `name` are removed. + :returns: + the value of the property if it has been explicitly set for + this declaration block. Returns the empty string if the property + has not been set or the property name does not correspond to a + known CSS property + + + :exceptions: + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this declaration is readonly or the property is + readonly. + """ + self._checkReadonly() + r = self.getPropertyValue(name, normalize=normalize) + newseq = self._tempSeq() + if normalize: + # remove all properties with name == nname + nname = self._normalize(name) + for item in self.seq: + if not (isinstance(item.value, Property) + and item.value.name == nname): + newseq.appendItem(item) + else: + # remove all properties with literalname == name + for item in self.seq: + if not (isinstance(item.value, Property) + and item.value.literalname == name): + newseq.appendItem(item) + self._setSeq(newseq) + return r + + def setProperty(self, name, value=None, priority=u'', + normalize=True, replace=True): + """(DOM) Set a property value and priority within this declaration + block. + + :param name: + of the CSS property to set (in W3C DOM the parameter is called + "propertyName"), always lowercase (even if not normalized) + + If a property with this `name` is present it will be reset. + + cssutils also allowed `name` to be a + :class:`~cssutils.css.Property` object, all other + parameter are ignored in this case + + :param value: + the new value of the property, ignored if `name` is a Property. + :param priority: + the optional priority of the property (e.g. "important"), + ignored if `name` is a Property. + :param normalize: + if True (DEFAULT) `name` will be normalized (lowercase, no simple + escapes) so "color", "COLOR" or "C\olor" will all be equivalent + :param replace: + if True (DEFAULT) the given property will replace a present + property. If False a new property will be added always. + The difference to `normalize` is that two or more properties with + the same name may be set, useful for e.g. stuff like:: + + background: red; + background: rgba(255, 0, 0, 0.5); + + which defines the same property but only capable UAs use the last + property value, older ones use the first value. + + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified value has a syntax error and is + unparsable. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this declaration is readonly or the property is + readonly. + """ + self._checkReadonly() + + if isinstance(name, Property): + newp = name + name = newp.literalname + elif not value: + # empty string or None effectively removed property + return self.removeProperty(name) + else: + newp = Property(name, value, priority) + + if newp.wellformed: + if replace: + # check if update + nname = self._normalize(name) + properties = self.getProperties(name, all=(not normalize)) + for property in reversed(properties): + if normalize and property.name == nname: + property.cssValue = newp.cssValue.cssText + property.priority = newp.priority + return + elif property.literalname == name: + property.cssValue = newp.cssValue.cssText + property.priority = newp.priority + return + + # not yet set or forced omit replace + newp.parent = self + self.seq._readonly = False + self.seq.append(newp, 'Property') + self.seq._readonly = True + + else: + self._log.warn(u'Invalid Property: %s: %s %s' + % (name, value, priority)) + + def item(self, index): + """(DOM) Retrieve the properties that have been explicitly set in + this declaration block. The order of the properties retrieved using + this method does not have to be the order in which they were set. + This method can be used to iterate over all properties in this + declaration block. + + :param index: + of the property to retrieve, negative values behave like + negative indexes on Python lists, so -1 is the last element + + :returns: + the name of the property at this ordinal position. The + empty string if no property exists at this position. + + **ATTENTION:** + Only properties with different names are counted. If two + properties with the same name are present in this declaration + only the effective one is included. + + :meth:`item` and :attr:`length` work on the same set here. + """ + names = list(self.__nnames()) + try: + return names[index] + except IndexError: + return u'' + + length = property(lambda self: len(list(self.__nnames())), + doc=u"(DOM) The number of distinct properties that have " + u"been explicitly in this declaration block. The " + u"range of valid indices is 0 to length-1 inclusive. " + u"These are properties with a different ``name`` " + u"only. :meth:`item` and :attr:`length` work on the " + u"same set here.") + + def _getValidating(self): + try: + # CSSParser.parseX() sets validating of stylesheet + return self.parentRule.parentStyleSheet.validating + except AttributeError: + # CSSParser.parseStyle() sets validating of declaration + if self._validating is not None: + return self._validating + # default + return True + + def _setValidating(self, validating): + self._validating = validating + + validating = property(_getValidating, _setValidating, + doc=u"If ``True`` this declaration validates " + u"contained properties. The parent StyleSheet " + u"validation setting does *always* win though so " + u"even if validating is True it may not validate " + u"if the StyleSheet defines else!") diff --git a/libs/cssutils/css/cssstylerule.py b/libs/cssutils/css/cssstylerule.py new file mode 100755 index 00000000..db85b8b5 --- /dev/null +++ b/libs/cssutils/css/cssstylerule.py @@ -0,0 +1,234 @@ +"""CSSStyleRule implements DOM Level 2 CSS CSSStyleRule.""" +__all__ = ['CSSStyleRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssstyledeclaration import CSSStyleDeclaration +from selectorlist import SelectorList +import cssrule +import cssutils +import xml.dom + +class CSSStyleRule(cssrule.CSSRule): + """The CSSStyleRule object represents a ruleset specified (if any) in a CSS + style sheet. It provides access to a declaration block as well as to the + associated group of selectors. + + Format:: + + : selector [ COMMA S* selector ]* + LBRACE S* declaration [ ';' S* declaration ]* '}' S* + ; + """ + def __init__(self, selectorText=None, style=None, parentRule=None, + parentStyleSheet=None, readonly=False): + """ + :Parameters: + selectorText + string parsed into selectorList + style + string parsed into CSSStyleDeclaration for this CSSStyleRule + readonly + if True allows setting of properties in constructor only + """ + super(CSSStyleRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + + self.selectorList = SelectorList() + if selectorText: + self.selectorText = selectorText + + if style: + self.style = style + else: + self.style = CSSStyleDeclaration() + + self._readonly = readonly + + def __repr__(self): + if self._namespaces: + st = (self.selectorText, self._namespaces) + else: + st = self.selectorText + return u"cssutils.css.%s(selectorText=%r, style=%r)" % ( + self.__class__.__name__, st, self.style.cssText) + + def __str__(self): + return u"" % (self.__class__.__name__, + self.selectorText, + self.style.cssText, + self._namespaces, + id(self)) + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_CSSStyleRule(self) + + def _setCssText(self, cssText): + """ + :param cssText: + a parseable string or a tuple of (cssText, dict-of-namespaces) + :exceptions: + - :exc:`~xml.dom.NamespaceErr`: + Raised if the specified selector uses an unknown namespace + prefix. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + super(CSSStyleRule, self)._setCssText(cssText) + + # might be (cssText, namespaces) + cssText, namespaces = self._splitNamespacesOff(cssText) + try: + # use parent style sheet ones if available + namespaces = self.parentStyleSheet.namespaces + except AttributeError: + pass + + tokenizer = self._tokenize2(cssText) + selectortokens = self._tokensupto2(tokenizer, blockstartonly=True) + styletokens = self._tokensupto2(tokenizer, blockendonly=True) + trail = self._nexttoken(tokenizer) + if trail: + self._log.error(u'CSSStyleRule: Trailing content: %s' % + self._valuestr(cssText), token=trail) + elif not selectortokens: + self._log.error(u'CSSStyleRule: No selector found: %r' % + self._valuestr(cssText)) + elif self._tokenvalue(selectortokens[0]).startswith(u'@'): + self._log.error(u'CSSStyleRule: No style rule: %r' % + self._valuestr(cssText), + error=xml.dom.InvalidModificationErr) + else: + newSelectorList = SelectorList(parentRule=self) + newStyle = CSSStyleDeclaration(parentRule=self) + ok = True + + bracetoken = selectortokens.pop() + if self._tokenvalue(bracetoken) != u'{': + ok = False + self._log.error( + u'CSSStyleRule: No start { of style declaration found: %r' % + self._valuestr(cssText), bracetoken) + elif not selectortokens: + ok = False + self._log.error(u'CSSStyleRule: No selector found: %r.' % + self._valuestr(cssText), bracetoken) + # SET + newSelectorList.selectorText = (selectortokens, + namespaces) + + if not styletokens: + ok = False + self._log.error( + u'CSSStyleRule: No style declaration or "}" found: %r' % + self._valuestr(cssText)) + else: + braceorEOFtoken = styletokens.pop() + val, typ = self._tokenvalue(braceorEOFtoken),\ + self._type(braceorEOFtoken) + if val != u'}' and typ != 'EOF': + ok = False + self._log.error(u'CSSStyleRule: No "}" after style ' + u'declaration found: %r' + % self._valuestr(cssText)) + else: + if 'EOF' == typ: + # add again as style needs it + styletokens.append(braceorEOFtoken) + # SET, may raise: + newStyle.cssText = styletokens + + if ok: + self.selectorList = newSelectorList + self.style = newStyle + + cssText = property(_getCssText, _setCssText, + doc=u"(DOM) The parsable textual representation of this " + u"rule.") + + def __getNamespaces(self): + """Uses children namespaces if not attached to a sheet, else the sheet's + ones.""" + try: + return self.parentStyleSheet.namespaces + except AttributeError: + return self.selectorList._namespaces + + _namespaces = property(__getNamespaces, + doc=u"If this Rule is attached to a CSSStyleSheet " + u"the namespaces of that sheet are mirrored " + u"here. While the Rule is not attached the " + u"namespaces of selectorList are used.""") + + def _setSelectorList(self, selectorList): + """ + :param selectorList: A SelectorList which replaces the current + selectorList object + """ + self._checkReadonly() + selectorList._parentRule = self + self._selectorList = selectorList + + _selectorList = None + selectorList = property(lambda self: self._selectorList, _setSelectorList, + doc=u"The SelectorList of this rule.") + + def _setSelectorText(self, selectorText): + """ + wrapper for cssutils SelectorList object + + :param selectorText: + of type string, might also be a comma separated list + of selectors + :exceptions: + - :exc:`~xml.dom.NamespaceErr`: + Raised if the specified selector uses an unknown namespace + prefix. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error + and is unparsable. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this rule is readonly. + """ + self._checkReadonly() + + sl = SelectorList(selectorText=selectorText, parentRule=self) + if sl.wellformed: + self._selectorList = sl + + selectorText = property(lambda self: self._selectorList.selectorText, + _setSelectorText, + doc=u"(DOM) The textual representation of the " + u"selector for the rule set.") + + def _setStyle(self, style): + """ + :param style: A string or CSSStyleDeclaration which replaces the + current style object. + """ + self._checkReadonly() + if isinstance(style, basestring): + self._style = CSSStyleDeclaration(cssText=style, parentRule=self) + else: + style._parentRule = self + self._style = style + + style = property(lambda self: self._style, _setStyle, + doc=u"(DOM) The declaration-block of this rule set.") + + type = property(lambda self: self.STYLE_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + "type constant.") + + wellformed = property(lambda self: self.selectorList.wellformed) diff --git a/libs/cssutils/css/cssstylesheet.py b/libs/cssutils/css/cssstylesheet.py new file mode 100755 index 00000000..88c46b8c --- /dev/null +++ b/libs/cssutils/css/cssstylesheet.py @@ -0,0 +1,804 @@ +"""CSSStyleSheet implements DOM Level 2 CSS CSSStyleSheet. + +Partly also: + - http://dev.w3.org/csswg/cssom/#the-cssstylesheet + - http://www.w3.org/TR/2006/WD-css3-namespace-20060828/ + +TODO: + - ownerRule and ownerNode +""" +__all__ = ['CSSStyleSheet'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssutils.helper import Deprecated +from cssutils.util import _Namespaces, _SimpleNamespaces, _readUrl +from cssrule import CSSRule +from cssvariablesdeclaration import CSSVariablesDeclaration +import cssutils.stylesheets +import xml.dom + +class CSSStyleSheet(cssutils.stylesheets.StyleSheet): + """CSSStyleSheet represents a CSS style sheet. + + Format:: + + stylesheet + : [ CHARSET_SYM S* STRING S* ';' ]? + [S|CDO|CDC]* [ import [S|CDO|CDC]* ]* + [ namespace [S|CDO|CDC]* ]* # according to @namespace WD + [ [ ruleset | media | page ] [S|CDO|CDC]* ]* + + ``cssRules`` + All Rules in this style sheet, a :class:`~cssutils.css.CSSRuleList`. + """ + def __init__(self, href=None, media=None, title=u'', disabled=None, + ownerNode=None, parentStyleSheet=None, readonly=False, + ownerRule=None, + validating=True): + """ + For parameters see :class:`~cssutils.stylesheets.StyleSheet` + """ + super(CSSStyleSheet, self).__init__( + 'text/css', href, media, title, disabled, + ownerNode, parentStyleSheet, + validating=validating) + + self._ownerRule = ownerRule + self.cssRules = cssutils.css.CSSRuleList() + self._namespaces = _Namespaces(parentStyleSheet=self, log=self._log) + self._variables = CSSVariablesDeclaration() + self._readonly = readonly + + # used only during setting cssText by parse*() + self.__encodingOverride = None + self._fetcher = None + + def __iter__(self): + "Generator which iterates over cssRules." + for rule in self._cssRules: + yield rule + + def __repr__(self): + if self.media: + mediaText = self.media.mediaText + else: + mediaText = None + return "cssutils.css.%s(href=%r, media=%r, title=%r)" % ( + self.__class__.__name__, + self.href, mediaText, self.title) + + def __str__(self): + if self.media: + mediaText = self.media.mediaText + else: + mediaText = None + return "" % ( + self.__class__.__name__, self.encoding, self.href, + mediaText, self.title, self.namespaces.namespaces, + id(self)) + + def _cleanNamespaces(self): + "Remove all namespace rules with same namespaceURI but last." + rules = self.cssRules + namespaceitems = self.namespaces.items() + i = 0 + while i < len(rules): + rule = rules[i] + if rule.type == rule.NAMESPACE_RULE and \ + (rule.prefix, rule.namespaceURI) not in namespaceitems: + self.deleteRule(i) + else: + i += 1 + + def _getUsedURIs(self): + "Return set of URIs used in the sheet." + useduris = set() + for r1 in self: + if r1.STYLE_RULE == r1.type: + useduris.update(r1.selectorList._getUsedUris()) + elif r1.MEDIA_RULE == r1.type: + for r2 in r1: + if r2.type == r2.STYLE_RULE: + useduris.update(r2.selectorList._getUsedUris()) + return useduris + + def _setCssRules(self, cssRules): + "Set new cssRules and update contained rules refs." + cssRules.append = self.insertRule + cssRules.extend = self.insertRule + cssRules.__delitem__ = self.deleteRule + + for rule in cssRules: + rule._parentStyleSheet = self + + self._cssRules = cssRules + + cssRules = property(lambda self: self._cssRules, _setCssRules, + u"All Rules in this style sheet, a " + u":class:`~cssutils.css.CSSRuleList`.") + + def _getCssText(self): + "Textual representation of the stylesheet (a byte string)." + return cssutils.ser.do_CSSStyleSheet(self) + + def _setCssText(self, cssText): + """Parse `cssText` and overwrites the whole stylesheet. + + :param cssText: + a parseable string or a tuple of (cssText, dict-of-namespaces) + :exceptions: + - :exc:`~xml.dom.NamespaceErr`: + If a namespace prefix is found which is not declared. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + """ + self._checkReadonly() + + cssText, namespaces = self._splitNamespacesOff(cssText) + tokenizer = self._tokenize2(cssText) + + def S(expected, seq, token, tokenizer=None): + # @charset must be at absolute beginning of style sheet + # or 0 for py3 + return max(1, expected or 0) + + def COMMENT(expected, seq, token, tokenizer=None): + "special: sets parent*" + self.insertRule(cssutils.css.CSSComment([token], + parentStyleSheet=self)) + # or 0 for py3 + return max(1, expected or 0) + + def charsetrule(expected, seq, token, tokenizer): + # parse and consume tokens in any case + rule = cssutils.css.CSSCharsetRule(parentStyleSheet=self) + rule.cssText = self._tokensupto2(tokenizer, token) + + if expected > 0: + self._log.error(u'CSSStylesheet: CSSCharsetRule only allowed ' + u'at beginning of stylesheet.', + token, xml.dom.HierarchyRequestErr) + return expected + elif rule.wellformed: + self.insertRule(rule) + + return 1 + + def importrule(expected, seq, token, tokenizer): + # parse and consume tokens in any case + rule = cssutils.css.CSSImportRule(parentStyleSheet=self) + rule.cssText = self._tokensupto2(tokenizer, token) + + if expected > 1: + self._log.error(u'CSSStylesheet: CSSImportRule not allowed ' + u'here.', token, xml.dom.HierarchyRequestErr) + return expected + elif rule.wellformed: + self.insertRule(rule) + + return 1 + + def namespacerule(expected, seq, token, tokenizer): + # parse and consume tokens in any case + rule = cssutils.css.CSSNamespaceRule(cssText=self._tokensupto2(tokenizer, + token), + parentStyleSheet=self) + + if expected > 2: + self._log.error(u'CSSStylesheet: CSSNamespaceRule not allowed ' + u'here.', token, xml.dom.HierarchyRequestErr) + return expected + elif rule.wellformed: + if rule.prefix not in self.namespaces: + # add new if not same prefix + self.insertRule(rule, _clean=False) + else: + # same prefix => replace namespaceURI + for r in self.cssRules.rulesOfType(rule.NAMESPACE_RULE): + if r.prefix == rule.prefix: + r._replaceNamespaceURI(rule.namespaceURI) + + self._namespaces[rule.prefix] = rule.namespaceURI + + return 2 + + def variablesrule(expected, seq, token, tokenizer): + # parse and consume tokens in any case + rule = cssutils.css.CSSVariablesRule(parentStyleSheet=self) + rule.cssText = self._tokensupto2(tokenizer, token) + + if expected > 2: + self._log.error(u'CSSStylesheet: CSSVariablesRule not allowed ' + u'here.', token, xml.dom.HierarchyRequestErr) + return expected + elif rule.wellformed: + self.insertRule(rule) + self._updateVariables() + + return 2 + + def fontfacerule(expected, seq, token, tokenizer): + # parse and consume tokens in any case + rule = cssutils.css.CSSFontFaceRule(parentStyleSheet=self) + rule.cssText = self._tokensupto2(tokenizer, token) + if rule.wellformed: + self.insertRule(rule) + return 3 + + def mediarule(expected, seq, token, tokenizer): + # parse and consume tokens in any case + rule = cssutils.css.CSSMediaRule(parentStyleSheet=self) + rule.cssText = self._tokensupto2(tokenizer, token) + if rule.wellformed: + self.insertRule(rule) + return 3 + + def pagerule(expected, seq, token, tokenizer): + # parse and consume tokens in any case + rule = cssutils.css.CSSPageRule(parentStyleSheet=self) + rule.cssText = self._tokensupto2(tokenizer, token) + if rule.wellformed: + self.insertRule(rule) + return 3 + + def unknownrule(expected, seq, token, tokenizer): + # parse and consume tokens in any case + if token[1] in cssutils.css.MarginRule.margins: + self._log.error(u'CSSStylesheet: MarginRule out CSSPageRule.', + token, neverraise=True) + rule = cssutils.css.MarginRule(parentStyleSheet=self) + rule.cssText = self._tokensupto2(tokenizer, token) + else: + self._log.warn(u'CSSStylesheet: Unknown @rule found.', + token, neverraise=True) + rule = cssutils.css.CSSUnknownRule(parentStyleSheet=self) + rule.cssText = self._tokensupto2(tokenizer, token) + + if rule.wellformed: + self.insertRule(rule) + + # or 0 for py3 + return max(1, expected or 0) + + def ruleset(expected, seq, token, tokenizer): + # parse and consume tokens in any case + rule = cssutils.css.CSSStyleRule(parentStyleSheet=self) + rule.cssText = self._tokensupto2(tokenizer, token) + if rule.wellformed: + self.insertRule(rule) + return 3 + + # save for possible reset + oldCssRules = self.cssRules + oldNamespaces = self._namespaces + + self.cssRules = cssutils.css.CSSRuleList() + # simple during parse + self._namespaces = namespaces + self._variables = CSSVariablesDeclaration() + + # not used?! + newseq = [] + + # ['CHARSET', 'IMPORT', ('VAR', NAMESPACE'), ('PAGE', 'MEDIA', ruleset)] + wellformed, expected = self._parse(0, newseq, tokenizer, + {'S': S, + 'COMMENT': COMMENT, + 'CDO': lambda *ignored: None, + 'CDC': lambda *ignored: None, + 'CHARSET_SYM': charsetrule, + 'FONT_FACE_SYM': fontfacerule, + 'IMPORT_SYM': importrule, + 'NAMESPACE_SYM': namespacerule, + 'PAGE_SYM': pagerule, + 'MEDIA_SYM': mediarule, + 'VARIABLES_SYM': variablesrule, + 'ATKEYWORD': unknownrule + }, + default=ruleset) + + if wellformed: + # use proper namespace object + self._namespaces = _Namespaces(parentStyleSheet=self, log=self._log) + self._cleanNamespaces() + + else: + # reset + self._cssRules = oldCssRules + self._namespaces = oldNamespaces + self._updateVariables() + self._cleanNamespaces() + + cssText = property(_getCssText, _setCssText, + "Textual representation of the stylesheet (a byte string)") + + def _resolveImport(self, url): + """Read (encoding, enctype, decodedContent) from `url` for @import + sheets.""" + try: + # only available during parsing of a complete sheet + parentEncoding = self.__newEncoding + + except AttributeError: + try: + # explicit @charset + parentEncoding = self._cssRules[0].encoding + except (IndexError, AttributeError): + # default not UTF-8 but None! + parentEncoding = None + + + return _readUrl(url, fetcher=self._fetcher, + overrideEncoding=self.__encodingOverride, + parentEncoding=parentEncoding) + + def _setCssTextWithEncodingOverride(self, cssText, encodingOverride=None, + encoding=None): + """Set `cssText` but use `encodingOverride` to overwrite detected + encoding. This is used by parse and @import during setting of cssText. + + If `encoding` is given use this but do not save as `encodingOverride`. + """ + if encodingOverride: + # encoding during resolving of @import + self.__encodingOverride = encodingOverride + + if encoding: + # save for nested @import + self.__newEncoding = encoding + + self.cssText = cssText + + if encodingOverride: + # set encodingOverride explicit again! + self.encoding = self.__encodingOverride + # del? + self.__encodingOverride = None + elif encoding: + # may e.g. be httpEncoding + self.encoding = encoding + try: + del self.__newEncoding + except AttributeError, e: + pass + + def _setFetcher(self, fetcher=None): + """Set @import URL loader, if None the default is used.""" + self._fetcher = fetcher + + def _getEncoding(self): + """Encoding set in :class:`~cssutils.css.CSSCharsetRule` or if ``None`` + resulting in default ``utf-8`` encoding being used.""" + try: + return self._cssRules[0].encoding + except (IndexError, AttributeError): + return 'utf-8' + + def _setEncoding(self, encoding): + """Set `encoding` of charset rule if present in sheet or insert a new + :class:`~cssutils.css.CSSCharsetRule` with given `encoding`. + If `encoding` is None removes charsetrule if present resulting in + default encoding of utf-8. + """ + try: + rule = self._cssRules[0] + except IndexError: + rule = None + if rule and rule.CHARSET_RULE == rule.type: + if encoding: + rule.encoding = encoding + else: + self.deleteRule(0) + elif encoding: + self.insertRule(cssutils.css.CSSCharsetRule(encoding=encoding), 0) + + encoding = property(_getEncoding, _setEncoding, + "(cssutils) Reflect encoding of an @charset rule or 'utf-8' " + "(default) if set to ``None``") + + namespaces = property(lambda self: self._namespaces, + doc="All Namespaces used in this CSSStyleSheet.") + + def _updateVariables(self): + """Updates self._variables, called when @import or @variables rules + is added to sheet. + """ + for r in self.cssRules.rulesOfType(CSSRule.IMPORT_RULE): + s = r.styleSheet + if s: + for var in s.variables: + self._variables.setVariable(var, s.variables[var]) +# for r in self.cssRules.rulesOfType(CSSRule.IMPORT_RULE): +# for vr in r.styleSheet.cssRules.rulesOfType(CSSRule.VARIABLES_RULE): +# for var in vr.variables: +# self._variables.setVariable(var, vr.variables[var]) + for vr in self.cssRules.rulesOfType(CSSRule.VARIABLES_RULE): + for var in vr.variables: + self._variables.setVariable(var, vr.variables[var]) + + variables = property(lambda self: self._variables, + doc=u"A :class:`cssutils.css.CSSVariablesDeclaration` " + u"containing all available variables in this " + u"CSSStyleSheet including the ones defined in " + u"imported sheets.") + + def add(self, rule): + """Add `rule` to style sheet at appropriate position. + Same as ``insertRule(rule, inOrder=True)``. + """ + return self.insertRule(rule, index=None, inOrder=True) + + def deleteRule(self, index): + """Delete rule at `index` from the style sheet. + + :param index: + The `index` of the rule to be removed from the StyleSheet's rule + list. For an `index` < 0 **no** :exc:`~xml.dom.IndexSizeErr` is + raised but rules for normal Python lists are used. E.g. + ``deleteRule(-1)`` removes the last rule in cssRules. + + `index` may also be a CSSRule object which will then be removed + from the StyleSheet. + + :exceptions: + - :exc:`~xml.dom.IndexSizeErr`: + Raised if the specified index does not correspond to a rule in + the style sheet's rule list. + - :exc:`~xml.dom.NamespaceErr`: + Raised if removing this rule would result in an invalid StyleSheet + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this style sheet is readonly. + """ + self._checkReadonly() + + if isinstance(index, CSSRule): + for i, r in enumerate(self.cssRules): + if index == r: + index = i + break + else: + raise xml.dom.IndexSizeErr(u"CSSStyleSheet: Not a rule in" + " this sheets'a cssRules list: %s" + % index) + + try: + rule = self._cssRules[index] + except IndexError: + raise xml.dom.IndexSizeErr( + u'CSSStyleSheet: %s is not a valid index in the rulelist of ' + u'length %i' % (index, self._cssRules.length)) + else: + if rule.type == rule.NAMESPACE_RULE: + # check all namespacerules if used + uris = [r.namespaceURI for r in self + if r.type == r.NAMESPACE_RULE] + useduris = self._getUsedURIs() + if rule.namespaceURI in useduris and\ + uris.count(rule.namespaceURI) == 1: + raise xml.dom.NoModificationAllowedErr( + u'CSSStyleSheet: NamespaceURI defined in this rule is ' + u'used, cannot remove.') + return + + rule._parentStyleSheet = None # detach + del self._cssRules[index] # delete from StyleSheet + + def insertRule(self, rule, index=None, inOrder=False, _clean=True): + """ + Used to insert a new rule into the style sheet. The new rule now + becomes part of the cascade. + + :param rule: + a parsable DOMString, in cssutils also a + :class:`~cssutils.css.CSSRule` or :class:`~cssutils.css.CSSRuleList` + :param index: + of the rule before the new rule will be inserted. + If the specified `index` is equal to the length of the + StyleSheet's rule collection, the rule will be added to the end + of the style sheet. + If `index` is not given or ``None`` rule will be appended to rule + list. + :param inOrder: + if ``True`` the rule will be put to a proper location while + ignoring `index` and without raising + :exc:`~xml.dom.HierarchyRequestErr`. + The resulting index is returned nevertheless. + :returns: The index within the style sheet's rule collection + :Exceptions: + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at the specified `index` + e.g. if an @import rule is inserted after a standard rule set + or other at-rule. + - :exc:`~xml.dom.IndexSizeErr`: + Raised if the specified `index` is not a valid insertion point. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this style sheet is readonly. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified rule has a syntax error and is + unparsable. + """ + self._checkReadonly() + + # check position + if index is None: + index = len(self._cssRules) + elif index < 0 or index > self._cssRules.length: + raise xml.dom.IndexSizeErr( + u'CSSStyleSheet: Invalid index %s for CSSRuleList with a ' + u'length of %s.' % (index, self._cssRules.length)) + return + + if isinstance(rule, basestring): + # init a temp sheet which has the same properties as self + tempsheet = CSSStyleSheet(href=self.href, + media=self.media, + title=self.title, + parentStyleSheet=self.parentStyleSheet, + ownerRule=self.ownerRule) + tempsheet._ownerNode = self.ownerNode + tempsheet._fetcher = self._fetcher + # prepend encoding if in this sheet to be able to use it in + # @import rules encoding resolution + # do not add if new rule startswith "@charset" (which is exact!) + if not rule.startswith(u'@charset') and (self._cssRules and + self._cssRules[0].type == self._cssRules[0].CHARSET_RULE): + # rule 0 is @charset! + newrulescount, newruleindex = 2, 1 + rule = self._cssRules[0].cssText + rule + else: + newrulescount, newruleindex = 1, 0 + + # parse the new rule(s) + tempsheet.cssText = (rule, self._namespaces) + + if len(tempsheet.cssRules) != newrulescount or (not isinstance( + tempsheet.cssRules[newruleindex], cssutils.css.CSSRule)): + self._log.error(u'CSSStyleSheet: Not a CSSRule: %s' % rule) + return + rule = tempsheet.cssRules[newruleindex] + rule._parentStyleSheet = None # done later? + + # TODO: + #tempsheet._namespaces = self._namespaces + #variables? + + elif isinstance(rule, cssutils.css.CSSRuleList): + # insert all rules + for i, r in enumerate(rule): + self.insertRule(r, index + i) + return index + + if not rule.wellformed: + self._log.error(u'CSSStyleSheet: Invalid rules cannot be added.') + return + + # CHECK HIERARCHY + # @charset + if rule.type == rule.CHARSET_RULE: + if inOrder: + index = 0 + # always first and only + if (self._cssRules + and self._cssRules[0].type == rule.CHARSET_RULE): + self._cssRules[0].encoding = rule.encoding + else: + self._cssRules.insert(0, rule) + elif index != 0 or (self._cssRules and + self._cssRules[0].type == rule.CHARSET_RULE): + self._log.error( + u'CSSStylesheet: @charset only allowed once at the' + ' beginning of a stylesheet.', + error=xml.dom.HierarchyRequestErr) + return + else: + self._cssRules.insert(index, rule) + + # @unknown or comment + elif rule.type in (rule.UNKNOWN_RULE, rule.COMMENT) and not inOrder: + if index == 0 and self._cssRules and\ + self._cssRules[0].type == rule.CHARSET_RULE: + self._log.error( + u'CSSStylesheet: @charset must be the first rule.', + error=xml.dom.HierarchyRequestErr) + return + else: + self._cssRules.insert(index, rule) + + # @import + elif rule.type == rule.IMPORT_RULE: + if inOrder: + # automatic order + if rule.type in (r.type for r in self): + # find last of this type + for i, r in enumerate(reversed(self._cssRules)): + if r.type == rule.type: + index = len(self._cssRules) - i + break + else: + # find first point to insert + if self._cssRules and\ + self._cssRules[0].type in (rule.CHARSET_RULE, + rule.COMMENT): + index = 1 + else: + index = 0 + else: + # after @charset + if index == 0 and self._cssRules and\ + self._cssRules[0].type == rule.CHARSET_RULE: + self._log.error( + u'CSSStylesheet: Found @charset at index 0.', + error=xml.dom.HierarchyRequestErr) + return + # before @namespace @variables @page @font-face @media stylerule + for r in self._cssRules[:index]: + if r.type in (r.NAMESPACE_RULE, + r.VARIABLES_RULE, + r.MEDIA_RULE, + r.PAGE_RULE, + r.STYLE_RULE, + r.FONT_FACE_RULE): + self._log.error( + u'CSSStylesheet: Cannot insert @import here,' + ' found @namespace, @variables, @media, @page or' + ' CSSStyleRule before index %s.' % + index, + error=xml.dom.HierarchyRequestErr) + return + self._cssRules.insert(index, rule) + self._updateVariables() + + # @namespace + elif rule.type == rule.NAMESPACE_RULE: + if inOrder: + if rule.type in (r.type for r in self): + # find last of this type + for i, r in enumerate(reversed(self._cssRules)): + if r.type == rule.type: + index = len(self._cssRules) - i + break + else: + # find first point to insert + for i, r in enumerate(self._cssRules): + if r.type in (r.VARIABLES_RULE, r.MEDIA_RULE, + r.PAGE_RULE, r.STYLE_RULE, + r.FONT_FACE_RULE, r.UNKNOWN_RULE, + r.COMMENT): + index = i # before these + break + else: + # after @charset and @import + for r in self._cssRules[index:]: + if r.type in (r.CHARSET_RULE, r.IMPORT_RULE): + self._log.error( + u'CSSStylesheet: Cannot insert @namespace here,' + ' found @charset or @import after index %s.' % + index, + error=xml.dom.HierarchyRequestErr) + return + # before @variables @media @page @font-face and stylerule + for r in self._cssRules[:index]: + if r.type in (r.VARIABLES_RULE, + r.MEDIA_RULE, + r.PAGE_RULE, + r.STYLE_RULE, + r.FONT_FACE_RULE): + self._log.error( + u'CSSStylesheet: Cannot insert @namespace here,' + ' found @variables, @media, @page or CSSStyleRule' + ' before index %s.' % + index, + error=xml.dom.HierarchyRequestErr) + return + + if not (rule.prefix in self.namespaces and + self.namespaces[rule.prefix] == rule.namespaceURI): + # no doublettes + self._cssRules.insert(index, rule) + if _clean: + self._cleanNamespaces() + + + # @variables + elif rule.type == rule.VARIABLES_RULE: + if inOrder: + if rule.type in (r.type for r in self): + # find last of this type + for i, r in enumerate(reversed(self._cssRules)): + if r.type == rule.type: + index = len(self._cssRules) - i + break + else: + # find first point to insert + for i, r in enumerate(self._cssRules): + if r.type in (r.MEDIA_RULE, + r.PAGE_RULE, + r.STYLE_RULE, + r.FONT_FACE_RULE, + r.UNKNOWN_RULE, + r.COMMENT): + index = i # before these + break + else: + # after @charset @import @namespace + for r in self._cssRules[index:]: + if r.type in (r.CHARSET_RULE, + r.IMPORT_RULE, + r.NAMESPACE_RULE): + self._log.error( + u'CSSStylesheet: Cannot insert @variables here,' + ' found @charset, @import or @namespace after' + ' index %s.' % + index, + error=xml.dom.HierarchyRequestErr) + return + # before @media @page @font-face and stylerule + for r in self._cssRules[:index]: + if r.type in (r.MEDIA_RULE, + r.PAGE_RULE, + r.STYLE_RULE, + r.FONT_FACE_RULE): + self._log.error( + u'CSSStylesheet: Cannot insert @variables here,' + ' found @media, @page or CSSStyleRule' + ' before index %s.' % + index, + error=xml.dom.HierarchyRequestErr) + return + + self._cssRules.insert(index, rule) + self._updateVariables() + + # all other where order is not important + else: + if inOrder: + # simply add to end as no specific order + self._cssRules.append(rule) + index = len(self._cssRules) - 1 + else: + for r in self._cssRules[index:]: + if r.type in (r.CHARSET_RULE, + r.IMPORT_RULE, + r.NAMESPACE_RULE): + self._log.error( + u'CSSStylesheet: Cannot insert rule here, found ' + u'@charset, @import or @namespace before index %s.' + % index, error=xml.dom.HierarchyRequestErr) + return + self._cssRules.insert(index, rule) + + # post settings + rule._parentStyleSheet = self + + if rule.IMPORT_RULE == rule.type and not rule.hrefFound: + # try loading the imported sheet which has new relative href now + rule.href = rule.href + + return index + + ownerRule = property(lambda self: self._ownerRule, + doc=u'A ref to an @import rule if it is imported, ' + u'else ``None``.') + + + @Deprecated(u'Use ``cssutils.setSerializer(serializer)`` instead.') + def setSerializer(self, cssserializer): + """Set the cssutils global Serializer used for all output.""" + if isinstance(cssserializer, cssutils.CSSSerializer): + cssutils.ser = cssserializer + else: + raise ValueError(u'Serializer must be an instance of ' + u'cssutils.CSSSerializer.') + + @Deprecated(u'Set pref in ``cssutils.ser.prefs`` instead.') + def setSerializerPref(self, pref, value): + """Set a Preference of CSSSerializer used for output. + See :class:`cssutils.serialize.Preferences` for possible + preferences to be set. + """ + cssutils.ser.prefs.__setattr__(pref, value) diff --git a/libs/cssutils/css/cssunknownrule.py b/libs/cssutils/css/cssunknownrule.py new file mode 100755 index 00000000..c9e4361f --- /dev/null +++ b/libs/cssutils/css/cssunknownrule.py @@ -0,0 +1,209 @@ +"""CSSUnknownRule implements DOM Level 2 CSS CSSUnknownRule.""" +__all__ = ['CSSUnknownRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +import cssrule +import cssutils +import xml.dom + +class CSSUnknownRule(cssrule.CSSRule): + """ + Represents an at-rule not supported by this user agent, so in + effect all other at-rules not defined in cssutils. + + Format:: + + @xxx until ';' or block {...} + """ + def __init__(self, cssText=u'', parentRule=None, + parentStyleSheet=None, readonly=False): + """ + :param cssText: + of type string + """ + super(CSSUnknownRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + self._atkeyword = None + if cssText: + self.cssText = cssText + + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(cssText=%r)" % ( + self.__class__.__name__, + self.cssText) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.cssText, + id(self)) + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_CSSUnknownRule(self) + + def _setCssText(self, cssText): + """ + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + super(CSSUnknownRule, self)._setCssText(cssText) + tokenizer = self._tokenize2(cssText) + attoken = self._nexttoken(tokenizer, None) + if not attoken or self._type(attoken) != self._prods.ATKEYWORD: + self._log.error(u'CSSUnknownRule: No CSSUnknownRule found: %s' % + self._valuestr(cssText), + error=xml.dom.InvalidModificationErr) + else: + # for closures: must be a mutable + new = {'nesting': [], # {} [] or () + 'wellformed': True + } + + def CHAR(expected, seq, token, tokenizer=None): + type_, val, line, col = token + if expected != 'EOF': + if val in u'{[(': + new['nesting'].append(val) + elif val in u'}])': + opening = {u'}': u'{', u']': u'[', u')': u'('}[val] + try: + if new['nesting'][-1] == opening: + new['nesting'].pop() + else: + raise IndexError() + except IndexError: + new['wellformed'] = False + self._log.error(u'CSSUnknownRule: Wrong nesting of ' + u'{, [ or (.', token=token) + + if val in u'};' and not new['nesting']: + expected = 'EOF' + + seq.append(val, type_, line=line, col=col) + return expected + else: + new['wellformed'] = False + self._log.error(u'CSSUnknownRule: Expected end of rule.', + token=token) + return expected + + def FUNCTION(expected, seq, token, tokenizer=None): + # handled as opening ( + type_, val, line, col = token + val = self._tokenvalue(token) + if expected != 'EOF': + new['nesting'].append(u'(') + seq.append(val, type_, line=line, col=col) + return expected + else: + new['wellformed'] = False + self._log.error(u'CSSUnknownRule: Expected end of rule.', + token=token) + return expected + + def EOF(expected, seq, token, tokenizer=None): + "close all blocks and return 'EOF'" + for x in reversed(new['nesting']): + closing = {u'{': u'}', u'[': u']', u'(': u')'}[x] + seq.append(closing, closing) + new['nesting'] = [] + return 'EOF' + + def INVALID(expected, seq, token, tokenizer=None): + # makes rule invalid + self._log.error(u'CSSUnknownRule: Bad syntax.', + token=token, error=xml.dom.SyntaxErr) + new['wellformed'] = False + return expected + + def STRING(expected, seq, token, tokenizer=None): + type_, val, line, col = token + val = self._stringtokenvalue(token) + if expected != 'EOF': + seq.append(val, type_, line=line, col=col) + return expected + else: + new['wellformed'] = False + self._log.error(u'CSSUnknownRule: Expected end of rule.', + token=token) + return expected + + def URI(expected, seq, token, tokenizer=None): + type_, val, line, col = token + val = self._uritokenvalue(token) + if expected != 'EOF': + seq.append(val, type_, line=line, col=col) + return expected + else: + new['wellformed'] = False + self._log.error(u'CSSUnknownRule: Expected end of rule.', + token=token) + return expected + + def default(expected, seq, token, tokenizer=None): + type_, val, line, col = token + if expected != 'EOF': + seq.append(val, type_, line=line, col=col) + return expected + else: + new['wellformed'] = False + self._log.error(u'CSSUnknownRule: Expected end of rule.', + token=token) + return expected + + # unknown : ATKEYWORD S* ... ; | } + newseq = self._tempSeq() + wellformed, expected = self._parse(expected=None, + seq=newseq, tokenizer=tokenizer, + productions={'CHAR': CHAR, + 'EOF': EOF, + 'FUNCTION': FUNCTION, + 'INVALID': INVALID, + 'STRING': STRING, + 'URI': URI, + 'S': default # overwrite default default! + }, + default=default, + new=new) + + # wellformed set by parse + wellformed = wellformed and new['wellformed'] + + # post conditions + if expected != 'EOF': + wellformed = False + self._log.error(u'CSSUnknownRule: No ending ";" or "}" found: ' + u'%r' % self._valuestr(cssText)) + elif new['nesting']: + wellformed = False + self._log.error(u'CSSUnknownRule: Unclosed "{", "[" or "(": %r' + % self._valuestr(cssText)) + + # set all + if wellformed: + self.atkeyword = self._tokenvalue(attoken) + self._setSeq(newseq) + + cssText = property(fget=_getCssText, fset=_setCssText, + doc=u"(DOM) The parsable textual representation.") + + type = property(lambda self: self.UNKNOWN_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + wellformed = property(lambda self: bool(self.atkeyword)) + \ No newline at end of file diff --git a/libs/cssutils/css/cssvalue.py b/libs/cssutils/css/cssvalue.py new file mode 100755 index 00000000..2f643453 --- /dev/null +++ b/libs/cssutils/css/cssvalue.py @@ -0,0 +1,1251 @@ +"""CSSValue related classes + +- CSSValue implements DOM Level 2 CSS CSSValue +- CSSPrimitiveValue implements DOM Level 2 CSS CSSPrimitiveValue +- CSSValueList implements DOM Level 2 CSS CSSValueList + +""" +__all__ = ['CSSValue', 'CSSPrimitiveValue', 'CSSValueList', 'RGBColor', + 'CSSVariable'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssutils.prodparser import * +import cssutils +import cssutils.helper +import math +import re +import xml.dom + + +class CSSValue(cssutils.util._NewBase): + """The CSSValue interface represents a simple or a complex value. + A CSSValue object only occurs in a context of a CSS property. + """ + + # The value is inherited and the cssText contains "inherit". + CSS_INHERIT = 0 + # The value is a CSSPrimitiveValue. + CSS_PRIMITIVE_VALUE = 1 + # The value is a CSSValueList. + CSS_VALUE_LIST = 2 + # The value is a custom value. + CSS_CUSTOM = 3 + # The value is a CSSVariable. + CSS_VARIABLE = 4 + + _typestrings = {0: 'CSS_INHERIT' , + 1: 'CSS_PRIMITIVE_VALUE', + 2: 'CSS_VALUE_LIST', + 3: 'CSS_CUSTOM', + 4: 'CSS_VARIABLE'} + + def __init__(self, cssText=None, parent=None, readonly=False): + """ + :param cssText: + the parsable cssText of the value + :param readonly: + defaults to False + """ + super(CSSValue, self).__init__() + + self._cssValueType = None + self.wellformed = False + self.parent = parent + if cssText is not None: # may be 0 + if isinstance(cssText, int): + cssText = unicode(cssText) # if it is an integer + elif isinstance(cssText, float): + cssText = u'%f' % cssText # if it is a floating point number + + self.cssText = cssText + + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(%r)" % (self.__class__.__name__, + self.cssText) + + def __str__(self): + return u"" % (self.__class__.__name__, + self.cssValueTypeString, + self.cssText, + id(self)) + + def _setCssText(self, cssText): + """ + Format:: + + unary_operator + : '-' | '+' + ; + operator + : '/' S* | ',' S* | /* empty */ + ; + expr + : term [ operator term ]* + ; + term + : unary_operator? + [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | + ANGLE S* | TIME S* | FREQ S* ] + | STRING S* | IDENT S* | URI S* | hexcolor | function + | UNICODE-RANGE S* + ; + function + : FUNCTION S* expr ')' S* + ; + /* + * There is a constraint on the color that it must + * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F]) + * after the "#"; e.g., "#000" is OK, but "#abcd" is not. + */ + hexcolor + : HASH S* + ; + + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error + (according to the attached property) or is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + TODO: Raised if the specified CSS string value represents a + different type of values than the values allowed by the CSS + property. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this value is readonly. + """ + self._checkReadonly() + + # used as operator is , / or S + nextSor = u',/' + + term = Choice(Sequence(PreDef.unary(), + Choice(PreDef.number(nextSor=nextSor), + PreDef.percentage(nextSor=nextSor), + PreDef.dimension(nextSor=nextSor))), + PreDef.string(nextSor=nextSor), + PreDef.ident(nextSor=nextSor), + PreDef.uri(nextSor=nextSor), + PreDef.hexcolor(nextSor=nextSor), + PreDef.unicode_range(nextSor=nextSor), + # special case IE only expression + Prod(name='expression', + match=lambda t, v: t == self._prods.FUNCTION and ( + cssutils.helper.normalize(v) in (u'expression(', + u'alpha(', + u'blur(', + u'chroma(', + u'dropshadow(', + u'fliph(', + u'flipv(', + u'glow(', + u'gray(', + u'invert(', + u'mask(', + u'shadow(', + u'wave(', + u'xray(') or + v.startswith(u'progid:DXImageTransform.Microsoft.') + ), + nextSor=nextSor, + toSeq=lambda t, tokens: (ExpressionValue._functionName, + ExpressionValue( + cssutils.helper.pushtoken(t, tokens), + parent=self) + ) + ), + # CSS Variable var( + PreDef.variable(nextSor=nextSor, + toSeq=lambda t, tokens: ('CSSVariable', + CSSVariable( + cssutils.helper.pushtoken(t, tokens), + parent=self) + ) + ), + # calc( + PreDef.calc(nextSor=nextSor, + toSeq=lambda t, tokens: (CalcValue._functionName, + CalcValue( + cssutils.helper.pushtoken(t, tokens), + parent=self) + ) + ), +# TODO: +# # rgb/rgba( +# Prod(name='RGBColor', +# match=lambda t, v: t == self._prods.FUNCTION and ( +# cssutils.helper.normalize(v) in (u'rgb(', +# u'rgba(' +# ) +# ), +# nextSor=nextSor, +# toSeq=lambda t, tokens: (RGBColor._functionName, +# RGBColor( +# cssutils.helper.pushtoken(t, tokens), +# parent=self) +# ) +# ), + # other functions like rgb( etc + PreDef.function(nextSor=nextSor, + toSeq=lambda t, tokens: ('FUNCTION', + CSSFunction( + cssutils.helper.pushtoken(t, tokens), + parent=self) + ) + ) + ) + operator = Choice(PreDef.S(), + PreDef.char('comma', ',', + toSeq=lambda t, tokens: ('operator', t[1])), + PreDef.char('slash', '/', + toSeq=lambda t, tokens: ('operator', t[1])), + optional=True) + # CSSValue PRODUCTIONS + valueprods = Sequence(term, + Sequence(operator, # mayEnd this Sequence if whitespace + + # TODO: only when setting via other class + # used by variabledeclaration currently + PreDef.char('END', ';', + stopAndKeep=True, + optional=True), + + term, + minmax=lambda: (0, None))) + # parse + wellformed, seq, store, notused = ProdParser().parse(cssText, + u'CSSValue', + valueprods, + keepS=True) + if wellformed: + # - count actual values and set firstvalue which is used later on + # - combine comma separated list, e.g. font-family to a single item + # - remove S which should be an operator but is no needed + count, firstvalue = 0, () + newseq = self._tempSeq() + i, end = 0, len(seq) + while i < end: + item = seq[i] + if item.type == self._prods.S: + pass + + elif (item.value, item.type) == (u',', 'operator'): + # , separared counts as a single STRING for now + # URI or STRING value might be a single CHAR too! + newseq.appendItem(item) + count -= 1 + if firstvalue: + # list of IDENTs is handled as STRING! + if firstvalue[1] == self._prods.IDENT: + firstvalue = firstvalue[0], 'STRING' + + elif item.value == u'/': + # / separated items count as one + newseq.appendItem(item) + + elif item.value == u'-' or item.value == u'+': + # combine +- and following number or other + i += 1 + try: + next = seq[i] + except IndexError: + firstvalue = () # raised later + break + + newval = item.value + next.value + newseq.append(newval, next.type, + item.line, item.col) + if not firstvalue: + firstvalue = (newval, next.type) + count += 1 + + elif item.type != cssutils.css.CSSComment: + newseq.appendItem(item) + if not firstvalue: + firstvalue = (item.value, item.type) + count += 1 + + else: + newseq.appendItem(item) + + i += 1 + + if not firstvalue: + self._log.error( + u'CSSValue: Unknown syntax or no value: %r.' % + self._valuestr(cssText)) + else: + # ok and set + self._setSeq(newseq) + self.wellformed = wellformed + + if hasattr(self, '_value'): + # only in case of CSSPrimitiveValue, else remove! + del self._value + + if count == 1: + # inherit, primitive or variable + if isinstance(firstvalue[0], basestring) and\ + u'inherit' == cssutils.helper.normalize(firstvalue[0]): + self.__class__ = CSSValue + self._cssValueType = CSSValue.CSS_INHERIT + elif 'CSSVariable' == firstvalue[1]: + self.__class__ = CSSVariable + self._value = firstvalue + # TODO: remove major hack! + self._name = firstvalue[0]._name + else: + self.__class__ = CSSPrimitiveValue + self._value = firstvalue + + elif count > 1: + # valuelist + self.__class__ = CSSValueList + + # change items in list to specific type (primitive etc) + newseq = self._tempSeq() + commalist = [] + nexttocommalist = False + + def itemValue(item): + "Reserialized simple item.value" + if self._prods.STRING == item.type: + return cssutils.helper.string(item.value) + elif self._prods.URI == item.type: + return cssutils.helper.uri(item.value) + elif self._prods.FUNCTION == item.type or\ + 'CSSVariable' == item.type: + return item.value.cssText + else: + return item.value + + def saveifcommalist(commalist, newseq): + """ + saves items in commalist to seq and items + if anything in there + """ + if commalist: + newseq.replace(-1, + CSSPrimitiveValue(cssText=u''.join( + commalist)), + CSSPrimitiveValue, + newseq[-1].line, + newseq[-1].col) + del commalist[:] + + for i, item in enumerate(self._seq): + if issubclass(type(item.value), CSSValue): + # set parent of CSSValueList items to the lists + # parent + item.value.parent = self.parent + + if item.type in (self._prods.DIMENSION, + self._prods.FUNCTION, + self._prods.HASH, + self._prods.IDENT, + self._prods.NUMBER, + self._prods.PERCENTAGE, + self._prods.STRING, + self._prods.URI, + self._prods.UNICODE_RANGE, + 'CSSVariable'): + if nexttocommalist: + # wait until complete + commalist.append(itemValue(item)) + else: + saveifcommalist(commalist, newseq) + # append new item + if hasattr(item.value, 'cssText'): + newseq.append(item.value, + item.value.__class__, + item.line, item.col) + + else: + newseq.append(CSSPrimitiveValue( + itemValue(item)), + CSSPrimitiveValue, + item.line, item.col) + + nexttocommalist = False + + elif u',' == item.value: + if not commalist: + # save last item to commalist + commalist.append(itemValue(self._seq[i - 1])) + commalist.append(u',') + nexttocommalist = True + + else: + if nexttocommalist: + commalist.append(item.value.cssText) + else: + newseq.appendItem(item) + + saveifcommalist(commalist, newseq) + self._setSeq(newseq) + + else: + # should not happen... + self.__class__ = CSSValue + self._cssValueType = CSSValue.CSS_CUSTOM + + cssText = property(lambda self: cssutils.ser.do_css_CSSValue(self), + _setCssText, + doc="A string representation of the current value.") + + cssValueType = property(lambda self: self._cssValueType, + doc="A (readonly) code defining the type of the value.") + + cssValueTypeString = property( + lambda self: CSSValue._typestrings.get(self.cssValueType, None), + doc="(readonly) Name of cssValueType.") + + +class CSSPrimitiveValue(CSSValue): + """Represents a single CSS Value. May be used to determine the value of a + specific style property currently set in a block or to set a specific + style property explicitly within the block. Might be obtained from the + getPropertyCSSValue method of CSSStyleDeclaration. + + Conversions are allowed between absolute values (from millimeters to + centimeters, from degrees to radians, and so on) but not between + relative values. (For example, a pixel value cannot be converted to a + centimeter value.) Percentage values can't be converted since they are + relative to the parent value (or another property value). There is one + exception for color percentage values: since a color percentage value + is relative to the range 0-255, a color percentage value can be + converted to a number; (see also the RGBColor interface). + """ + # constant: type of this CSSValue class + cssValueType = CSSValue.CSS_PRIMITIVE_VALUE + + __types = cssutils.cssproductions.CSSProductions + + # An integer indicating which type of unit applies to the value. + CSS_UNKNOWN = 0 # only obtainable via cssText + CSS_NUMBER = 1 + CSS_PERCENTAGE = 2 + CSS_EMS = 3 + CSS_EXS = 4 + CSS_PX = 5 + CSS_CM = 6 + CSS_MM = 7 + CSS_IN = 8 + CSS_PT = 9 + CSS_PC = 10 + CSS_DEG = 11 + CSS_RAD = 12 + CSS_GRAD = 13 + CSS_MS = 14 + CSS_S = 15 + CSS_HZ = 16 + CSS_KHZ = 17 + CSS_DIMENSION = 18 + CSS_STRING = 19 + CSS_URI = 20 + CSS_IDENT = 21 + CSS_ATTR = 22 + CSS_COUNTER = 23 + CSS_RECT = 24 + CSS_RGBCOLOR = 25 + # NOT OFFICIAL: + CSS_RGBACOLOR = 26 + CSS_UNICODE_RANGE = 27 + + _floattypes = (CSS_NUMBER, CSS_PERCENTAGE, CSS_EMS, CSS_EXS, + CSS_PX, CSS_CM, CSS_MM, CSS_IN, CSS_PT, CSS_PC, + CSS_DEG, CSS_RAD, CSS_GRAD, CSS_MS, CSS_S, + CSS_HZ, CSS_KHZ, CSS_DIMENSION) + _stringtypes = (CSS_ATTR, CSS_IDENT, CSS_STRING, CSS_URI) + _countertypes = (CSS_COUNTER,) + _recttypes = (CSS_RECT,) + _rbgtypes = (CSS_RGBCOLOR, CSS_RGBACOLOR) + _lengthtypes = (CSS_NUMBER, CSS_EMS, CSS_EXS, + CSS_PX, CSS_CM, CSS_MM, CSS_IN, CSS_PT, CSS_PC) + + # oldtype: newType: converterfunc + _converter = { + # cm <-> mm <-> in, 1 inch is equal to 2.54 centimeters. + # pt <-> pc, the points used by CSS 2.1 are equal to 1/72nd of an inch. + # pc: picas - 1 pica is equal to 12 points + (CSS_CM, CSS_MM): lambda x: x * 10, + (CSS_MM, CSS_CM): lambda x: x / 10, + + (CSS_PT, CSS_PC): lambda x: x * 12, + (CSS_PC, CSS_PT): lambda x: x / 12, + + (CSS_CM, CSS_IN): lambda x: x / 2.54, + (CSS_IN, CSS_CM): lambda x: x * 2.54, + (CSS_MM, CSS_IN): lambda x: x / 25.4, + (CSS_IN, CSS_MM): lambda x: x * 25.4, + + (CSS_IN, CSS_PT): lambda x: x / 72, + (CSS_PT, CSS_IN): lambda x: x * 72, + (CSS_CM, CSS_PT): lambda x: x / 2.54 / 72, + (CSS_PT, CSS_CM): lambda x: x * 72 * 2.54, + (CSS_MM, CSS_PT): lambda x: x / 25.4 / 72, + (CSS_PT, CSS_MM): lambda x: x * 72 * 25.4, + + (CSS_IN, CSS_PC): lambda x: x / 72 / 12, + (CSS_PC, CSS_IN): lambda x: x * 12 * 72, + (CSS_CM, CSS_PC): lambda x: x / 2.54 / 72 / 12, + (CSS_PC, CSS_CM): lambda x: x * 12 * 72 * 2.54, + (CSS_MM, CSS_PC): lambda x: x / 25.4 / 72 / 12, + (CSS_PC, CSS_MM): lambda x: x * 12 * 72 * 25.4, + + # hz <-> khz + (CSS_KHZ, CSS_HZ): lambda x: x * 1000, + (CSS_HZ, CSS_KHZ): lambda x: x / 1000, + # s <-> ms + (CSS_S, CSS_MS): lambda x: x * 1000, + (CSS_MS, CSS_S): lambda x: x / 1000, + + (CSS_RAD, CSS_DEG): lambda x: math.degrees(x), + (CSS_DEG, CSS_RAD): lambda x: math.radians(x), + # TODO: convert grad <-> deg or rad + #(CSS_RAD, CSS_GRAD): lambda x: math.degrees(x), + #(CSS_DEG, CSS_GRAD): lambda x: math.radians(x), + #(CSS_GRAD, CSS_RAD): lambda x: math.radians(x), + #(CSS_GRAD, CSS_DEG): lambda x: math.radians(x) + } + + def __init__(self, cssText=None, parent=None, readonly=False): + """See CSSPrimitiveValue.__init__()""" + super(CSSPrimitiveValue, self).__init__(cssText=cssText, + parent=parent, + readonly=readonly) + + def __str__(self): + return u""\ + % (self.__class__.__name__, + self.primitiveTypeString, + self.cssText, + id(self)) + + _unitnames = ['CSS_UNKNOWN', + 'CSS_NUMBER', 'CSS_PERCENTAGE', + 'CSS_EMS', 'CSS_EXS', + 'CSS_PX', + 'CSS_CM', 'CSS_MM', + 'CSS_IN', + 'CSS_PT', 'CSS_PC', + 'CSS_DEG', 'CSS_RAD', 'CSS_GRAD', + 'CSS_MS', 'CSS_S', + 'CSS_HZ', 'CSS_KHZ', + 'CSS_DIMENSION', + 'CSS_STRING', 'CSS_URI', 'CSS_IDENT', + 'CSS_ATTR', 'CSS_COUNTER', 'CSS_RECT', + 'CSS_RGBCOLOR', 'CSS_RGBACOLOR', + 'CSS_UNICODE_RANGE' + ] + + _reNumDim = re.compile(ur'([+-]?\d*\.\d+|[+-]?\d+)(.*)$', re.I | re.U | re.X) + + def _unitDIMENSION(value): + """Check val for dimension name.""" + units = {'em': 'CSS_EMS', 'ex': 'CSS_EXS', + 'px': 'CSS_PX', + 'cm': 'CSS_CM', 'mm': 'CSS_MM', + 'in': 'CSS_IN', + 'pt': 'CSS_PT', 'pc': 'CSS_PC', + 'deg': 'CSS_DEG', 'rad': 'CSS_RAD', 'grad': 'CSS_GRAD', + 'ms': 'CSS_MS', 's': 'CSS_S', + 'hz': 'CSS_HZ', 'khz': 'CSS_KHZ' + } + val, dim = CSSPrimitiveValue._reNumDim.findall(cssutils.helper.normalize(value))[0] + return units.get(dim, 'CSS_DIMENSION') + + def _unitFUNCTION(value): + """Check val for function name.""" + units = {'attr(': 'CSS_ATTR', + 'counter(': 'CSS_COUNTER', + 'rect(': 'CSS_RECT', + 'rgb(': 'CSS_RGBCOLOR', + 'rgba(': 'CSS_RGBACOLOR', + } + return units.get(re.findall(ur'^(.*?\()', + cssutils.helper.normalize(value.cssText), + re.U)[0], + 'CSS_UNKNOWN') + + __unitbytype = { + __types.NUMBER: 'CSS_NUMBER', + __types.PERCENTAGE: 'CSS_PERCENTAGE', + __types.STRING: 'CSS_STRING', + __types.UNICODE_RANGE: 'CSS_UNICODE_RANGE', + __types.URI: 'CSS_URI', + __types.IDENT: 'CSS_IDENT', + __types.HASH: 'CSS_RGBCOLOR', + __types.DIMENSION: _unitDIMENSION, + __types.FUNCTION: _unitFUNCTION + } + + def __set_primitiveType(self): + """primitiveType is readonly but is set lazy if accessed""" + # TODO: check unary and font-family STRING a, b, "c" + val, type_ = self._value + # try get by type_ + pt = self.__unitbytype.get(type_, 'CSS_UNKNOWN') + if callable(pt): + # multiple options, check value too + pt = pt(val) + self._primitiveType = getattr(self, pt) + + def _getPrimitiveType(self): + if not hasattr(self, '_primitivetype'): + self.__set_primitiveType() + return self._primitiveType + + primitiveType = property(_getPrimitiveType, + doc="(readonly) The type of the value as defined " + "by the constants in this class.") + + def _getPrimitiveTypeString(self): + return self._unitnames[self.primitiveType] + + primitiveTypeString = property(_getPrimitiveTypeString, + doc="Name of primitive type of this value.") + + def _getCSSPrimitiveTypeString(self, type): + "get TypeString by given type which may be unknown, used by setters" + try: + return self._unitnames[type] + except (IndexError, TypeError): + return u'%r (UNKNOWN TYPE)' % type + + def _getNumDim(self, value=None): + "Split self._value in numerical and dimension part." + if value is None: + value = cssutils.helper.normalize(self._value[0]) + + try: + val, dim = CSSPrimitiveValue._reNumDim.findall(value)[0] + except IndexError: + val, dim = value, u'' + try: + val = float(val) + if val == int(val): + val = int(val) + except ValueError: + raise xml.dom.InvalidAccessErr( + u'CSSPrimitiveValue: No float value %r' % self._value[0]) + + return val, dim + + def getFloatValue(self, unitType=None): + """(DOM) This method is used to get a float value in a + specified unit. If this CSS value doesn't contain a float value + or can't be converted into the specified unit, a DOMException + is raised. + + :param unitType: + to get the float value. The unit code can only be a float unit type + (i.e. CSS_NUMBER, CSS_PERCENTAGE, CSS_EMS, CSS_EXS, CSS_PX, CSS_CM, + CSS_MM, CSS_IN, CSS_PT, CSS_PC, CSS_DEG, CSS_RAD, CSS_GRAD, CSS_MS, + CSS_S, CSS_HZ, CSS_KHZ, CSS_DIMENSION) or None in which case + the current dimension is used. + + :returns: + not necessarily a float but some cases just an integer + e.g. if the value is ``1px`` it return ``1`` and **not** ``1.0`` + + Conversions might return strange values like 1.000000000001 + """ + if unitType is not None and unitType not in self._floattypes: + raise xml.dom.InvalidAccessErr( + u'unitType Parameter is not a float type') + + val, dim = self._getNumDim() + + if unitType is not None and self.primitiveType != unitType: + # convert if needed + try: + val = self._converter[self.primitiveType, unitType](val) + except KeyError: + raise xml.dom.InvalidAccessErr( + u'CSSPrimitiveValue: Cannot coerce primitiveType %r to %r' + % (self.primitiveTypeString, + self._getCSSPrimitiveTypeString(unitType))) + + if val == int(val): + val = int(val) + + return val + + def setFloatValue(self, unitType, floatValue): + """(DOM) A method to set the float value with a specified unit. + If the property attached with this value can not accept the + specified unit or the float value, the value will be unchanged and + a DOMException will be raised. + + :param unitType: + a unit code as defined above. The unit code can only be a float + unit type + :param floatValue: + the new float value which does not have to be a float value but + may simple be an int e.g. if setting:: + + setFloatValue(CSS_PX, 1) + + :exceptions: + - :exc:`~xml.dom.InvalidAccessErr`: + Raised if the attached property doesn't + support the float value or the unit type. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this property is readonly. + """ + self._checkReadonly() + if unitType not in self._floattypes: + raise xml.dom.InvalidAccessErr( + u'CSSPrimitiveValue: unitType %r is not a float type' % + self._getCSSPrimitiveTypeString(unitType)) + try: + val = float(floatValue) + except ValueError, e: + raise xml.dom.InvalidAccessErr( + u'CSSPrimitiveValue: floatValue %r is not a float' % + floatValue) + + oldval, dim = self._getNumDim() + if self.primitiveType != unitType: + # convert if possible + try: + val = self._converter[unitType, self.primitiveType](val) + except KeyError: + raise xml.dom.InvalidAccessErr( + u'CSSPrimitiveValue: Cannot coerce primitiveType %r to %r' + % (self.primitiveTypeString, + self._getCSSPrimitiveTypeString(unitType))) + + if val == int(val): + val = int(val) + + self.cssText = '%s%s' % (val, dim) + + def getStringValue(self): + """(DOM) This method is used to get the string value. If the + CSS value doesn't contain a string value, a DOMException is raised. + + Some properties (like 'font-family' or 'voice-family') + convert a whitespace separated list of idents to a string. + + Only the actual value is returned so e.g. all the following return the + actual value ``a``: url(a), attr(a), "a", 'a' + """ + if self.primitiveType not in self._stringtypes: + raise xml.dom.InvalidAccessErr( + u'CSSPrimitiveValue %r is not a string type' + % self.primitiveTypeString) + + if CSSPrimitiveValue.CSS_ATTR == self.primitiveType: + return self._value[0].cssText[5:-1] + else: + return self._value[0] + + def setStringValue(self, stringType, stringValue): + """(DOM) A method to set the string value with the specified + unit. If the property attached to this value can't accept the + specified unit or the string value, the value will be unchanged and + a DOMException will be raised. + + :param stringType: + a string code as defined above. The string code can only be a + string unit type (i.e. CSS_STRING, CSS_URI, CSS_IDENT, and + CSS_ATTR). + :param stringValue: + the new string value + Only the actual value is expected so for (CSS_URI, "a") the + new value will be ``url(a)``. For (CSS_STRING, "'a'") + the new value will be ``"\\'a\\'"`` as the surrounding ``'`` are + not part of the string value + + :exceptions: + - :exc:`~xml.dom.InvalidAccessErr`: + Raised if the CSS value doesn't contain a + string value or if the string value can't be converted into + the specified unit. + + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this property is readonly. + """ + self._checkReadonly() + # self not stringType + if self.primitiveType not in self._stringtypes: + raise xml.dom.InvalidAccessErr( + u'CSSPrimitiveValue %r is not a string type' + % self.primitiveTypeString) + # given stringType is no StringType + if stringType not in self._stringtypes: + raise xml.dom.InvalidAccessErr( + u'CSSPrimitiveValue: stringType %s is not a string type' + % self._getCSSPrimitiveTypeString(stringType)) + + if self._primitiveType != stringType: + raise xml.dom.InvalidAccessErr( + u'CSSPrimitiveValue: Cannot coerce primitiveType %r to %r' + % (self.primitiveTypeString, + self._getCSSPrimitiveTypeString(stringType))) + + if CSSPrimitiveValue.CSS_STRING == self._primitiveType: + self.cssText = cssutils.helper.string(stringValue) + elif CSSPrimitiveValue.CSS_URI == self._primitiveType: + self.cssText = cssutils.helper.uri(stringValue) + elif CSSPrimitiveValue.CSS_ATTR == self._primitiveType: + self.cssText = u'attr(%s)' % stringValue + else: + self.cssText = stringValue + self._primitiveType = stringType + + def getCounterValue(self): + """(DOM) This method is used to get the Counter value. If + this CSS value doesn't contain a counter value, a DOMException + is raised. Modification to the corresponding style property + can be achieved using the Counter interface. + + **Not implemented.** + """ + if not self.CSS_COUNTER == self.primitiveType: + raise xml.dom.InvalidAccessErr(u'Value is not a counter type') + # TODO: use Counter class + raise NotImplementedError() + + def getRGBColorValue(self): + """(DOM) This method is used to get the RGB color. If this + CSS value doesn't contain a RGB color value, a DOMException + is raised. Modification to the corresponding style property + can be achieved using the RGBColor interface. + """ + if self.primitiveType not in self._rbgtypes: + raise xml.dom.InvalidAccessErr(u'Value is not a RGBColor value') + return RGBColor(self._value[0]) + + def getRectValue(self): + """(DOM) This method is used to get the Rect value. If this CSS + value doesn't contain a rect value, a DOMException is raised. + Modification to the corresponding style property can be achieved + using the Rect interface. + + **Not implemented.** + """ + if self.primitiveType not in self._recttypes: + raise xml.dom.InvalidAccessErr(u'value is not a Rect value') + # TODO: use Rect class + raise NotImplementedError() + + def _getCssText(self): + """Overwrites CSSValue.""" + return cssutils.ser.do_css_CSSPrimitiveValue(self) + + def _setCssText(self, cssText): + """Use CSSValue.""" + return super(CSSPrimitiveValue, self)._setCssText(cssText) + + cssText = property(_getCssText, _setCssText, + doc="A string representation of the current value.") + + +class CSSValueList(CSSValue): + """The CSSValueList interface provides the abstraction of an ordered + collection of CSS values. + + Some properties allow an empty list into their syntax. In that case, + these properties take the none identifier. So, an empty list means + that the property has the value none. + + The items in the CSSValueList are accessible via an integral index, + starting from 0. + """ + cssValueType = CSSValue.CSS_VALUE_LIST + + def __init__(self, cssText=None, parent=None, readonly=False): + """Init a new CSSValueList""" + super(CSSValueList, self).__init__(cssText=cssText, + parent=parent, + readonly=readonly) + self._items = [] + + def __iter__(self): + "CSSValueList is iterable." + for item in self.__items(): + yield item.value + + def __str__(self): + return u"" % (self.__class__.__name__, + self.cssValueTypeString, + self.cssText, + self.length, + id(self)) + + def __items(self): + return [item for item in self._seq + if isinstance(item.value, CSSValue)] + + def item(self, index): + """(DOM) Retrieve a CSSValue by ordinal `index`. The + order in this collection represents the order of the values in the + CSS style property. If `index` is greater than or equal to the number + of values in the list, this returns ``None``. + """ + try: + return self.__items()[index].value + except IndexError: + return None + + length = property(lambda self: len(self.__items()), + doc=u"(DOM attribute) The number of CSSValues in the " + u"list.") + + +class CSSFunction(CSSPrimitiveValue): + """A CSS function value like rect() etc.""" + _functionName = u'CSSFunction' + primitiveType = CSSPrimitiveValue.CSS_UNKNOWN + + def __init__(self, cssText=None, parent=None, readonly=False): + """ + Init a new CSSFunction + + :param cssText: + the parsable cssText of the value + :param readonly: + defaults to False + """ + super(CSSFunction, self).__init__(parent=parent) + self._funcType = None + self.valid = False + self.wellformed = False + if cssText is not None: + self.cssText = cssText + self._readonly = readonly + + def _productiondefinition(self): + """Return definition used for parsing.""" + types = self._prods # rename! + + value = Sequence(PreDef.unary(), + Prod(name='PrimitiveValue', + match=lambda t, v: t in (types.DIMENSION, + types.HASH, + types.IDENT, + types.NUMBER, + types.PERCENTAGE, + types.STRING), + toSeq=lambda t, tokens: (t[0], + CSSPrimitiveValue(t[1])) + ) + ) + valueOrFunc = Choice(value, + # FUNC is actually not in spec but used in e.g. Prince + PreDef.function(toSeq=lambda t, + tokens: ('FUNCTION', + CSSFunction( + cssutils.helper.pushtoken(t, tokens)) + ) + ) + ) + funcProds = Sequence(Prod(name='FUNC', + match=lambda t, v: t == types.FUNCTION, + toSeq=lambda t, tokens: (t[0], cssutils.helper.normalize(t[1]))), + Choice(Sequence(valueOrFunc, + # more values starting with Comma + # should use store where colorType is saved to + # define min and may, closure? + Sequence(PreDef.comma(), + valueOrFunc, + minmax=lambda: (0, None)), + PreDef.funcEnd(stop=True)), + PreDef.funcEnd(stop=True)) + ) + return funcProds + + def _setCssText(self, cssText): + self._checkReadonly() + # store: colorType, parts + wellformed, seq, store, unusedtokens = ProdParser().parse(cssText, + self._functionName, + self._productiondefinition(), + keepS=True) + if wellformed: + # combine +/- and following CSSPrimitiveValue, remove S + newseq = self._tempSeq() + i, end = 0, len(seq) + while i < end: + item = seq[i] + if item.type == self._prods.S: + pass + elif item.value == u'+' or item.value == u'-': + i += 1 + next = seq[i] + newval = next.value + if isinstance(newval, CSSPrimitiveValue): + newval.setFloatValue(newval.primitiveType, + float(item.value + str(newval.getFloatValue()))) + newseq.append(newval, next.type, + item.line, item.col) + else: + # expressions only? + newseq.appendItem(item) + newseq.appendItem(next) + else: + newseq.appendItem(item) + + i += 1 + + self.wellformed = True + self._setSeq(newseq) + self._funcType = newseq[0].value + + cssText = property(lambda self: cssutils.ser.do_css_FunctionValue(self), + _setCssText) + + funcType = property(lambda self: self._funcType) + + +class RGBColor(CSSFunction): + """A CSS color like RGB, RGBA or a simple value like `#000` or `red`.""" + + _functionName = u'Function rgb()' + + def __init__(self, cssText=None, parent=None, readonly=False): + """ + Init a new RGBColor + + :param cssText: + the parsable cssText of the value + :param readonly: + defaults to False + """ + super(CSSFunction, self).__init__(parent=parent) + self._colorType = None + self.valid = False + self.wellformed = False + if cssText is not None: + try: + # if it is a Function object + cssText = cssText.cssText + except AttributeError: + pass + self.cssText = cssText + + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(%r)" % (self.__class__.__name__, + self.cssText) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.colorType, + self.cssText, + id(self)) + + def _setCssText(self, cssText): + self._checkReadonly() + types = self._prods # rename! + valueProd = Prod(name='value', + match=lambda t, v: t in (types.NUMBER, types.PERCENTAGE), + toSeq=lambda t, v: (CSSPrimitiveValue, CSSPrimitiveValue(v)), + toStore='parts' + ) + # COLOR PRODUCTION + funccolor = Sequence(Prod(name='FUNC', + match=lambda t, v: t == types.FUNCTION and cssutils.helper.normalize(v) in ('rgb(', 'rgba(', 'hsl(', 'hsla('), + toSeq=lambda t, v: (t, v),#cssutils.helper.normalize(v)), + toStore='colorType'), + PreDef.unary(), + valueProd, + # 2 or 3 more values starting with Comma + Sequence(PreDef.comma(), + PreDef.unary(), + valueProd, + minmax=lambda: (2, 3)), + PreDef.funcEnd() + ) + colorprods = Choice(funccolor, + PreDef.hexcolor('colorType'), + Prod(name='named color', + match=lambda t, v: t == types.IDENT, + toStore='colorType' + ) + ) + # store: colorType, parts + wellformed, seq, store, unusedtokens = ProdParser().parse(cssText, + u'RGBColor', + colorprods, + keepS=True, + store={'parts': []}) + + if wellformed: + self.wellformed = True + if store['colorType'].type == self._prods.HASH: + self._colorType = 'HEX' + elif store['colorType'].type == self._prods.IDENT: + self._colorType = 'Named Color' + else: + self._colorType = store['colorType'].value[:-1] + #self._colorType = cssutils.helper.normalize(store['colorType'].value)[:-1] + + self._setSeq(seq) + + cssText = property(lambda self: cssutils.ser.do_css_RGBColor(self), + _setCssText) + + colorType = property(lambda self: self._colorType) + + +class CalcValue(CSSFunction): + """Calc Function""" + _functionName = u'Function calc()' + + def _productiondefinition(self): + """Return defintion used for parsing.""" + types = self._prods # rename! + + def toSeq(t, tokens): + "Do not normalize function name!" + return t[0], t[1] + + funcProds = Sequence(Prod(name='calc', + match=lambda t, v: t == types.FUNCTION, + toSeq=toSeq + ), + Sequence(Choice(Prod(name='nested function', + match=lambda t, v: t == self._prods.FUNCTION, + toSeq=lambda t, tokens: (CSSFunction._functionName, + CSSFunction(cssutils.helper.pushtoken(t, + tokens))) + ), + Prod(name='part', + match=lambda t, v: v != u')', + toSeq=lambda t, tokens: (t[0], t[1])), + ), + minmax=lambda: (0, None)), + PreDef.funcEnd(stop=True)) + return funcProds + + def _getCssText(self): + return cssutils.ser.do_css_CalcValue(self) + + def _setCssText(self, cssText): + return super(CalcValue, self)._setCssText(cssText) + + cssText = property(_getCssText, _setCssText, + doc=u"A string representation of the current value.") + + +class ExpressionValue(CSSFunction): + """Special IE only CSSFunction which may contain *anything*. + Used for expressions and ``alpha(opacity=100)`` currently.""" + _functionName = u'Expression (IE only)' + + def _productiondefinition(self): + """Return defintion used for parsing.""" + types = self._prods # rename! + + def toSeq(t, tokens): + "Do not normalize function name!" + return t[0], t[1] + + funcProds = Sequence(Prod(name='expression', + match=lambda t, v: t == types.FUNCTION, + toSeq=toSeq + ), + Sequence(Choice(Prod(name='nested function', + match=lambda t, v: t == self._prods.FUNCTION, + toSeq=lambda t, tokens: (ExpressionValue._functionName, + ExpressionValue(cssutils.helper.pushtoken(t, + tokens))) + ), + Prod(name='part', + match=lambda t, v: v != u')', + toSeq=lambda t, tokens: (t[0], t[1])), + ), + minmax=lambda: (0, None)), + PreDef.funcEnd(stop=True)) + return funcProds + + def _getCssText(self): + return cssutils.ser.do_css_ExpressionValue(self) + + def _setCssText(self, cssText): + #self._log.warn(u'CSSValue: Unoffial and probably invalid MS value used!') + return super(ExpressionValue, self)._setCssText(cssText) + + cssText = property(_getCssText, _setCssText, + doc=u"A string representation of the current value.") + + +class CSSVariable(CSSValue): + """The CSSVariable represents a call to CSS Variable.""" + + def __init__(self, cssText=None, parent=None, readonly=False): + """Init a new CSSVariable. + + :param cssText: + the parsable cssText of the value, e.g. ``var(x)`` + :param readonly: + defaults to False + """ + self._name = None + super(CSSVariable, self).__init__(cssText=cssText, + parent=parent, + readonly=readonly) + + def __repr__(self): + return u"cssutils.css.%s(%r)" % (self.__class__.__name__, self.cssText) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.name, + self.value, + id(self)) + + def _setCssText(self, cssText): + self._checkReadonly() + + types = self._prods # rename! + + funcProds = Sequence(Prod(name='var', + match=lambda t, v: t == types.FUNCTION + ), + PreDef.ident(toStore='ident'), + PreDef.funcEnd(stop=True)) + + # store: name of variable + store = {'ident': None} + wellformed, seq, store, unusedtokens = ProdParser().parse(cssText, + u'CSSVariable', + funcProds, + keepS=True) + if wellformed: + self._name = store['ident'].value + self._setSeq(seq) + self.wellformed = True + + cssText = property(lambda self: cssutils.ser.do_css_CSSVariable(self), + _setCssText, + doc=u"A string representation of the current variable.") + + cssValueType = CSSValue.CSS_VARIABLE + + # TODO: writable? check if var (value) available? + name = property(lambda self: self._name) + + def _getValue(self): + "Find contained sheet and @variables there" + try: + variables = self.parent.parent.parentRule.parentStyleSheet.variables + except AttributeError: + return None + else: + try: + return variables[self.name] + except KeyError: + return None + + value = property(_getValue) diff --git a/libs/cssutils/css/cssvariablesdeclaration.py b/libs/cssutils/css/cssvariablesdeclaration.py new file mode 100755 index 00000000..2b33f670 --- /dev/null +++ b/libs/cssutils/css/cssvariablesdeclaration.py @@ -0,0 +1,330 @@ +"""CSSVariablesDeclaration +http://disruptive-innovations.com/zoo/cssvariables/#mozTocId496530 +""" +__all__ = ['CSSVariablesDeclaration'] +__docformat__ = 'restructuredtext' +__version__ = '$Id: cssstyledeclaration.py 1819 2009-08-01 20:52:43Z cthedot $' + +from cssutils.prodparser import * +from cssutils.helper import normalize +from value import PropertyValue +import cssutils +import itertools +import xml.dom + +class CSSVariablesDeclaration(cssutils.util._NewBase): + """The CSSVariablesDeclaration interface represents a single block of + variable declarations. + """ + def __init__(self, cssText=u'', parentRule=None, readonly=False): + """ + :param cssText: + Shortcut, sets CSSVariablesDeclaration.cssText + :param parentRule: + The CSS rule that contains this declaration block or + None if this CSSVariablesDeclaration is not attached to a CSSRule. + :param readonly: + defaults to False + + Format:: + + variableset + : vardeclaration [ ';' S* vardeclaration ]* S* + ; + + vardeclaration + : varname ':' S* term + ; + + varname + : IDENT S* + ; + """ + super(CSSVariablesDeclaration, self).__init__() + self._parentRule = parentRule + self._vars = {} + if cssText: + self.cssText = cssText + + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(cssText=%r)" % (self.__class__.__name__, + self.cssText) + + def __str__(self): + return u"" % ( + self.__class__.__name__, + self.length, + id(self)) + + def __contains__(self, variableName): + """Check if a variable is in variable declaration block. + + :param variableName: + a string + """ + return normalize(variableName) in self.keys() + + def __getitem__(self, variableName): + """Retrieve the value of variable ``variableName`` from this + declaration. + """ + return self.getVariableValue(variableName) + + def __setitem__(self, variableName, value): + self.setVariable(variableName, value) + + def __delitem__(self, variableName): + return self.removeVariable(variableName) + + def __iter__(self): + """Iterator of names of set variables.""" + for name in self.keys(): + yield name + + def keys(self): + """Analoguous to standard dict returns variable names which are set in + this declaration.""" + return self._vars.keys() + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_css_CSSVariablesDeclaration(self) + + def _setCssText(self, cssText): + """Setting this attribute will result in the parsing of the new value + and resetting of all the properties in the declaration block + including the removal or addition of properties. + + :exceptions: + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this declaration is readonly or a property is readonly. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + + Format:: + + variableset + : vardeclaration [ ';' S* vardeclaration ]* + ; + + vardeclaration + : varname ':' S* term + ; + + varname + : IDENT S* + ; + + expr + : [ VARCALL | term ] [ operator [ VARCALL | term ] ]* + ; + + """ + self._checkReadonly() + + vardeclaration = Sequence( + PreDef.ident(), + PreDef.char(u':', u':', toSeq=False), + #PreDef.S(toSeq=False, optional=True), + Prod(name=u'term', match=lambda t, v: True, + toSeq=lambda t, tokens: (u'value', + PropertyValue(itertools.chain([t], + tokens), + parent=self) + ) + ) + ) + prods = Sequence(vardeclaration, + Sequence(PreDef.S(optional=True), + PreDef.char(u';', u';', toSeq=False), + PreDef.S(optional=True), + vardeclaration, + minmax=lambda: (0, None)), + PreDef.S(optional=True), + PreDef.char(u';', u';', toSeq=False, optional=True) + ) + # parse + wellformed, seq, store, notused = \ + ProdParser().parse(cssText, + u'CSSVariableDeclaration', + prods) + if wellformed: + newseq = self._tempSeq() + newvars = {} + + # seq contains only name: value pairs plus comments etc + nameitem = None + for item in seq: + if u'IDENT' == item.type: + nameitem = item + elif u'value' == item.type: + nname = normalize(nameitem.value) + if nname in newvars: + # replace var with same name + for i, it in enumerate(newseq): + if normalize(it.value[0]) == nname: + newseq.replace(i, + (nameitem.value, item.value), + 'var', + nameitem.line, nameitem.col) + else: + # saved non normalized name for reserialization + newseq.append((nameitem.value, item.value), + 'var', + nameitem.line, nameitem.col) + +# newseq.append((nameitem.value, item.value), +# 'var', +# nameitem.line, nameitem.col) + + newvars[nname] = item.value + + else: + newseq.appendItem(item) + + self._setSeq(newseq) + self._vars = newvars + self.wellformed = True + + cssText = property(_getCssText, _setCssText, + doc=u"(DOM) A parsable textual representation of the declaration " + u"block excluding the surrounding curly braces.") + + def _setParentRule(self, parentRule): + self._parentRule = parentRule + + parentRule = property(lambda self: self._parentRule, _setParentRule, + doc=u"(DOM) The CSS rule that contains this" + u" declaration block or None if this block" + u" is not attached to a CSSRule.") + + def getVariableValue(self, variableName): + """Used to retrieve the value of a variable if it has been explicitly + set within this variable declaration block. + + :param variableName: + The name of the variable. + :returns: + the value of the variable if it has been explicitly set in this + variable declaration block. Returns the empty string if the + variable has not been set. + """ + try: + return self._vars[normalize(variableName)].cssText + except KeyError, e: + return u'' + + def removeVariable(self, variableName): + """Used to remove a variable if it has been explicitly set within this + variable declaration block. + + :param variableName: + The name of the variable. + :returns: + the value of the variable if it has been explicitly set for this + variable declaration block. Returns the empty string if the + variable has not been set. + + :exceptions: + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this declaration is readonly is readonly. + """ + normalname = variableName + try: + r = self._vars[normalname] + except KeyError, e: + return u'' + else: + self.seq._readonly = False + if normalname in self._vars: + for i, x in enumerate(self.seq): + if x.value[0] == variableName: + del self.seq[i] + self.seq._readonly = True + del self._vars[normalname] + + return r.cssText + + def setVariable(self, variableName, value): + """Used to set a variable value within this variable declaration block. + + :param variableName: + The name of the CSS variable. + :param value: + The new value of the variable, may also be a PropertyValue object. + + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified value has a syntax error and is + unparsable. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this declaration is readonly or the property is + readonly. + """ + self._checkReadonly() + + # check name + wellformed, seq, store, unused = \ + ProdParser().parse(normalize(variableName), + u'variableName', + Sequence(PreDef.ident())) + if not wellformed: + self._log.error(u'Invalid variableName: %r: %r' + % (variableName, value)) + else: + # check value + if isinstance(value, PropertyValue): + v = value + else: + v = PropertyValue(cssText=value, parent=self) + + if not v.wellformed: + self._log.error(u'Invalid variable value: %r: %r' + % (variableName, value)) + else: + # update seq + self.seq._readonly = False + + variableName = normalize(variableName) + + if variableName in self._vars: + for i, x in enumerate(self.seq): + if x.value[0] == variableName: + self.seq.replace(i, + [variableName, v], + x.type, + x.line, + x.col) + break + else: + self.seq.append([variableName, v], 'var') + self.seq._readonly = True + self._vars[variableName] = v + + def item(self, index): + """Used to retrieve the variables that have been explicitly set in + this variable declaration block. The order of the variables + retrieved using this method does not have to be the order in which + they were set. This method can be used to iterate over all variables + in this variable declaration block. + + :param index: + of the variable name to retrieve, negative values behave like + negative indexes on Python lists, so -1 is the last element + + :returns: + The name of the variable at this ordinal position. The empty + string if no variable exists at this position. + """ + try: + return self.keys()[index] + except IndexError: + return u'' + + length = property(lambda self: len(self._vars), + doc=u"The number of variables that have been explicitly set in this" + u" variable declaration block. The range of valid indices is 0" + u" to length-1 inclusive.") diff --git a/libs/cssutils/css/cssvariablesrule.py b/libs/cssutils/css/cssvariablesrule.py new file mode 100755 index 00000000..ce5335bf --- /dev/null +++ b/libs/cssutils/css/cssvariablesrule.py @@ -0,0 +1,198 @@ +"""CSSVariables implements (and only partly) experimental +`CSS Variables `_ +""" +__all__ = ['CSSVariablesRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id: cssfontfacerule.py 1818 2009-07-30 21:39:00Z cthedot $' + +from cssvariablesdeclaration import CSSVariablesDeclaration +import cssrule +import cssutils +import xml.dom + +class CSSVariablesRule(cssrule.CSSRule): + """ + The CSSVariablesRule interface represents a @variables rule within a CSS + style sheet. The @variables rule is used to specify variables. + + cssutils uses a :class:`~cssutils.css.CSSVariablesDeclaration` to + represent the variables. + + Format:: + + variables + VARIABLES_SYM S* medium [ COMMA S* medium ]* LBRACE S* + variableset* '}' S* + ; + + for variableset see :class:`cssutils.css.CSSVariablesDeclaration` + + **Media are not implemented. Reason is that cssutils is using CSS + variables in a kind of preprocessing and therefor no media information + is available at this stage. For now do not use media!** + + Example:: + + @variables { + CorporateLogoBGColor: #fe8d12; + } + + div.logoContainer { + background-color: var(CorporateLogoBGColor); + } + """ + def __init__(self, mediaText=None, variables=None, parentRule=None, + parentStyleSheet=None, readonly=False): + """ + If readonly allows setting of properties in constructor only. + """ + super(CSSVariablesRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + self._atkeyword = u'@variables' + + # dummy + self._media = cssutils.stylesheets.MediaList(mediaText, + readonly=readonly) + + if variables: + self.variables = variables + else: + self.variables = CSSVariablesDeclaration(parentRule=self) + + self._readonly = readonly + + def __repr__(self): + return u"cssutils.css.%s(mediaText=%r, variables=%r)" % ( + self.__class__.__name__, + self._media.mediaText, + self.variables.cssText) + + def __str__(self): + return u"" % (self.__class__.__name__, + self._media.mediaText, + self.variables.cssText, + self.valid, + id(self)) + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_CSSVariablesRule(self) + + def _setCssText(self, cssText): + """ + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + + Format:: + + variables + : VARIABLES_SYM S* medium [ COMMA S* medium ]* LBRACE S* + variableset* '}' S* + ; + + variableset + : LBRACE S* vardeclaration [ ';' S* vardeclaration ]* '}' S* + ; + """ + super(CSSVariablesRule, self)._setCssText(cssText) + + tokenizer = self._tokenize2(cssText) + attoken = self._nexttoken(tokenizer, None) + if self._type(attoken) != self._prods.VARIABLES_SYM: + self._log.error(u'CSSVariablesRule: No CSSVariablesRule found: %s' % + self._valuestr(cssText), + error=xml.dom.InvalidModificationErr) + else: + newVariables = CSSVariablesDeclaration(parentRule=self) + ok = True + + beforetokens, brace = self._tokensupto2(tokenizer, + blockstartonly=True, + separateEnd=True) + if self._tokenvalue(brace) != u'{': + ok = False + self._log.error(u'CSSVariablesRule: No start { of variable ' + u'declaration found: %r' + % self._valuestr(cssText), brace) + + # parse stuff before { which should be comments and S only + new = {'wellformed': True} + newseq = self._tempSeq()#[] + + beforewellformed, expected = self._parse(expected=':', + seq=newseq, tokenizer=self._tokenize2(beforetokens), + productions={}) + ok = ok and beforewellformed and new['wellformed'] + + variablestokens, braceorEOFtoken = self._tokensupto2(tokenizer, + blockendonly=True, + separateEnd=True) + + val, type_ = self._tokenvalue(braceorEOFtoken), \ + self._type(braceorEOFtoken) + if val != u'}' and type_ != 'EOF': + ok = False + self._log.error(u'CSSVariablesRule: No "}" after variables ' + u'declaration found: %r' + % self._valuestr(cssText)) + + nonetoken = self._nexttoken(tokenizer) + if nonetoken: + ok = False + self._log.error(u'CSSVariablesRule: Trailing content found.', + token=nonetoken) + + if 'EOF' == type_: + # add again as variables needs it + variablestokens.append(braceorEOFtoken) + # SET but may raise: + newVariables.cssText = variablestokens + + if ok: + # contains probably comments only upto { + self._setSeq(newseq) + self.variables = newVariables + + cssText = property(_getCssText, _setCssText, + doc=u"(DOM) The parsable textual representation of this " + u"rule.") + + media = property(doc=u"NOT IMPLEMENTED! As cssutils resolves variables "\ + u"during serializing media information is lost.") + + def _setVariables(self, variables): + """ + :param variables: + a CSSVariablesDeclaration or string + """ + self._checkReadonly() + if isinstance(variables, basestring): + self._variables = CSSVariablesDeclaration(cssText=variables, + parentRule=self) + else: + variables._parentRule = self + self._variables = variables + + variables = property(lambda self: self._variables, _setVariables, + doc=u"(DOM) The variables of this rule set, a " + u":class:`cssutils.css.CSSVariablesDeclaration`.") + + type = property(lambda self: self.VARIABLES_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + valid = property(lambda self: True, doc='NOT IMPLEMTED REALLY (TODO)') + + # constant but needed: + wellformed = property(lambda self: True) diff --git a/libs/cssutils/css/marginrule.py b/libs/cssutils/css/marginrule.py new file mode 100755 index 00000000..0c789fad --- /dev/null +++ b/libs/cssutils/css/marginrule.py @@ -0,0 +1,215 @@ +"""MarginRule implements DOM Level 2 CSS MarginRule.""" +__all__ = ['MarginRule'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssutils.prodparser import * +from cssstyledeclaration import CSSStyleDeclaration +import cssrule +import cssutils +import xml.dom + +class MarginRule(cssrule.CSSRule): + """ + A margin at-rule consists of an ATKEYWORD that identifies the margin box + (e.g. '@top-left') and a block of declarations (said to be in the margin + context). + + Format:: + + margin : + margin_sym S* '{' declaration [ ';' S* declaration? ]* '}' S* + ; + + margin_sym : + TOPLEFTCORNER_SYM | + TOPLEFT_SYM | + TOPCENTER_SYM | + TOPRIGHT_SYM | + TOPRIGHTCORNER_SYM | + BOTTOMLEFTCORNER_SYM | + BOTTOMLEFT_SYM | + BOTTOMCENTER_SYM | + BOTTOMRIGHT_SYM | + BOTTOMRIGHTCORNER_SYM | + LEFTTOP_SYM | + LEFTMIDDLE_SYM | + LEFTBOTTOM_SYM | + RIGHTTOP_SYM | + RIGHTMIDDLE_SYM | + RIGHTBOTTOM_SYM + ; + + e.g.:: + + @top-left { + content: "123"; + } + """ + margins = ['@top-left-corner', + '@top-left', + '@top-center', + '@top-right', + '@top-right-corner', + '@bottom-left-corner', + '@bottom-left', + '@bottom-center', + '@bottom-right', + '@bottom-right-corner', + '@left-top', + '@left-middle', + '@left-bottom', + '@right-top', + '@right-middle', + '@right-bottom' + ] + + def __init__(self, margin=None, style=None, parentRule=None, + parentStyleSheet=None, readonly=False): + """ + :param atkeyword: + The margin area, e.g. '@top-left' for this rule + :param style: + CSSStyleDeclaration for this MarginRule + """ + super(MarginRule, self).__init__(parentRule=parentRule, + parentStyleSheet=parentStyleSheet) + + self._atkeyword = self._keyword = None + + if margin: + self.margin = margin + + if style: + self.style = style + else: + self.style = CSSStyleDeclaration(parentRule=self) + + self._readonly = readonly + + def _setMargin(self, margin): + """Check if new keyword fits the rule it is used for.""" + n = self._normalize(margin) + + if n not in MarginRule.margins: + self._log.error(u'Invalid margin @keyword for this %s rule: %r' % + (self.margin, margin), + error=xml.dom.InvalidModificationErr) + + else: + self._atkeyword = n + self._keyword = margin + + margin = property(lambda self: self._atkeyword, _setMargin, + doc=u"Margin area of parent CSSPageRule. " + u"`margin` and `atkeyword` are both normalized " + u"@keyword of the @rule.") + + atkeyword = margin + + def __repr__(self): + return u"cssutils.css.%s(margin=%r, style=%r)" % (self.__class__.__name__, + self.margin, + self.style.cssText) + + def __str__(self): + return u"" % (self.__class__.__name__, + self.margin, + self.style.cssText, + id(self)) + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_MarginRule(self) + + def _setCssText(self, cssText): + """ + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + Raised if the specified CSS string value represents a different + type of rule than the current one. + - :exc:`~xml.dom.HierarchyRequestErr`: + Raised if the rule cannot be inserted at this point in the + style sheet. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + super(MarginRule, self)._setCssText(cssText) + + # TEMP: all style tokens are saved in store to fill styledeclaration + # TODO: resolve when all generators + styletokens = Prod(name='styletokens', + match=lambda t, v: v != u'}', + #toSeq=False, + toStore='styletokens', + storeToken=True + ) + + prods = Sequence(Prod(name='@ margin', + match=lambda t, v: + t == 'ATKEYWORD' and + self._normalize(v) in MarginRule.margins, + toStore='margin' + # TODO? + #, exception=xml.dom.InvalidModificationErr + ), + PreDef.char('OPEN', u'{'), + Sequence(Choice(PreDef.unknownrule(toStore='@'), + styletokens), + minmax=lambda: (0, None) + ), + PreDef.char('CLOSE', u'}', stopAndKeep=True) + ) + # parse + ok, seq, store, unused = ProdParser().parse(cssText, + u'MarginRule', + prods) + + if ok: + # TODO: use seq for serializing instead of fixed stuff? + self._setSeq(seq) + + if 'margin' in store: + # may raise: + self.margin = store['margin'].value + else: + self._log.error(u'No margin @keyword for this %s rule' % + self.margin, + error=xml.dom.InvalidModificationErr) + + # new empty style + self.style = CSSStyleDeclaration(parentRule=self) + + if 'styletokens' in store: + # may raise: + self.style.cssText = store['styletokens'] + + + cssText = property(fget=_getCssText, fset=_setCssText, + doc=u"(DOM) The parsable textual representation.") + + def _setStyle(self, style): + """ + :param style: A string or CSSStyleDeclaration which replaces the + current style object. + """ + self._checkReadonly() + if isinstance(style, basestring): + self._style = CSSStyleDeclaration(cssText=style, parentRule=self) + else: + style._parentRule = self + self._style = style + + style = property(lambda self: self._style, _setStyle, + doc=u"(DOM) The declaration-block of this rule set.") + + type = property(lambda self: self.MARGIN_RULE, + doc=u"The type of this rule, as defined by a CSSRule " + u"type constant.") + + wellformed = property(lambda self: bool(self.atkeyword)) + \ No newline at end of file diff --git a/libs/cssutils/css/property.py b/libs/cssutils/css/property.py new file mode 100755 index 00000000..fad240c0 --- /dev/null +++ b/libs/cssutils/css/property.py @@ -0,0 +1,510 @@ +"""Property is a single CSS property in a CSSStyleDeclaration.""" +__all__ = ['Property'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssutils.helper import Deprecated +from value import PropertyValue +import cssutils +import xml.dom + +class Property(cssutils.util.Base): + """A CSS property in a StyleDeclaration of a CSSStyleRule (cssutils). + + Format:: + + property = name + : IDENT S* + ; + + expr = value + : term [ operator term ]* + ; + term + : unary_operator? + [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | + ANGLE S* | TIME S* | FREQ S* | function ] + | STRING S* | IDENT S* | URI S* | hexcolor + ; + function + : FUNCTION S* expr ')' S* + ; + /* + * There is a constraint on the color that it must + * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F]) + * after the "#"; e.g., "#000" is OK, but "#abcd" is not. + */ + hexcolor + : HASH S* + ; + + prio + : IMPORTANT_SYM S* + ; + + """ + def __init__(self, name=None, value=None, priority=u'', + _mediaQuery=False, parent=None): + """ + :param name: + a property name string (will be normalized) + :param value: + a property value string + :param priority: + an optional priority string which currently must be u'', + u'!important' or u'important' + :param _mediaQuery: + if ``True`` value is optional (used by MediaQuery) + :param parent: + the parent object, normally a + :class:`cssutils.css.CSSStyleDeclaration` + """ + super(Property, self).__init__() + self.seqs = [[], None, []] + self.wellformed = False + self._mediaQuery = _mediaQuery + self.parent = parent + + self.__nametoken = None + self._name = u'' + self._literalname = u'' + self.seqs[1] = PropertyValue(parent=self) + if name: + self.name = name + self.propertyValue = value + + self._priority = u'' + self._literalpriority = u'' + if priority: + self.priority = priority + + def __repr__(self): + return u"cssutils.css.%s(name=%r, value=%r, priority=%r)" % ( + self.__class__.__name__, + self.literalname, + self.propertyValue.cssText, + self.priority) + + def __str__(self): + return u"<%s.%s object name=%r value=%r priority=%r valid=%r at 0x%x>" \ + % (self.__class__.__module__, + self.__class__.__name__, + self.name, + self.propertyValue.cssText, + self.priority, + self.valid, + id(self)) + + def _isValidating(self): + """Return True if validation is enabled.""" + try: + return self.parent.validating + except AttributeError: + # default (no parent) + return True + + def _getCssText(self): + """Return serialized property cssText.""" + return cssutils.ser.do_Property(self) + + def _setCssText(self, cssText): + """ + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error and + is unparsable. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if the rule is readonly. + """ + # check and prepare tokenlists for setting + tokenizer = self._tokenize2(cssText) + nametokens = self._tokensupto2(tokenizer, propertynameendonly=True) + if nametokens: + wellformed = True + + valuetokens = self._tokensupto2(tokenizer, + propertyvalueendonly=True) + prioritytokens = self._tokensupto2(tokenizer, + propertypriorityendonly=True) + + if self._mediaQuery and not valuetokens: + # MediaQuery may consist of name only + self.name = nametokens + self.propertyValue = None + self.priority = None + return + + # remove colon from nametokens + colontoken = nametokens.pop() + if self._tokenvalue(colontoken) != u':': + wellformed = False + self._log.error(u'Property: No ":" after name found: %s' % + self._valuestr(cssText), colontoken) + elif not nametokens: + wellformed = False + self._log.error(u'Property: No property name found: %s' % + self._valuestr(cssText), colontoken) + + if valuetokens: + if self._tokenvalue(valuetokens[-1]) == u'!': + # priority given, move "!" to prioritytokens + prioritytokens.insert(0, valuetokens.pop(-1)) + else: + wellformed = False + self._log.error(u'Property: No property value found: %s' % + self._valuestr(cssText), colontoken) + + if wellformed: + self.wellformed = True + self.name = nametokens + self.propertyValue = valuetokens + self.priority = prioritytokens + + # also invalid values are set! + + if self._isValidating(): + self.validate() + + else: + self._log.error(u'Property: No property name found: %s' % + self._valuestr(cssText)) + + cssText = property(fget=_getCssText, fset=_setCssText, + doc="A parsable textual representation.") + + def _setName(self, name): + """ + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified name has a syntax error and is + unparsable. + """ + # for closures: must be a mutable + new = {'literalname': None, + 'wellformed': True} + + def _ident(expected, seq, token, tokenizer=None): + # name + if 'name' == expected: + new['literalname'] = self._tokenvalue(token).lower() + seq.append(new['literalname']) + return 'EOF' + else: + new['wellformed'] = False + self._log.error(u'Property: Unexpected ident.', token) + return expected + + newseq = [] + wellformed, expected = self._parse(expected='name', + seq=newseq, + tokenizer=self._tokenize2(name), + productions={'IDENT': _ident}) + wellformed = wellformed and new['wellformed'] + + # post conditions + # define a token for error logging + if isinstance(name, list): + token = name[0] + self.__nametoken = token + else: + token = None + + if not new['literalname']: + wellformed = False + self._log.error(u'Property: No name found: %s' % + self._valuestr(name), token=token) + + if wellformed: + self.wellformed = True + self._literalname = new['literalname'] + self._name = self._normalize(self._literalname) + self.seqs[0] = newseq + + # validate + if self._isValidating() and self._name not in cssutils.profile.knownNames: + # self.valid = False + self._log.warn(u'Property: Unknown Property name.', + token=token, neverraise=True) + else: + pass +# self.valid = True +# if self.propertyValue: +# self.propertyValue._propertyName = self._name +# #self.valid = self.propertyValue.valid + else: + self.wellformed = False + + name = property(lambda self: self._name, _setName, + doc="Name of this property.") + + literalname = property(lambda self: self._literalname, + doc="Readonly literal (not normalized) name " + "of this property") + + def _setPropertyValue(self, cssText): + """ + See css.PropertyValue + + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error + (according to the attached property) or is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + TODO: Raised if the specified CSS string value represents a different + type of values than the values allowed by the CSS property. + """ + if self._mediaQuery and not cssText: + self.seqs[1] = PropertyValue(parent=self) + else: + self.seqs[1].cssText = cssText + self.wellformed = self.wellformed and self.seqs[1].wellformed + + propertyValue = property(lambda self: self.seqs[1], + _setPropertyValue, + doc=u"(cssutils) PropertyValue object of property") + + + def _getValue(self): + if self.propertyValue: + # value without comments + return self.propertyValue.value + else: + return u'' + + def _setValue(self, value): + self._setPropertyValue(value) + + value = property(_getValue, _setValue, + doc="The textual value of this Properties propertyValue.") + + def _setPriority(self, priority): + """ + priority + a string, currently either u'', u'!important' or u'important' + + Format:: + + prio + : IMPORTANT_SYM S* + ; + + "!"{w}"important" {return IMPORTANT_SYM;} + + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified priority has a syntax error and is + unparsable. + In this case a priority not equal to None, "" or "!{w}important". + As CSSOM defines CSSStyleDeclaration.getPropertyPriority resulting + in u'important' this value is also allowed to set a Properties + priority + """ + if self._mediaQuery: + self._priority = u'' + self._literalpriority = u'' + if priority: + self._log.error(u'Property: No priority in a MediaQuery - ' + u'ignored.') + return + + if isinstance(priority, basestring) and\ + u'important' == self._normalize(priority): + priority = u'!%s' % priority + + # for closures: must be a mutable + new = {'literalpriority': u'', + 'wellformed': True} + + def _char(expected, seq, token, tokenizer=None): + # "!" + val = self._tokenvalue(token) + if u'!' == expected == val: + seq.append(val) + return 'important' + else: + new['wellformed'] = False + self._log.error(u'Property: Unexpected char.', token) + return expected + + def _ident(expected, seq, token, tokenizer=None): + # "important" + val = self._tokenvalue(token) + if 'important' == expected: + new['literalpriority'] = val + seq.append(val) + return 'EOF' + else: + new['wellformed'] = False + self._log.error(u'Property: Unexpected ident.', token) + return expected + + newseq = [] + wellformed, expected = self._parse(expected='!', + seq=newseq, + tokenizer=self._tokenize2(priority), + productions={'CHAR': _char, + 'IDENT': _ident}) + wellformed = wellformed and new['wellformed'] + + # post conditions + if priority and not new['literalpriority']: + wellformed = False + self._log.info(u'Property: Invalid priority: %s' % + self._valuestr(priority)) + + if wellformed: + self.wellformed = self.wellformed and wellformed + self._literalpriority = new['literalpriority'] + self._priority = self._normalize(self.literalpriority) + self.seqs[2] = newseq + # validate priority + if self._priority not in (u'', u'important'): + self._log.error(u'Property: No CSS priority value: %s' % + self._priority) + + priority = property(lambda self: self._priority, _setPriority, + doc="Priority of this property.") + + literalpriority = property(lambda self: self._literalpriority, + doc="Readonly literal (not normalized) priority of this property") + + def _setParent(self, parent): + self._parent = parent + + parent = property(lambda self: self._parent, _setParent, + doc="The Parent Node (normally a CSSStyledeclaration) of this " + "Property") + + def validate(self): + """Validate value against `profiles` which are checked dynamically. + properties in e.g. @font-face rules are checked against + ``cssutils.profile.CSS3_FONT_FACE`` only. + + For each of the following cases a message is reported: + + - INVALID (so the property is known but not valid) + ``ERROR Property: Invalid value for "{PROFILE-1[/PROFILE-2...]" + property: ...`` + + - VALID but not in given profiles or defaultProfiles + ``WARNING Property: Not valid for profile "{PROFILE-X}" but valid + "{PROFILE-Y}" property: ...`` + + - VALID in current profile + ``DEBUG Found valid "{PROFILE-1[/PROFILE-2...]" property...`` + + - UNKNOWN property + ``WARNING Unknown Property name...`` is issued + + so for example:: + + cssutils.log.setLevel(logging.DEBUG) + parser = cssutils.CSSParser() + s = parser.parseString('''body { + unknown-property: x; + color: 4; + color: rgba(1,2,3,4); + color: red + }''') + + # Log output: + + WARNING Property: Unknown Property name. [2:9: unknown-property] + ERROR Property: Invalid value for "CSS Color Module Level 3/CSS Level 2.1" property: 4 [3:9: color] + DEBUG Property: Found valid "CSS Color Module Level 3" value: rgba(1, 2, 3, 4) [4:9: color] + DEBUG Property: Found valid "CSS Level 2.1" value: red [5:9: color] + + + and when setting an explicit default profile:: + + cssutils.profile.defaultProfiles = cssutils.profile.CSS_LEVEL_2 + s = parser.parseString('''body { + unknown-property: x; + color: 4; + color: rgba(1,2,3,4); + color: red + }''') + + # Log output: + + WARNING Property: Unknown Property name. [2:9: unknown-property] + ERROR Property: Invalid value for "CSS Color Module Level 3/CSS Level 2.1" property: 4 [3:9: color] + WARNING Property: Not valid for profile "CSS Level 2.1" but valid "CSS Color Module Level 3" value: rgba(1, 2, 3, 4) [4:9: color] + DEBUG Property: Found valid "CSS Level 2.1" value: red [5:9: color] + """ + valid = False + + profiles = None + try: + # if @font-face use that profile + rule = self.parent.parentRule + except AttributeError: + pass + else: + if rule is not None: + if rule.type == rule.FONT_FACE_RULE: + profiles = [cssutils.profile.CSS3_FONT_FACE] + #TODO: same for @page + + if self.name and self.value: + + cv = self.propertyValue + # TODO +# if cv.cssValueType == cv.CSS_VARIABLE and not cv.value: +# # TODO: false alarms too! +# cssutils.log.warn(u'No value for variable "%s" found, keeping ' +# u'variable.' % cv.name, neverraise=True) + + if self.name in cssutils.profile.knownNames: + # add valid, matching, validprofiles... + valid, matching, validprofiles = \ + cssutils.profile.validateWithProfile(self.name, + self.value, + profiles) + + if not valid: + self._log.error(u'Property: Invalid value for ' + u'"%s" property: %s' + % (u'/'.join(validprofiles), self.value), + token=self.__nametoken, + neverraise=True) + + # TODO: remove logic to profiles! + elif valid and not matching:#(profiles and profiles not in validprofiles): + if not profiles: + notvalidprofiles = u'/'.join(cssutils.profile.defaultProfiles) + else: + notvalidprofiles = profiles + self._log.warn(u'Property: Not valid for profile "%s" ' + u'but valid "%s" value: %s ' + % (notvalidprofiles, u'/'.join(validprofiles), + self.value), + token = self.__nametoken, + neverraise=True) + valid = False + + elif valid: + self._log.debug(u'Property: Found valid "%s" value: %s' + % (u'/'.join(validprofiles), self.value), + token = self.__nametoken, + neverraise=True) + + if self._priority not in (u'', u'important'): + valid = False + + return valid + + valid = property(validate, doc=u"Check if value of this property is valid " + u"in the properties context.") + + + @Deprecated(u'Use ``property.propertyValue`` instead.') + def _getCSSValue(self): + return self.propertyValue + + @Deprecated(u'Use ``property.propertyValue`` instead.') + def _setCSSValue(self, cssText): + self._setPropertyValue(cssText) + + cssValue = property(_getCSSValue, _setCSSValue, + doc="(DEPRECATED) Use ``property.propertyValue`` instead.") diff --git a/libs/cssutils/css/selector.py b/libs/cssutils/css/selector.py new file mode 100755 index 00000000..87840a0d --- /dev/null +++ b/libs/cssutils/css/selector.py @@ -0,0 +1,813 @@ +"""Selector is a single Selector of a CSSStyleRule SelectorList. +Partly implements http://www.w3.org/TR/css3-selectors/. + +TODO + - .contains(selector) + - .isSubselector(selector) +""" +__all__ = ['Selector'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssutils.helper import Deprecated +from cssutils.util import _SimpleNamespaces +import cssutils +import xml.dom + +class Selector(cssutils.util.Base2): + """ + (cssutils) a single selector in a :class:`~cssutils.css.SelectorList` + of a :class:`~cssutils.css.CSSStyleRule`. + + Format:: + + # implemented in SelectorList + selectors_group + : selector [ COMMA S* selector ]* + ; + + selector + : simple_selector_sequence [ combinator simple_selector_sequence ]* + ; + + combinator + /* combinators can be surrounded by white space */ + : PLUS S* | GREATER S* | TILDE S* | S+ + ; + + simple_selector_sequence + : [ type_selector | universal ] + [ HASH | class | attrib | pseudo | negation ]* + | [ HASH | class | attrib | pseudo | negation ]+ + ; + + type_selector + : [ namespace_prefix ]? element_name + ; + + namespace_prefix + : [ IDENT | '*' ]? '|' + ; + + element_name + : IDENT + ; + + universal + : [ namespace_prefix ]? '*' + ; + + class + : '.' IDENT + ; + + attrib + : '[' S* [ namespace_prefix ]? IDENT S* + [ [ PREFIXMATCH | + SUFFIXMATCH | + SUBSTRINGMATCH | + '=' | + INCLUDES | + DASHMATCH ] S* [ IDENT | STRING ] S* + ]? ']' + ; + + pseudo + /* '::' starts a pseudo-element, ':' a pseudo-class */ + /* Exceptions: :first-line, :first-letter, :before and :after. */ + /* Note that pseudo-elements are restricted to one per selector and */ + /* occur only in the last simple_selector_sequence. */ + : ':' ':'? [ IDENT | functional_pseudo ] + ; + + functional_pseudo + : FUNCTION S* expression ')' + ; + + expression + /* In CSS3, the expressions are identifiers, strings, */ + /* or of the form "an+b" */ + : [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+ + ; + + negation + : NOT S* negation_arg S* ')' + ; + + negation_arg + : type_selector | universal | HASH | class | attrib | pseudo + ; + + """ + def __init__(self, selectorText=None, parent=None, + readonly=False): + """ + :Parameters: + selectorText + initial value of this selector + parent + a SelectorList + readonly + default to False + """ + super(Selector, self).__init__() + + self.__namespaces = _SimpleNamespaces(log=self._log) + self._element = None + self._parent = parent + self._specificity = (0, 0, 0, 0) + + if selectorText: + self.selectorText = selectorText + + self._readonly = readonly + + def __repr__(self): + if self.__getNamespaces(): + st = (self.selectorText, self._getUsedNamespaces()) + else: + st = self.selectorText + return u"cssutils.css.%s(selectorText=%r)" % (self.__class__.__name__, + st) + + def __str__(self): + return u"" % (self.__class__.__name__, + self.selectorText, + self.specificity, + self._getUsedNamespaces(), + id(self)) + + def _getUsedUris(self): + "Return list of actually used URIs in this Selector." + uris = set() + for item in self.seq: + type_, val = item.type, item.value + if type_.endswith(u'-selector') or type_ == u'universal' and \ + isinstance(val, tuple) and val[0] not in (None, u'*'): + uris.add(val[0]) + return uris + + def _getUsedNamespaces(self): + "Return actually used namespaces only." + useduris = self._getUsedUris() + namespaces = _SimpleNamespaces(log=self._log) + for p, uri in self._namespaces.items(): + if uri in useduris: + namespaces[p] = uri + return namespaces + + def __getNamespaces(self): + "Use own namespaces if not attached to a sheet, else the sheet's ones." + try: + return self._parent.parentRule.parentStyleSheet.namespaces + except AttributeError: + return self.__namespaces + + _namespaces = property(__getNamespaces, + doc=u"If this Selector is attached to a " + u"CSSStyleSheet the namespaces of that sheet " + u"are mirrored here. While the Selector (or " + u"parent SelectorList or parentRule(s) of that " + u"are not attached a own dict of {prefix: " + u"namespaceURI} is used.") + + + element = property(lambda self: self._element, + doc=u"Effective element target of this selector.") + + parent = property(lambda self: self._parent, + doc=u"(DOM) The SelectorList that contains this Selector " + u"or None if this Selector is not attached to a " + u"SelectorList.") + + def _getSelectorText(self): + """Return serialized format.""" + return cssutils.ser.do_css_Selector(self) + + def _setSelectorText(self, selectorText): + """ + :param selectorText: + parsable string or a tuple of (selectorText, dict-of-namespaces). + Given namespaces are ignored if this object is attached to a + CSSStyleSheet! + + :exceptions: + - :exc:`~xml.dom.NamespaceErr`: + Raised if the specified selector uses an unknown namespace + prefix. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error + and is unparsable. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this rule is readonly. + """ + self._checkReadonly() + + # might be (selectorText, namespaces) + selectorText, namespaces = self._splitNamespacesOff(selectorText) + + try: + # uses parent stylesheets namespaces if available, + # otherwise given ones + namespaces = self.parent.parentRule.parentStyleSheet.namespaces + except AttributeError: + pass + tokenizer = self._tokenize2(selectorText) + if not tokenizer: + self._log.error(u'Selector: No selectorText given.') + else: + # prepare tokenlist: + # "*" -> type "universal" + # "*"|IDENT + "|" -> combined to "namespace_prefix" + # "|" -> type "namespace_prefix" + # "." + IDENT -> combined to "class" + # ":" + IDENT, ":" + FUNCTION -> pseudo-class + # FUNCTION "not(" -> negation + # "::" + IDENT, "::" + FUNCTION -> pseudo-element + tokens = [] + for t in tokenizer: + typ, val, lin, col = t + if val == u':' and tokens and\ + self._tokenvalue(tokens[-1]) == ':': + # combine ":" and ":" + tokens[-1] = (typ, u'::', lin, col) + + elif typ == 'IDENT' and tokens\ + and self._tokenvalue(tokens[-1]) == u'.': + # class: combine to .IDENT + tokens[-1] = ('class', u'.'+val, lin, col) + elif typ == 'IDENT' and tokens and \ + self._tokenvalue(tokens[-1]).startswith(u':') and\ + not self._tokenvalue(tokens[-1]).endswith(u'('): + # pseudo-X: combine to :IDENT or ::IDENT but not ":a(" + "b" + if self._tokenvalue(tokens[-1]).startswith(u'::'): + t = 'pseudo-element' + else: + t = 'pseudo-class' + tokens[-1] = (t, self._tokenvalue(tokens[-1])+val, lin, col) + + elif typ == 'FUNCTION' and val == u'not(' and tokens and \ + u':' == self._tokenvalue(tokens[-1]): + tokens[-1] = ('negation', u':' + val, lin, tokens[-1][3]) + elif typ == 'FUNCTION' and tokens\ + and self._tokenvalue(tokens[-1]).startswith(u':'): + # pseudo-X: combine to :FUNCTION( or ::FUNCTION( + if self._tokenvalue(tokens[-1]).startswith(u'::'): + t = 'pseudo-element' + else: + t = 'pseudo-class' + tokens[-1] = (t, self._tokenvalue(tokens[-1])+val, lin, col) + + elif val == u'*' and tokens and\ + self._type(tokens[-1]) == 'namespace_prefix' and\ + self._tokenvalue(tokens[-1]).endswith(u'|'): + # combine prefix|* + tokens[-1] = ('universal', self._tokenvalue(tokens[-1])+val, + lin, col) + elif val == u'*': + # universal: "*" + tokens.append(('universal', val, lin, col)) + + elif val == u'|' and tokens and\ + self._type(tokens[-1]) in (self._prods.IDENT, 'universal')\ + and self._tokenvalue(tokens[-1]).find(u'|') == -1: + # namespace_prefix: "IDENT|" or "*|" + tokens[-1] = ('namespace_prefix', + self._tokenvalue(tokens[-1])+u'|', lin, col) + elif val == u'|': + # namespace_prefix: "|" + tokens.append(('namespace_prefix', val, lin, col)) + + else: + tokens.append(t) + + tokenizer = iter(tokens) + + # for closures: must be a mutable + new = {'context': [''], # stack of: 'attrib', 'negation', 'pseudo' + 'element': None, + '_PREFIX': None, + 'specificity': [0, 0, 0, 0], # mutable, finally a tuple! + 'wellformed': True + } + # used for equality checks and setting of a space combinator + S = u' ' + + def append(seq, val, typ=None, token=None): + """ + appends to seq + + namespace_prefix, IDENT will be combined to a tuple + (prefix, name) where prefix might be None, the empty string + or a prefix. + + Saved are also: + - specificity definition: style, id, class/att, type + - element: the element this Selector is for + """ + context = new['context'][-1] + if token: + line, col = token[2], token[3] + else: + line, col = None, None + + if typ == '_PREFIX': + # SPECIAL TYPE: save prefix for combination with next + new['_PREFIX'] = val[:-1] + # handle next time + return + + if new['_PREFIX'] is not None: + # as saved from before and reset to None + prefix, new['_PREFIX'] = new['_PREFIX'], None + elif typ == 'universal' and '|' in val: + # val == *|* or prefix|* + prefix, val = val.split('|') + else: + prefix = None + + # namespace + if (typ.endswith('-selector') or typ == 'universal') and not ( + 'attribute-selector' == typ and not prefix): + # att **IS NOT** in default ns + if prefix == u'*': + # *|name: in ANY_NS + namespaceURI = cssutils._ANYNS + elif prefix is None: + # e or *: default namespace with prefix u'' + # or local-name() + namespaceURI = namespaces.get(u'', None) + elif prefix == u'': + # |name or |*: in no (or the empty) namespace + namespaceURI = u'' + else: + # explicit namespace prefix + # does not raise KeyError, see _SimpleNamespaces + namespaceURI = namespaces[prefix] + + if namespaceURI is None: + new['wellformed'] = False + self._log.error(u'Selector: No namespaceURI found ' + u'for prefix %r' % prefix, + token=token, + error=xml.dom.NamespaceErr) + return + + # val is now (namespaceprefix, name) tuple + val = (namespaceURI, val) + + # specificity + if not context or context == 'negation': + if 'id' == typ: + new['specificity'][1] += 1 + elif 'class' == typ or '[' == val: + new['specificity'][2] += 1 + elif typ in ('type-selector', 'negation-type-selector', + 'pseudo-element'): + new['specificity'][3] += 1 + if not context and typ in ('type-selector', 'universal'): + # define element + new['element'] = val + + seq.append(val, typ, line=line, col=col) + + # expected constants + simple_selector_sequence = 'type_selector universal HASH class ' \ + 'attrib pseudo negation ' + simple_selector_sequence2 = 'HASH class attrib pseudo negation ' + + element_name = 'element_name' + + negation_arg = 'type_selector universal HASH class attrib pseudo' + negationend = ')' + + attname = 'prefix attribute' + attname2 = 'attribute' + attcombinator = 'combinator ]' # optional + attvalue = 'value' # optional + attend = ']' + + expressionstart = 'PLUS - DIMENSION NUMBER STRING IDENT' + expression = expressionstart + ' )' + + combinator = ' combinator' + + def _COMMENT(expected, seq, token, tokenizer=None): + "special implementation for comment token" + append(seq, cssutils.css.CSSComment([token]), 'COMMENT', + token=token) + return expected + + def _S(expected, seq, token, tokenizer=None): + # S + context = new['context'][-1] + if context.startswith('pseudo-'): + if seq and seq[-1].value not in u'+-': + # e.g. x:func(a + b) + append(seq, S, 'S', token=token) + return expected + + elif context != 'attrib' and 'combinator' in expected: + append(seq, S, 'descendant', token=token) + return simple_selector_sequence + combinator + + else: + return expected + + def _universal(expected, seq, token, tokenizer=None): + # *|* or prefix|* + context = new['context'][-1] + val = self._tokenvalue(token) + if 'universal' in expected: + append(seq, val, 'universal', token=token) + + if 'negation' == context: + return negationend + else: + return simple_selector_sequence2 + combinator + + else: + new['wellformed'] = False + self._log.error( + u'Selector: Unexpected universal.', token=token) + return expected + + def _namespace_prefix(expected, seq, token, tokenizer=None): + # prefix| => element_name + # or prefix| => attribute_name if attrib + context = new['context'][-1] + val = self._tokenvalue(token) + if 'attrib' == context and 'prefix' in expected: + # [PREFIX|att] + append(seq, val, '_PREFIX', token=token) + return attname2 + elif 'type_selector' in expected: + # PREFIX|* + append(seq, val, '_PREFIX', token=token) + return element_name + else: + new['wellformed'] = False + self._log.error( + u'Selector: Unexpected namespace prefix.', token=token) + return expected + + def _pseudo(expected, seq, token, tokenizer=None): + # pseudo-class or pseudo-element :a ::a :a( ::a( + """ + /* '::' starts a pseudo-element, ':' a pseudo-class */ + /* Exceptions: :first-line, :first-letter, :before and + :after. */ + /* Note that pseudo-elements are restricted to one per selector + and */ + /* occur only in the last simple_selector_sequence. */ + """ + context = new['context'][-1] + val, typ = self._tokenvalue(token, normalize=True),\ + self._type(token) + if 'pseudo' in expected: + if val in (':first-line', + ':first-letter', + ':before', + ':after'): + # always pseudo-element ??? + typ = 'pseudo-element' + append(seq, val, typ, token=token) + + if val.endswith(u'('): + # function + # "pseudo-" "class" or "element" + new['context'].append(typ) + return expressionstart + elif 'negation' == context: + return negationend + elif 'pseudo-element' == typ: + # only one per element, check at ) also! + return combinator + else: + return simple_selector_sequence2 + combinator + + else: + new['wellformed'] = False + self._log.error( + u'Selector: Unexpected start of pseudo.', token=token) + return expected + + def _expression(expected, seq, token, tokenizer=None): + # [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+ + context = new['context'][-1] + val, typ = self._tokenvalue(token), self._type(token) + if context.startswith('pseudo-'): + append(seq, val, typ, token=token) + return expression + else: + new['wellformed'] = False + self._log.error( + u'Selector: Unexpected %s.' % typ, token=token) + return expected + + def _attcombinator(expected, seq, token, tokenizer=None): + # context: attrib + # PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH | INCLUDES | + # DASHMATCH + context = new['context'][-1] + val, typ = self._tokenvalue(token), self._type(token) + if 'attrib' == context and 'combinator' in expected: + # combinator in attrib + append(seq, val, typ.lower(), token=token) + return attvalue + else: + new['wellformed'] = False + self._log.error( + u'Selector: Unexpected %s.' % typ, token=token) + return expected + + def _string(expected, seq, token, tokenizer=None): + # identifier + context = new['context'][-1] + typ, val = self._type(token), self._stringtokenvalue(token) + + # context: attrib + if 'attrib' == context and 'value' in expected: + # attrib: [...=VALUE] + append(seq, val, typ, token=token) + return attend + + # context: pseudo + elif context.startswith('pseudo-'): + # :func(...) + append(seq, val, typ, token=token) + return expression + + else: + new['wellformed'] = False + self._log.error( + u'Selector: Unexpected STRING.', token=token) + return expected + + def _ident(expected, seq, token, tokenizer=None): + # identifier + context = new['context'][-1] + val, typ = self._tokenvalue(token), self._type(token) + + # context: attrib + if 'attrib' == context and 'attribute' in expected: + # attrib: [...|ATT...] + append(seq, val, 'attribute-selector', token=token) + return attcombinator + + elif 'attrib' == context and 'value' in expected: + # attrib: [...=VALUE] + append(seq, val, 'attribute-value', token=token) + return attend + + # context: negation + elif 'negation' == context: + # negation: (prefix|IDENT) + append(seq, val, 'negation-type-selector', token=token) + return negationend + + # context: pseudo + elif context.startswith('pseudo-'): + # :func(...) + append(seq, val, typ, token=token) + return expression + + elif 'type_selector' in expected or element_name == expected: + # element name after ns or complete type_selector + append(seq, val, 'type-selector', token=token) + return simple_selector_sequence2 + combinator + + else: + new['wellformed'] = False + self._log.error(u'Selector: Unexpected IDENT.', token=token) + return expected + + def _class(expected, seq, token, tokenizer=None): + # .IDENT + context = new['context'][-1] + val = self._tokenvalue(token) + if 'class' in expected: + append(seq, val, 'class', token=token) + + if 'negation' == context: + return negationend + else: + return simple_selector_sequence2 + combinator + + else: + new['wellformed'] = False + self._log.error(u'Selector: Unexpected class.', token=token) + return expected + + def _hash(expected, seq, token, tokenizer=None): + # #IDENT + context = new['context'][-1] + val = self._tokenvalue(token) + if 'HASH' in expected: + append(seq, val, 'id', token=token) + + if 'negation' == context: + return negationend + else: + return simple_selector_sequence2 + combinator + + else: + new['wellformed'] = False + self._log.error(u'Selector: Unexpected HASH.', token=token) + return expected + + def _char(expected, seq, token, tokenizer=None): + # + > ~ ) [ ] + - + context = new['context'][-1] + val = self._tokenvalue(token) + + # context: attrib + if u']' == val and 'attrib' == context and ']' in expected: + # end of attrib + append(seq, val, 'attribute-end', token=token) + context = new['context'].pop() # attrib is done + context = new['context'][-1] + if 'negation' == context: + return negationend + else: + return simple_selector_sequence2 + combinator + + elif u'=' == val and 'attrib' == context\ + and 'combinator' in expected: + # combinator in attrib + append(seq, val, 'equals', token=token) + return attvalue + + # context: negation + elif u')' == val and 'negation' == context and u')' in expected: + # not(negation_arg)" + append(seq, val, 'negation-end', token=token) + new['context'].pop() # negation is done + context = new['context'][-1] + return simple_selector_sequence + combinator + + # context: pseudo (at least one expression) + elif val in u'+-' and context.startswith('pseudo-'): + # :func(+ -)" + _names = {'+': 'plus', '-': 'minus'} + if val == u'+' and seq and seq[-1].value == S: + seq.replace(-1, val, _names[val]) + else: + append(seq, val, _names[val], + token=token) + return expression + + elif u')' == val and context.startswith('pseudo-') and\ + expression == expected: + # :func(expression)" + append(seq, val, 'function-end', token=token) + new['context'].pop() # pseudo is done + if 'pseudo-element' == context: + return combinator + else: + return simple_selector_sequence + combinator + + # context: ROOT + elif u'[' == val and 'attrib' in expected: + # start of [attrib] + append(seq, val, 'attribute-start', token=token) + new['context'].append('attrib') + return attname + + elif val in u'+>~' and 'combinator' in expected: + # no other combinator except S may be following + _names = { + '>': 'child', + '+': 'adjacent-sibling', + '~': 'following-sibling'} + if seq and seq[-1].value == S: + seq.replace(-1, val, _names[val]) + else: + append(seq, val, _names[val], token=token) + return simple_selector_sequence + + elif u',' == val: + # not a selectorlist + new['wellformed'] = False + self._log.error( + u'Selector: Single selector only.', + error=xml.dom.InvalidModificationErr, + token=token) + return expected + + else: + new['wellformed'] = False + self._log.error( + u'Selector: Unexpected CHAR.', token=token) + return expected + + def _negation(expected, seq, token, tokenizer=None): + # not( + context = new['context'][-1] + val = self._tokenvalue(token, normalize=True) + if 'negation' in expected: + new['context'].append('negation') + append(seq, val, 'negation-start', token=token) + return negation_arg + else: + new['wellformed'] = False + self._log.error( + u'Selector: Unexpected negation.', token=token) + return expected + + def _atkeyword(expected, seq, token, tokenizer=None): + "invalidates selector" + new['wellformed'] = False + self._log.error( + u'Selector: Unexpected ATKEYWORD.', token=token) + return expected + + + # expected: only|not or mediatype, mediatype, feature, and + newseq = self._tempSeq() + + wellformed, expected = self._parse( + expected=simple_selector_sequence, + seq=newseq, tokenizer=tokenizer, + productions={'CHAR': _char, + 'class': _class, + 'HASH': _hash, + 'STRING': _string, + 'IDENT': _ident, + 'namespace_prefix': _namespace_prefix, + 'negation': _negation, + 'pseudo-class': _pseudo, + 'pseudo-element': _pseudo, + 'universal': _universal, + # pseudo + 'NUMBER': _expression, + 'DIMENSION': _expression, + # attribute + 'PREFIXMATCH': _attcombinator, + 'SUFFIXMATCH': _attcombinator, + 'SUBSTRINGMATCH': _attcombinator, + 'DASHMATCH': _attcombinator, + 'INCLUDES': _attcombinator, + + 'S': _S, + 'COMMENT': _COMMENT, + 'ATKEYWORD': _atkeyword}) + wellformed = wellformed and new['wellformed'] + + # post condition + if len(new['context']) > 1 or not newseq: + wellformed = False + self._log.error(u'Selector: Invalid or incomplete selector: %s' + % self._valuestr(selectorText)) + + if expected == 'element_name': + wellformed = False + self._log.error(u'Selector: No element name found: %s' + % self._valuestr(selectorText)) + + if expected == simple_selector_sequence and newseq: + wellformed = False + self._log.error(u'Selector: Cannot end with combinator: %s' + % self._valuestr(selectorText)) + + if newseq and hasattr(newseq[-1].value, 'strip') \ + and newseq[-1].value.strip() == u'': + del newseq[-1] + + # set + if wellformed: + self.__namespaces = namespaces + self._element = new['element'] + self._specificity = tuple(new['specificity']) + self._setSeq(newseq) + # filter that only used ones are kept + self.__namespaces = self._getUsedNamespaces() + + selectorText = property(_getSelectorText, _setSelectorText, + doc=u"(DOM) The parsable textual representation of " + u"the selector.") + + specificity = property(lambda self: self._specificity, + doc="""Specificity of this selector (READONLY). + Tuple of (a, b, c, d) where: + + a + presence of style in document, always 0 if not used on a + document + b + number of ID selectors + c + number of .class selectors + d + number of Element (type) selectors""") + + wellformed = property(lambda self: bool(len(self.seq))) + + + @Deprecated('Use property parent instead') + def _getParentList(self): + return self.parent + + parentList = property(_getParentList, + doc="DEPRECATED, see property parent instead") diff --git a/libs/cssutils/css/selectorlist.py b/libs/cssutils/css/selectorlist.py new file mode 100755 index 00000000..2072cd53 --- /dev/null +++ b/libs/cssutils/css/selectorlist.py @@ -0,0 +1,234 @@ +"""SelectorList is a list of CSS Selector objects. + +TODO + - remove duplicate Selectors. -> CSSOM canonicalize + + - ??? CSS2 gives a special meaning to the comma (,) in selectors. + However, since it is not known if the comma may acquire other + meanings in future versions of CSS, the whole statement should be + ignored if there is an error anywhere in the selector, even though + the rest of the selector may look reasonable in CSS2. + + Illegal example(s): + + For example, since the "&" is not a valid token in a CSS2 selector, + a CSS2 user agent must ignore the whole second line, and not set + the color of H3 to red: +""" +__all__ = ['SelectorList'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from selector import Selector +import cssutils +import xml.dom + +class SelectorList(cssutils.util.Base, cssutils.util.ListSeq): + """A list of :class:`~cssutils.css.Selector` objects + of a :class:`~cssutils.css.CSSStyleRule`.""" + def __init__(self, selectorText=None, parentRule=None, + readonly=False): + """ + :Parameters: + selectorText + parsable list of Selectors + parentRule + the parent CSSRule if available + """ + super(SelectorList, self).__init__() + + self._parentRule = parentRule + + if selectorText: + self.selectorText = selectorText + + self._readonly = readonly + + def __repr__(self): + if self._namespaces: + st = (self.selectorText, self._namespaces) + else: + st = self.selectorText + return u"cssutils.css.%s(selectorText=%r)" % (self.__class__.__name__, + st) + + def __str__(self): + return u"" % (self.__class__.__name__, + self.selectorText, + self._namespaces, + id(self)) + + def __setitem__(self, index, newSelector): + """Overwrite ListSeq.__setitem__ + + Any duplicate Selectors are **not** removed. + """ + newSelector = self.__prepareset(newSelector) + if newSelector: + self.seq[index] = newSelector + + def __prepareset(self, newSelector, namespaces=None): + "Used by appendSelector and __setitem__" + if not namespaces: + namespaces = {} + self._checkReadonly() + if not isinstance(newSelector, Selector): + newSelector = Selector((newSelector, namespaces), + parent=self) + if newSelector.wellformed: + newSelector._parent = self # maybe set twice but must be! + return newSelector + + def __getNamespaces(self): + """Use children namespaces if not attached to a sheet, else the sheet's + ones. + """ + try: + return self.parentRule.parentStyleSheet.namespaces + except AttributeError: + namespaces = {} + for selector in self.seq: + namespaces.update(selector._namespaces) + return namespaces + + def _getUsedUris(self): + "Used by CSSStyleSheet to check if @namespace rules are needed" + uris = set() + for s in self: + uris.update(s._getUsedUris()) + return uris + + _namespaces = property(__getNamespaces, doc="""If this SelectorList is + attached to a CSSStyleSheet the namespaces of that sheet are mirrored + here. While the SelectorList (or parentRule(s) are + not attached the namespaces of all children Selectors are used.""") + + def append(self, newSelector): + "Same as :meth:`appendSelector`." + self.appendSelector(newSelector) + + def appendSelector(self, newSelector): + """ + Append `newSelector` to this list (a string will be converted to a + :class:`~cssutils.css.Selector`). + + :param newSelector: + comma-separated list of selectors (as a single string) or a tuple of + `(newSelector, dict-of-namespaces)` + :returns: New :class:`~cssutils.css.Selector` or ``None`` if + `newSelector` is not wellformed. + :exceptions: + - :exc:`~xml.dom.NamespaceErr`: + Raised if the specified selector uses an unknown namespace + prefix. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error + and is unparsable. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this rule is readonly. + """ + self._checkReadonly() + + # might be (selectorText, namespaces) + newSelector, namespaces = self._splitNamespacesOff(newSelector) + try: + # use parent's only if available + namespaces = self.parentRule.parentStyleSheet.namespaces + except AttributeError: + # use already present namespaces plus new given ones + _namespaces = self._namespaces + _namespaces.update(namespaces) + namespaces = _namespaces + + newSelector = self.__prepareset(newSelector, namespaces) + if newSelector: + seq = self.seq[:] + del self.seq[:] + for s in seq: + if s.selectorText != newSelector.selectorText: + self.seq.append(s) + self.seq.append(newSelector) + return newSelector + + def _getSelectorText(self): + "Return serialized format." + return cssutils.ser.do_css_SelectorList(self) + + def _setSelectorText(self, selectorText): + """ + :param selectorText: + comma-separated list of selectors or a tuple of + (selectorText, dict-of-namespaces) + :exceptions: + - :exc:`~xml.dom.NamespaceErr`: + Raised if the specified selector uses an unknown namespace + prefix. + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error + and is unparsable. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this rule is readonly. + """ + self._checkReadonly() + + # might be (selectorText, namespaces) + selectorText, namespaces = self._splitNamespacesOff(selectorText) + try: + # use parent's only if available + namespaces = self.parentRule.parentStyleSheet.namespaces + except AttributeError: + pass + + wellformed = True + tokenizer = self._tokenize2(selectorText) + newseq = [] + + expected = True + while True: + # find all upto and including next ",", EOF or nothing + selectortokens = self._tokensupto2(tokenizer, listseponly=True) + if selectortokens: + if self._tokenvalue(selectortokens[-1]) == ',': + expected = selectortokens.pop() + else: + expected = None + + selector = Selector((selectortokens, namespaces), + parent=self) + if selector.wellformed: + newseq.append(selector) + else: + wellformed = False + self._log.error(u'SelectorList: Invalid Selector: %s' % + self._valuestr(selectortokens)) + else: + break + + # post condition + if u',' == expected: + wellformed = False + self._log.error(u'SelectorList: Cannot end with ",": %r' % + self._valuestr(selectorText)) + elif expected: + wellformed = False + self._log.error(u'SelectorList: Unknown Syntax: %r' % + self._valuestr(selectorText)) + if wellformed: + self.seq = newseq + + selectorText = property(_getSelectorText, _setSelectorText, + doc=u"(cssutils) The textual representation of the " + u"selector for a rule set.") + + length = property(lambda self: len(self), + doc=u"The number of :class:`~cssutils.css.Selector` " + u"objects in the list.") + + parentRule = property(lambda self: self._parentRule, + doc=u"(DOM) The CSS rule that contains this " + u"SelectorList or ``None`` if this SelectorList " + u"is not attached to a CSSRule.") + + wellformed = property(lambda self: bool(len(self.seq))) + diff --git a/libs/cssutils/css/value.py b/libs/cssutils/css/value.py new file mode 100755 index 00000000..f9ab050a --- /dev/null +++ b/libs/cssutils/css/value.py @@ -0,0 +1,871 @@ +"""Value related classes. + +DOM Level 2 CSS CSSValue, CSSPrimitiveValue and CSSValueList are **no longer** +supported and are replaced by these new classes. +""" +__all__ = ['PropertyValue', + 'Value', + 'ColorValue', + 'DimensionValue', + 'URIValue', + 'CSSFunction', + 'CSSVariable', + 'MSValue' + ] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from cssutils.prodparser import * +import cssutils +from cssutils.helper import normalize, pushtoken +import colorsys +import math +import re +import xml.dom +import urlparse + +class PropertyValue(cssutils.util._NewBase): + """ + An unstructured list like holder for all values defined for a + :class:`~cssutils.css.Property`. Contains :class:`~cssutils.css.Value` + or subclass objects. Currently there is no access to the combinators of + the defined values which might simply be space or comma or slash. + + You may: + + - iterate over all contained Value objects (not the separators like ``,``, + ``/`` or `` `` though!) + - get a Value item by index or use ``PropertyValue[index]`` + - find out the number of values defined (unstructured) + """ + def __init__(self, cssText=None, parent=None, readonly=False): + """ + :param cssText: + the parsable cssText of the value + :param readonly: + defaults to False + """ + super(PropertyValue, self).__init__() + + self.parent = parent + self.wellformed = False + + if cssText is not None: # may be 0 + if isinstance(cssText, (int, float)): + cssText = unicode(cssText) # if it is a number + self.cssText = cssText + + self._readonly = readonly + + def __len__(self): + return len(list(self.__items())) + + def __getitem__(self, index): + try: + return list(self.__items())[index] + except IndexError: + return None + + def __iter__(self): + "Generator which iterates over values." + for item in self.__items(): + yield item + + def __repr__(self): + return u"cssutils.css.%s(%r)" % (self.__class__.__name__, + self.cssText) + + def __str__(self): + return u"" % (self.__class__.__name__, + self.length, self.cssText, id(self)) + + def __items(self, seq=None): + "a generator of Value obects only, no , / or ' '" + if seq is None: + seq = self.seq + return (x.value for x in seq if isinstance(x.value, Value)) + + def _setCssText(self, cssText): + if isinstance(cssText, (int, float)): + cssText = unicode(cssText) # if it is a number + """ + Format:: + + unary_operator + : '-' | '+' + ; + operator + : '/' S* | ',' S* | /* empty */ + ; + expr + : term [ operator term ]* + ; + term + : unary_operator? + [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | + ANGLE S* | TIME S* | FREQ S* ] + | STRING S* | IDENT S* | URI S* | hexcolor | function + | UNICODE-RANGE S* + ; + function + : FUNCTION S* expr ')' S* + ; + /* + * There is a constraint on the color that it must + * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F]) + * after the "#"; e.g., "#000" is OK, but "#abcd" is not. + */ + hexcolor + : HASH S* + ; + + :exceptions: + - :exc:`~xml.dom.SyntaxErr`: + Raised if the specified CSS string value has a syntax error + (according to the attached property) or is unparsable. + - :exc:`~xml.dom.InvalidModificationErr`: + TODO: Raised if the specified CSS string value represents a + different type of values than the values allowed by the CSS + property. + - :exc:`~xml.dom.NoModificationAllowedErr`: + Raised if this value is readonly. + """ + self._checkReadonly() + + # used as operator is , / or S + nextSor = u',/' + term = Choice(_ColorProd(self, nextSor), + _DimensionProd(self, nextSor), + _URIProd(self, nextSor), + _ValueProd(self, nextSor), +# _CalcValueProd(self, nextSor), +# _Rect(self, nextSor), + # all other functions + _CSSVariableProd(self, nextSor), + _MSValueProd(self, nextSor), + _CSSFunctionProd(self, nextSor) + ) + operator = Choice(PreDef.S(toSeq=False), + PreDef.char('comma', ',', + toSeq=lambda t, tokens: ('operator', t[1])), + PreDef.char('slash', '/', + toSeq=lambda t, tokens: ('operator', t[1])), + optional=True) + prods = Sequence(term, + Sequence(# mayEnd this Sequence if whitespace + operator, + # TODO: only when setting via other class + # used by variabledeclaration currently + PreDef.char('END', ';', + stopAndKeep=True, + optional=True), + # TODO: } and !important ends too! + term, + minmax=lambda: (0, None))) + # parse + ok, seq, store, unused = ProdParser().parse(cssText, + u'PropertyValue', + prods) + # must be at least one value! + ok = ok and len(list(self.__items(seq))) > 0 + if ok: + self._setSeq(seq) + self.wellformed = True + else: + self._log.error(u'PropertyValue: Unknown syntax or no value: %s' % + self._valuestr(cssText)) + + cssText = property(lambda self: cssutils.ser.do_css_PropertyValue(self), + _setCssText, + doc="A string representation of the current value.") + + def item(self, index): + """ + The value at position `index`. Alternatively simple use + ``PropertyValue[index]``. + + :param index: + the parsable cssText of the value + :exceptions: + - :exc:`~IndexError`: + Raised if index if out of bounds + """ + return self[index] + + length = property(lambda self: len(self), + doc=u"Number of values set.") + + value = property(lambda self: cssutils.ser.do_css_PropertyValue(self, + valuesOnly=True), + doc=u"A string representation of the current value " + u"without any comments used for validation.") + + +class Value(cssutils.util._NewBase): + """ + Represents a single CSS value. For now simple values of + IDENT, STRING, or UNICODE-RANGE values are represented directly + as Value objects. Other values like e.g. FUNCTIONs are represented by + subclasses with an extended API. + """ + IDENT = u'IDENT' + STRING = u'STRING' + UNICODE_RANGE = u'UNICODE-RANGE' + URI = u'URI' + + DIMENSION = u'DIMENSION' + NUMBER = u'NUMBER' + PERCENTAGE = u'PERCENTAGE' + + COLOR_VALUE = u'COLOR_VALUE' + HASH = u'HASH' + + FUNCTION = u'FUNCTION' + VARIABLE = u'VARIABLE' + + _type = None + _value = u'' + + def __init__(self, cssText=None, parent=None, readonly=False): + super(Value, self).__init__() + + self.parent = parent + + if cssText: + self.cssText = cssText + + def __repr__(self): + return u"cssutils.css.%s(%r)" % (self.__class__.__name__, + self.cssText) + + def __str__(self): + return u""\ + % (self.__class__.__name__, + self.type, self.value, self.cssText, + id(self)) + + def _setCssText(self, cssText): + self._checkReadonly() + + prods = Choice(PreDef.hexcolor(stop=True), + PreDef.ident(stop=True), + PreDef.string(stop=True), + PreDef.unicode_range(stop=True), + ) + ok, seq, store, unused = ProdParser().parse(cssText, u'Value', prods) + if ok: + # only 1 value anyway! + self._type = seq[0].type + self._value = seq[0].value + + self._setSeq(seq) + self.wellformed = ok + + cssText = property(lambda self: cssutils.ser.do_css_Value(self), + _setCssText, + doc=u'String value of this value.') + + type = property(lambda self: self._type, #_setType, + doc=u"Type of this value, for now the production type " + u"like e.g. `DIMENSION` or `STRING`. All types are " + u"defined as constants in :class:`~cssutils.css.Value`.") + + def _setValue(self, value): + # TODO: check! + self._value = value + + value = property(lambda self: self._value, _setValue, + doc=u"Actual value if possible: An int or float or else " + u" a string") + + +class ColorValue(Value): + """ + A color value like rgb(), rgba(), hsl(), hsla() or #rgb, #rrggbb + + TODO: Color Keywords + """ + from colors import COLORS + + type = Value.COLOR_VALUE + # hexcolor, FUNCTION? + _colorType = None + _red = 0 + _green = 0 + _blue = 0 + _alpha = 0 + + def __str__(self): + return u""\ + % (self.__class__.__name__, + self.type, self.value, + self.colorType, self.red, self.green, self.blue, self.alpha, + id(self)) + + def _setCssText(self, cssText): + self._checkReadonly() + types = self._prods # rename! + + component = Choice(PreDef.unary(toSeq=lambda t, tokens: (t[0], + DimensionValue(pushtoken(t, tokens), + parent=self) + )), + PreDef.number(toSeq=lambda t, tokens: (t[0], + DimensionValue(pushtoken(t, tokens), + parent=self) + )), + PreDef.percentage(toSeq=lambda t, tokens: (t[0], + DimensionValue(pushtoken(t, tokens), + parent=self) + )) + ) + noalp = Sequence(Prod(name='FUNCTION', + match=lambda t, v: t == types.FUNCTION and + v in (u'rgb(', u'hsl('), + toSeq=lambda t, tokens: (t[0], normalize(t[1]))), + component, + Sequence(PreDef.comma(), + component, + minmax=lambda: (2, 2) + ), + PreDef.funcEnd(stop=True) + ) + witha = Sequence(Prod(name='FUNCTION', + match=lambda t, v: t == types.FUNCTION and + v in (u'rgba(', u'hsla('), + toSeq=lambda t, tokens: (t[0], + normalize(t[1])) + ), + component, + Sequence(PreDef.comma(), + component, + minmax=lambda: (3, 3) + ), + PreDef.funcEnd(stop=True) + ) + namedcolor = Prod(name='Named Color', + match=lambda t, v: t == 'IDENT' and ( + normalize(v) in self.COLORS.keys() + ), + stop=True) + + prods = Choice(PreDef.hexcolor(stop=True), + namedcolor, + noalp, + witha) + + ok, seq, store, unused = ProdParser().parse(cssText, + self.type, + prods) + if ok: + t, v = seq[0].type, seq[0].value + if u'IDENT' == t: + rgba = self.COLORS[normalize(v)] + if u'HASH' == t: + if len(v) == 4: + # HASH #rgb + rgba = (int(2*v[1], 16), + int(2*v[2], 16), + int(2*v[3], 16), + 1.0) + else: + # HASH #rrggbb + rgba = (int(v[1:3], 16), + int(v[3:5], 16), + int(v[5:7], 16), + 1.0) + + elif u'FUNCTION' == t: + functiontype, raw, check = None, [], u'' + HSL = False + + for item in seq: + try: + type_ = item.value.type + except AttributeError, e: + # type of function, e.g. rgb( + if item.type == 'FUNCTION': + functiontype = item.value + HSL = functiontype in (u'hsl(', u'hsla(') + continue + + # save components + if type_ == Value.NUMBER: + raw.append(item.value.value) + check += u'N' + elif type_ == Value.PERCENTAGE: + if HSL: + # save as percentage fraction + raw.append(item.value.value / 100.0) + else: + # save as real value of percentage of 255 + raw.append(int(255 * item.value.value / 100)) + check += u'P' + + if HSL: + # convert to rgb + # h is 360 based (circle) + h, s, l = raw[0] / 360.0, raw[1], raw[2] + # ORDER h l s !!! + r, g, b = colorsys.hls_to_rgb(h, l, s) + # back to 255 based + rgba = [int(round(r*255)), + int(round(g*255)), + int(round(b*255))] + + if len(raw) > 3: + rgba.append(raw[3]) + + else: + # rgb, rgba + rgba = raw + + if len(rgba) < 4: + rgba.append(1.0) + + # validate + checks = {u'rgb(': ('NNN', 'PPP'), + u'rgba(': ('NNNN', 'PPPN'), + u'hsl(': ('NPP',), + u'hsla(': ('NPPN',) + } + if check not in checks[functiontype]: + self._log.error(u'ColorValue has invalid %s) parameters: ' + u'%s (N=Number, P=Percentage)' % + (functiontype, check)) + + self._colorType = t + self._red, self._green, self._blue, self._alpha = tuple(rgba) + self._setSeq(seq) + self.wellformed = ok + + cssText = property(lambda self: cssutils.ser.do_css_ColorValue(self), + _setCssText, + doc=u"String value of this value.") + + value = property(lambda self: cssutils.ser.do_css_CSSFunction(self, True), + doc=u'Same as cssText but without comments.') + + type = property(lambda self: Value.COLOR_VALUE, + doc=u"Type is fixed to Value.COLOR_VALUE.") + + def _getName(self): + for n, v in self.COLORS.items(): + if v == (self.red, self.green, self.blue, self.alpha): + return n + + colorType = property(lambda self: self._colorType, + doc=u"IDENT (red), HASH (#f00) or FUNCTION (rgb(255, 0, 0).") + + name = property(_getName, + doc=u'Name of the color if known (in ColorValue.COLORS) ' + u'else None') + + red = property(lambda self: self._red, + doc=u'red part as integer between 0 and 255') + green = property(lambda self: self._green, + doc=u'green part as integer between 0 and 255') + blue = property(lambda self: self._blue, + doc=u'blue part as integer between 0 and 255') + alpha = property(lambda self: self._alpha, + doc=u'alpha part as float between 0.0 and 1.0') + +class DimensionValue(Value): + """ + A numerical value with an optional dimenstion like e.g. "px" or "%". + + Covers DIMENSION, PERCENTAGE or NUMBER values. + """ + __reNumDim = re.compile(ur'^(\d*\.\d+|\d+)(.*)$', re.I | re.U | re.X) + _dimension = None + _sign = None + + def __str__(self): + return u""\ + % (self.__class__.__name__, + self.type, self.value, self.dimension, self.cssText, + id(self)) + + def _setCssText(self, cssText): + self._checkReadonly() + + prods = Sequence(PreDef.unary(), + Choice(PreDef.dimension(stop=True), + PreDef.number(stop=True), + PreDef.percentage(stop=True) + ) + ) + ok, seq, store, unused = ProdParser().parse(cssText, + u'DimensionValue', + prods) + if ok: + sign = val = u'' + dim = type_ = None + + # find + for item in seq: + if item.value in u'+-': + sign = item.value + else: + type_ = item.type + + # number + optional dim + v, d = self.__reNumDim.findall( + normalize(item.value))[0] + if u'.' in v: + val = float(sign + v) + else: + val = int(sign + v) + if d: + dim = d + + self._sign = sign + self._value = val + self._dimension = dim + self._type = type_ + + self._setSeq(seq) + self.wellformed = ok + + cssText = property(lambda self: cssutils.ser.do_css_Value(self), + _setCssText, + doc=u"String value of this value including dimension.") + + dimension = property(lambda self: self._dimension, #_setValue, + doc=u"Dimension if a DIMENSION or PERCENTAGE value, " + u"else None") +class URIValue(Value): + """ + An URI value like ``url(example.png)``. + """ + _type = Value.URI + _uri = Value._value + + def __str__(self): + return u""\ + % (self.__class__.__name__, + self.type, self.value, self.uri, self.cssText, + id(self)) + + def _setCssText(self, cssText): + self._checkReadonly() + + prods = Sequence(PreDef.uri(stop=True)) + + ok, seq, store, unused = ProdParser().parse(cssText, u'URIValue', prods) + if ok: + # only 1 value only anyway + self._type = seq[0].type + self._value = seq[0].value + + self._setSeq(seq) + self.wellformed = ok + + cssText = property(lambda self: cssutils.ser.do_css_Value(self), + _setCssText, + doc=u'String value of this value.') + + def _setUri(self, uri): + # TODO: check? + self._value = uri + + uri = property(lambda self: self._value, _setUri, + doc=u"Actual URL without delimiters or the empty string") + + def absoluteUri(self): + """Actual URL, made absolute if possible, else same as `uri`.""" + # Ancestry: PropertyValue, Property, CSSStyleDeclaration, CSSStyleRule, + # CSSStyleSheet + try: + # TODO: better way? + styleSheet = self.parent.parent.parent.parentRule.parentStyleSheet + except AttributeError, e: + return self.uri + else: + return urlparse.urljoin(styleSheet.href, self.uri) + + absoluteUri = property(absoluteUri, doc=absoluteUri.__doc__) + + +class CSSFunction(Value): + """ + A function value. + """ + _functionName = 'Function' + + def _productions(self): + """Return definition used for parsing.""" + types = self._prods # rename! + + itemProd = Choice(_ColorProd(self), + _DimensionProd(self), + _URIProd(self), + _ValueProd(self), + #_CalcValueProd(self), + _CSSVariableProd(self), + _CSSFunctionProd(self) + ) + funcProds = Sequence(Prod(name='FUNCTION', + match=lambda t, v: t == types.FUNCTION, + toSeq=lambda t, tokens: (t[0], + normalize(t[1]))), + Choice(Sequence(itemProd, + Sequence(PreDef.comma(), + itemProd, + minmax=lambda: (0, None)), + PreDef.funcEnd(stop=True)), + PreDef.funcEnd(stop=True)) + ) + return funcProds + + def _setCssText(self, cssText): + self._checkReadonly() + ok, seq, store, unused = ProdParser().parse(cssText, + self.type, + self._productions()) + if ok: + self._setSeq(seq) + self.wellformed = ok + + cssText = property(lambda self: cssutils.ser.do_css_CSSFunction(self), + _setCssText, + doc=u"String value of this value.") + + value = property(lambda self: cssutils.ser.do_css_CSSFunction(self, True), + doc=u'Same as cssText but without comments.') + + type = property(lambda self: Value.FUNCTION, + doc=u"Type is fixed to Value.FUNCTION.") + +class MSValue(CSSFunction): + """An IE specific Microsoft only function value which is much looser + in what is syntactically allowed.""" + _functionName = 'MSValue' + + def _productions(self): + """Return definition used for parsing.""" + types = self._prods # rename! + + func = Prod(name='MSValue-Sub', + match=lambda t, v: t == self._prods.FUNCTION, + toSeq=lambda t, tokens: (MSValue._functionName, + MSValue(pushtoken(t, + tokens + ), + parent=self + ) + ) + ) + + + funcProds = Sequence(Prod(name='FUNCTION', + match=lambda t, v: t == types.FUNCTION, + toSeq=lambda t, tokens: (t[0], t[1]) + ), + Sequence(Choice(_ColorProd(self), + _DimensionProd(self), + _URIProd(self), + _ValueProd(self), + _MSValueProd(self), + #_CalcValueProd(self), + _CSSVariableProd(self), + func, + #_CSSFunctionProd(self), + Prod(name='MSValuePart', + match=lambda t, v: v != u')', + toSeq=lambda t, tokens: (t[0], t[1]) + ) + ), + minmax=lambda: (0, None) + ), + PreDef.funcEnd(stop=True) + ) + return funcProds + + def _setCssText(self, cssText): + super(MSValue, self)._setCssText(cssText) + + cssText = property(lambda self: cssutils.ser.do_css_MSValue(self), + _setCssText, + doc=u"String value of this value.") + + +class CSSVariable(CSSFunction): + """The CSSVariable represents a CSS variables like ``var(varname)``. + + A variable has a (nonnormalized!) `name` and a `value` which is + tried to be resolved from any available CSSVariablesRule definition. + """ + _functionName = 'CSSVariable' + _name = None + + def __str__(self): + return u"" % ( + self.__class__.__name__, self.name, self.value, id(self)) + + def _setCssText(self, cssText): + self._checkReadonly() + + types = self._prods # rename! + prods = Sequence(Prod(name='var', + match=lambda t, v: t == types.FUNCTION and + normalize(v) == u'var(' + ), + PreDef.ident(toStore='ident'), + PreDef.funcEnd(stop=True)) + + # store: name of variable + store = {'ident': None} + ok, seq, store, unused = ProdParser().parse(cssText, + u'CSSVariable', + prods) + if ok: + self._name = store['ident'].value + self._setSeq(seq) + self.wellformed = ok + + cssText = property(lambda self: cssutils.ser.do_css_CSSVariable(self), + _setCssText, doc=u"String representation of variable.") + + # TODO: writable? check if var (value) available? + name = property(lambda self: self._name, + doc=u"The name identifier of this variable referring to " + u"a value in a " + u":class:`cssutils.css.CSSVariablesDeclaration`.") + + type = property(lambda self: Value.VARIABLE, + doc=u"Type is fixed to Value.VARIABLE.") + + def _getValue(self): + "Find contained sheet and @variables there" + rel = self + while True: + # find node which has parentRule to get to StyleSheet + if hasattr(rel, 'parent'): + rel = rel.parent + else: + break + try: + variables = rel.parentRule.parentStyleSheet.variables + except AttributeError: + return None + else: + try: + return variables[self.name] + except KeyError: + return None + + value = property(_getValue, + doc=u'The resolved actual value or None.') + + +# helper for productions +def _ValueProd(parent, nextSor=False): + return Prod(name='Value', + match=lambda t, v: t in ('IDENT', 'STRING', 'UNICODE-RANGE'), + nextSor = nextSor, + toSeq=lambda t, tokens: ('Value', Value( + pushtoken(t, + tokens), + parent=parent) + ) + ) + + +def _DimensionProd(parent, nextSor=False): + return Prod(name='Dimension', + match=lambda t, v: t in (u'DIMENSION', + u'NUMBER', + u'PERCENTAGE') or v in u'+-', + nextSor = nextSor, + toSeq=lambda t, tokens: (t[0], DimensionValue( + pushtoken(t, + tokens), + parent=parent) + ) + ) + +def _URIProd(parent, nextSor=False): + return Prod(name='URIValue', + match=lambda t, v: t == 'URI', + nextSor = nextSor, + toSeq=lambda t, tokens: ('URIValue', URIValue( + pushtoken(t, + tokens), + parent=parent) + ) + ) + +reHexcolor = re.compile(r'^\#(?:[0-9abcdefABCDEF]{3}|[0-9abcdefABCDEF]{6})$') + +def _ColorProd(parent, nextSor=False): + return Prod(name='ColorValue', + match=lambda t, v: + (t == 'HASH' and + reHexcolor.match(v) + ) or + (t == 'FUNCTION' and + normalize(v) in (u'rgb(', + u'rgba(', + u'hsl(', + u'hsla(') + ) or + (t == 'IDENT' and + normalize(v) in ColorValue.COLORS.keys() + ), + nextSor = nextSor, + toSeq=lambda t, tokens: ('ColorValue', ColorValue( + pushtoken(t, + tokens), + parent=parent) + ) + ) + +def _CSSFunctionProd(parent, nextSor=False): + return PreDef.function(nextSor=nextSor, + toSeq=lambda t, tokens: (CSSFunction._functionName, + CSSFunction( + pushtoken(t, tokens), + parent=parent) + ) + ) + +def _CSSVariableProd(parent, nextSor=False): + return PreDef.variable(nextSor=nextSor, + toSeq=lambda t, tokens: (CSSVariable._functionName, + CSSVariable( + pushtoken(t, tokens), + parent=parent) + ) + ) + +def _MSValueProd(parent, nextSor=False): + return Prod(name=MSValue._functionName, + match=lambda t, v: (#t == self._prods.FUNCTION and ( + normalize(v) in (u'expression(', + u'alpha(', + u'blur(', + u'chroma(', + u'dropshadow(', + u'fliph(', + u'flipv(', + u'glow(', + u'gray(', + u'invert(', + u'mask(', + u'shadow(', + u'wave(', + u'xray(') or + v.startswith(u'progid:DXImageTransform.Microsoft.') + ), + nextSor=nextSor, + toSeq=lambda t, tokens: (MSValue._functionName, + MSValue(pushtoken(t, + tokens + ), + parent=parent + ) + ) + ) diff --git a/libs/cssutils/css2productions.py b/libs/cssutils/css2productions.py new file mode 100755 index 00000000..a435e71e --- /dev/null +++ b/libs/cssutils/css2productions.py @@ -0,0 +1,131 @@ +"""productions for CSS 2.1 + +CSS2_1_MACROS and CSS2_1_PRODUCTIONS are from both +http://www.w3.org/TR/CSS21/grammar.html and +http://www.w3.org/TR/css3-syntax/#grammar0 + + +""" +__all__ = ['CSSProductions', 'MACROS', 'PRODUCTIONS'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +# option case-insensitive +MACROS = { + 'h': r'[0-9a-f]', + #'nonascii': r'[\200-\377]', + 'nonascii': r'[^\0-\177]', # CSS3 + 'unicode': r'\\{h}{1,6}(\r\n|[ \t\r\n\f])?', + + 'escape': r'{unicode}|\\[^\r\n\f0-9a-f]', + 'nmstart': r'[_a-zA-Z]|{nonascii}|{escape}', + 'nmchar': r'[_a-zA-Z0-9-]|{nonascii}|{escape}', + 'string1': r'\"([^\n\r\f\\"]|\\{nl}|{escape})*\"', + 'string2': r"\'([^\n\r\f\\']|\\{nl}|{escape})*\'", + 'invalid1': r'\"([^\n\r\f\\"]|\\{nl}|{escape})*', + 'invalid2': r"\'([^\n\r\f\\']|\\{nl}|{escape})*", + 'comment': r'\/\*[^*]*\*+([^/*][^*]*\*+)*\/', + # CSS list 080725 19:43 + # \/\*([^*\\]|{escape})*\*+(([^/*\\]|{escape})[^*]*\*+)*\/ + + 'ident': r'[-]?{nmstart}{nmchar}*', + 'name': r'{nmchar}+', + # CHANGED TO SPEC: added "-?" + 'num': r'-?[0-9]*\.[0-9]+|[0-9]+', + 'string': r'{string1}|{string2}', + 'invalid': r'{invalid1}|{invalid2}', + 'url': r'([!#$%&*-~]|{nonascii}|{escape})*', + 's': r'[ \t\r\n\f]+', + 'w': r'{s}?', + 'nl': r'\n|\r\n|\r|\f', + 'range': r'\?{1,6}|{h}(\?{0,5}|{h}(\?{0,4}|{h}(\?{0,3}|{h}(\?{0,2}|{h}(\??|{h})))))', + + 'A': r'a|\\0{0,4}(41|61)(\r\n|[ \t\r\n\f])?', + 'C': r'c|\\0{0,4}(43|63)(\r\n|[ \t\r\n\f])?', + 'D': r'd|\\0{0,4}(44|64)(\r\n|[ \t\r\n\f])?', + 'E': r'e|\\0{0,4}(45|65)(\r\n|[ \t\r\n\f])?', + 'F': r'f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?', + 'G': r'g|\\0{0,4}(47|67)(\r\n|[ \t\r\n\f])?|\\g', + 'H': r'h|\\0{0,4}(48|68)(\r\n|[ \t\r\n\f])?|\\h', + 'I': r'i|\\0{0,4}(49|69)(\r\n|[ \t\r\n\f])?|\\i', + 'K': r'k|\\0{0,4}(4b|6b)(\r\n|[ \t\r\n\f])?|\\k', + 'M': r'm|\\0{0,4}(4d|6d)(\r\n|[ \t\r\n\f])?|\\m', + 'N': r'n|\\0{0,4}(4e|6e)(\r\n|[ \t\r\n\f])?|\\n', + 'O': r'o|\\0{0,4}(51|71)(\r\n|[ \t\r\n\f])?|\\o', + 'P': r'p|\\0{0,4}(50|70)(\r\n|[ \t\r\n\f])?|\\p', + 'R': r'r|\\0{0,4}(52|72)(\r\n|[ \t\r\n\f])?|\\r', + 'S': r's|\\0{0,4}(53|73)(\r\n|[ \t\r\n\f])?|\\s', + 'T': r't|\\0{0,4}(54|74)(\r\n|[ \t\r\n\f])?|\\t', + 'X': r'x|\\0{0,4}(58|78)(\r\n|[ \t\r\n\f])?|\\x', + 'Z': r'z|\\0{0,4}(5a|7a)(\r\n|[ \t\r\n\f])?|\\z', + } + +PRODUCTIONS = [ + ('URI', r'url\({w}{string}{w}\)'), #"url("{w}{string}{w}")" {return URI;} + ('URI', r'url\({w}{url}{w}\)'), #"url("{w}{url}{w}")" {return URI;} + ('FUNCTION', r'{ident}\('), #{ident}"(" {return FUNCTION;} + + ('IMPORT_SYM', r'@{I}{M}{P}{O}{R}{T}'), #"@import" {return IMPORT_SYM;} + ('PAGE_SYM', r'@{P}{A}{G}{E}'), #"@page" {return PAGE_SYM;} + ('MEDIA_SYM', r'@{M}{E}{D}{I}{A}'), #"@media" {return MEDIA_SYM;} + ('FONT_FACE_SYM', r'@{F}{O}{N}{T}\-{F}{A}{C}{E}'), #"@font-face" {return FONT_FACE_SYM;} + + # CHANGED TO SPEC: only @charset + ('CHARSET_SYM', r'@charset '), #"@charset " {return CHARSET_SYM;} + + ('NAMESPACE_SYM', r'@{N}{A}{M}{E}{S}{P}{A}{C}{E}'), #"@namespace" {return NAMESPACE_SYM;} + + # CHANGED TO SPEC: ATKEYWORD + ('ATKEYWORD', r'\@{ident}'), + + ('IDENT', r'{ident}'), #{ident} {return IDENT;} + ('STRING', r'{string}'), #{string} {return STRING;} + ('INVALID', r'{invalid}'), # {return INVALID; /* unclosed string */} + ('HASH', r'\#{name}'), #"#"{name} {return HASH;} + ('PERCENTAGE', r'{num}%'), #{num}% {return PERCENTAGE;} + ('LENGTH', r'{num}{E}{M}'), #{num}em {return EMS;} + ('LENGTH', r'{num}{E}{X}'), #{num}ex {return EXS;} + ('LENGTH', r'{num}{P}{X}'), #{num}px {return LENGTH;} + ('LENGTH', r'{num}{C}{M}'), #{num}cm {return LENGTH;} + ('LENGTH', r'{num}{M}{M}'), #{num}mm {return LENGTH;} + ('LENGTH', r'{num}{I}{N}'), #{num}in {return LENGTH;} + ('LENGTH', r'{num}{P}{T}'), #{num}pt {return LENGTH;} + ('LENGTH', r'{num}{P}{C}'), #{num}pc {return LENGTH;} + ('ANGLE', r'{num}{D}{E}{G}'), #{num}deg {return ANGLE;} + ('ANGLE', r'{num}{R}{A}{D}'), #{num}rad {return ANGLE;} + ('ANGLE', r'{num}{G}{R}{A}{D}'), #{num}grad {return ANGLE;} + ('TIME', r'{num}{M}{S}'), #{num}ms {return TIME;} + ('TIME', r'{num}{S}'), #{num}s {return TIME;} + ('FREQ', r'{num}{H}{Z}'), #{num}Hz {return FREQ;} + ('FREQ', r'{num}{K}{H}{Z}'), #{num}kHz {return FREQ;} + ('DIMEN', r'{num}{ident}'), #{num}{ident} {return DIMEN;} + ('NUMBER', r'{num}'), #{num} {return NUMBER;} + #('UNICODERANGE', r'U\+{range}'), #U\+{range} {return UNICODERANGE;} + #('UNICODERANGE', r'U\+{h}{1,6}-{h}{1,6}'), #U\+{h}{1,6}-{h}{1,6} {return UNICODERANGE;} + # --- CSS3 --- + ('UNICODE-RANGE', r'[0-9A-F?]{1,6}(\-[0-9A-F]{1,6})?'), + ('CDO', r'\<\!\-\-'), #"" {return CDC;} + ('S', r'{s}'),# {return S;} + + # \/\*[^*]*\*+([^/*][^*]*\*+)*\/ /* ignore comments */ + # {s}+\/\*[^*]*\*+([^/*][^*]*\*+)*\/ {unput(' '); /*replace by space*/} + + ('INCLUDES', r'\~\='), #"~=" {return INCLUDES;} + ('DASHMATCH', r'\|\='), #"|=" {return DASHMATCH;} + ('LBRACE', r'\{'), #{w}"{" {return LBRACE;} + ('PLUS', r'\+'), #{w}"+" {return PLUS;} + ('GREATER', r'\>'), #{w}">" {return GREATER;} + ('COMMA', r'\,'), #{w}"," {return COMMA;} + ('IMPORTANT_SYM', r'\!({w}|{comment})*{I}{M}{P}{O}{R}{T}{A}{N}{T}'), #"!{w}important" {return IMPORTANT_SYM;} + ('COMMENT', '\/\*[^*]*\*+([^/][^*]*\*+)*\/'), # /* ignore comments */ + ('CLASS', r'\.'), #. {return *yytext;} + + # --- CSS3! --- + ('CHAR', r'[^"\']'), + ] + +class CSSProductions(object): + pass +for i, t in enumerate(PRODUCTIONS): + setattr(CSSProductions, t[0].replace('-', '_'), t[0]) \ No newline at end of file diff --git a/libs/cssutils/cssproductions.py b/libs/cssutils/cssproductions.py new file mode 100755 index 00000000..9f7b3d80 --- /dev/null +++ b/libs/cssutils/cssproductions.py @@ -0,0 +1,124 @@ +"""productions for cssutils based on a mix of CSS 2.1 and CSS 3 Syntax +productions + +- http://www.w3.org/TR/css3-syntax +- http://www.w3.org/TR/css3-syntax/#grammar0 + +open issues + - numbers contain "-" if present + - HASH: #aaa is, #000 is not anymore, + CSS2.1: 'nmchar': r'[_a-z0-9-]|{nonascii}|{escape}', + CSS3: 'nmchar': r'[_a-z-]|{nonascii}|{escape}', +""" +__all__ = ['CSSProductions', 'MACROS', 'PRODUCTIONS'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +# a complete list of css3 macros +MACROS = { + 'nonascii': r'[^\0-\177]', + 'unicode': r'\\[0-9A-Fa-f]{1,6}(?:{nl}|{s})?', + #'escape': r'{unicode}|\\[ -~\200-\777]', + 'escape': r'{unicode}|\\[^\n\r\f0-9a-f]', + 'nmstart': r'[_a-zA-Z]|{nonascii}|{escape}', + 'nmchar': r'[-_a-zA-Z0-9]|{nonascii}|{escape}', + 'string1': r'"([^\n\r\f\\"]|\\{nl}|{escape})*"', + 'string2': r"'([^\n\r\f\\']|\\{nl}|{escape})*'", + 'invalid1': r'\"([^\n\r\f\\"]|\\{nl}|{escape})*', + 'invalid2': r"\'([^\n\r\f\\']|\\{nl}|{escape})*", + + 'comment': r'\/\*[^*]*\*+([^/][^*]*\*+)*\/', + 'ident': r'[-]?{nmstart}{nmchar}*', + 'name': r'{nmchar}+', + 'num': r'[0-9]*\.[0-9]+|[0-9]+', #r'[-]?\d+|[-]?\d*\.\d+', + 'string': r'{string1}|{string2}', + # from CSS2.1 + 'invalid': r'{invalid1}|{invalid2}', + 'url': r'[\x09\x21\x23-\x26\x28\x2a-\x7E]|{nonascii}|{escape}', + + 's': r'\t|\r|\n|\f|\x20', + 'w': r'{s}*', + 'nl': r'\n|\r\n|\r|\f', + + 'A': r'A|a|\\0{0,4}(?:41|61)(?:\r\n|[ \t\r\n\f])?', + 'B': r'B|b|\\0{0,4}(?:42|62)(?:\r\n|[ \t\r\n\f])?', + 'C': r'C|c|\\0{0,4}(?:43|63)(?:\r\n|[ \t\r\n\f])?', + 'D': r'D|d|\\0{0,4}(?:44|64)(?:\r\n|[ \t\r\n\f])?', + 'E': r'E|e|\\0{0,4}(?:45|65)(?:\r\n|[ \t\r\n\f])?', + 'F': r'F|f|\\0{0,4}(?:46|66)(?:\r\n|[ \t\r\n\f])?', + 'G': r'G|g|\\0{0,4}(?:47|67)(?:\r\n|[ \t\r\n\f])?|\\G|\\g', + 'H': r'H|h|\\0{0,4}(?:48|68)(?:\r\n|[ \t\r\n\f])?|\\H|\\h', + 'I': r'I|i|\\0{0,4}(?:49|69)(?:\r\n|[ \t\r\n\f])?|\\I|\\i', + 'K': r'K|k|\\0{0,4}(?:4b|6b)(?:\r\n|[ \t\r\n\f])?|\\K|\\k', + 'L': r'L|l|\\0{0,4}(?:4c|6c)(?:\r\n|[ \t\r\n\f])?|\\L|\\l', + 'M': r'M|m|\\0{0,4}(?:4d|6d)(?:\r\n|[ \t\r\n\f])?|\\M|\\m', + 'N': r'N|n|\\0{0,4}(?:4e|6e)(?:\r\n|[ \t\r\n\f])?|\\N|\\n', + 'O': r'O|o|\\0{0,4}(?:4f|6f)(?:\r\n|[ \t\r\n\f])?|\\O|\\o', + 'P': r'P|p|\\0{0,4}(?:50|70)(?:\r\n|[ \t\r\n\f])?|\\P|\\p', + 'R': r'R|r|\\0{0,4}(?:52|72)(?:\r\n|[ \t\r\n\f])?|\\R|\\r', + 'S': r'S|s|\\0{0,4}(?:53|73)(?:\r\n|[ \t\r\n\f])?|\\S|\\s', + 'T': r'T|t|\\0{0,4}(?:54|74)(?:\r\n|[ \t\r\n\f])?|\\T|\\t', + 'U': r'U|u|\\0{0,4}(?:55|75)(?:\r\n|[ \t\r\n\f])?|\\U|\\u', + 'V': r'V|v|\\0{0,4}(?:56|76)(?:\r\n|[ \t\r\n\f])?|\\V|\\v', + 'X': r'X|x|\\0{0,4}(?:58|78)(?:\r\n|[ \t\r\n\f])?|\\X|\\x', + 'Z': r'Z|z|\\0{0,4}(?:5a|7a)(?:\r\n|[ \t\r\n\f])?|\\Z|\\z', + } + +# The following productions are the complete list of tokens +# used by cssutils, a mix of CSS3 and some CSS2.1 productions. +# The productions are **ordered**: +PRODUCTIONS = [ + # UTF8_BOM or UTF8_BOM_SIG will only be checked at beginning of CSS + ('BOM', '\xfe\xff|\xef\xbb\xbf'), + + ('S', r'{s}+'), # 1st in list of general productions + ('URI', r'{U}{R}{L}\({w}({string}|{url}*){w}\)'), + ('FUNCTION', r'{ident}\('), + ('UNICODE-RANGE', r'{U}\+[0-9A-Fa-f?]{1,6}(\-[0-9A-Fa-f]{1,6})?'), + ('IDENT', r'{ident}'), + ('DIMENSION', r'{num}{ident}'), + ('PERCENTAGE', r'{num}\%'), + ('NUMBER', r'{num}'), + ('HASH', r'\#{name}'), + ('COMMENT', r'{comment}'), #r'\/\*[^*]*\*+([^/][^*]*\*+)*\/'), + ('STRING', r'{string}'), + ('INVALID', r'{invalid}'), # from CSS2.1 + ('ATKEYWORD', r'@{ident}'), # other keywords are done in the tokenizer + ('INCLUDES', '\~\='), + ('DASHMATCH', r'\|\='), + ('PREFIXMATCH', r'\^\='), + ('SUFFIXMATCH', r'\$\='), + ('SUBSTRINGMATCH', r'\*\='), + ('CDO', r'\<\!\-\-'), + ('CDC', r'\-\-\>'), + ('CHAR', r'[^"\']') # MUST always be last + # valid ony at start so not checked everytime + #('CHARSET_SYM', r'@charset '), # from Errata includes ending space! + # checked specially if fullsheet is parsed + ] + + + +class CSSProductions(object): + """ + most attributes are set later + """ + EOF = True + # removed from productions as they simply are ATKEYWORD until + # tokenizing + CHARSET_SYM = u'CHARSET_SYM' + FONT_FACE_SYM = u'FONT_FACE_SYM' + MEDIA_SYM = u'MEDIA_SYM' + IMPORT_SYM = u'IMPORT_SYM' + NAMESPACE_SYM = u'NAMESPACE_SYM' + PAGE_SYM = u'PAGE_SYM' + VARIABLES_SYM = u'VARIABLES_SYM' + +for i, t in enumerate(PRODUCTIONS): + setattr(CSSProductions, t[0].replace('-', '_'), t[0]) + + +# may be enabled by settings.set +_DXImageTransform = (u'FUNCTION', + ur'progid\:DXImageTransform\.Microsoft\..+\(' + ) diff --git a/libs/cssutils/errorhandler.py b/libs/cssutils/errorhandler.py new file mode 100755 index 00000000..916adff5 --- /dev/null +++ b/libs/cssutils/errorhandler.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python +"""cssutils ErrorHandler + +ErrorHandler + used as log with usual levels (debug, info, warn, error) + + if instanciated with ``raiseExceptions=True`` raises exeptions instead + of logging + +log + defaults to instance of ErrorHandler for any kind of log message from + lexerm, parser etc. + + - raiseExceptions = [False, True] + - setloglevel(loglevel) +""" +__all__ = ['ErrorHandler'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +import logging +import urllib2 +import xml.dom + +class _ErrorHandler(object): + """ + handles all errors and log messages + """ + def __init__(self, log, defaultloglevel=logging.INFO, + raiseExceptions=True): + """ + inits log if none given + + log + for parse messages, default logs to sys.stderr + defaultloglevel + if none give this is logging.DEBUG + raiseExceptions + - True: Errors will be raised e.g. during building + - False: Errors will be written to the log, this is the + default behaviour when parsing + """ + # may be disabled during setting of known valid items + self.enabled = True + + if log: + self._log = log + else: + import sys + self._log = logging.getLogger('CSSUTILS') + hdlr = logging.StreamHandler(sys.stderr) + formatter = logging.Formatter('%(levelname)s\t%(message)s') + hdlr.setFormatter(formatter) + self._log.addHandler(hdlr) + self._log.setLevel(defaultloglevel) + + self.raiseExceptions = raiseExceptions + + def __getattr__(self, name): + "use self._log items" + calls = ('debug', 'info', 'warn', 'error', 'critical', 'fatal') + other = ('setLevel', 'getEffectiveLevel', 'addHandler', 'removeHandler') + + if name in calls: + self._logcall = getattr(self._log, name) + return self.__handle + elif name in other: + return getattr(self._log, name) + else: + raise AttributeError( + '(errorhandler) No Attribute %r found' % name) + + def __handle(self, msg=u'', token=None, error=xml.dom.SyntaxErr, + neverraise=False, args=None): + """ + handles all calls + logs or raises exception + """ + if self.enabled: + if error is None: + error = xml.dom.SyntaxErr + + line, col = None, None + if token: + if isinstance(token, tuple): + value, line, col = token[1], token[2], token[3] + else: + value, line, col = token.value, token.line, token.col + msg = u'%s [%s:%s: %s]' % ( + msg, line, col, value) + + if error and self.raiseExceptions and not neverraise: + if isinstance(error, urllib2.HTTPError) or isinstance(error, urllib2.URLError): + raise + elif issubclass(error, xml.dom.DOMException): + error.line = line + error.col = col + raise error(msg) + else: + self._logcall(msg) + + def setLog(self, log): + """set log of errorhandler's log""" + self._log = log + + +class ErrorHandler(_ErrorHandler): + "Singleton, see _ErrorHandler" + instance = None + + def __init__(self, + log=None, defaultloglevel=logging.INFO, raiseExceptions=True): + + if ErrorHandler.instance is None: + ErrorHandler.instance = _ErrorHandler(log=log, + defaultloglevel=defaultloglevel, + raiseExceptions=raiseExceptions) + self.__dict__ = ErrorHandler.instance.__dict__ diff --git a/libs/cssutils/helper.py b/libs/cssutils/helper.py new file mode 100755 index 00000000..b3c55ff3 --- /dev/null +++ b/libs/cssutils/helper.py @@ -0,0 +1,137 @@ +"""cssutils helper +""" +__docformat__ = 'restructuredtext' +__version__ = '$Id: errorhandler.py 1234 2008-05-22 20:26:12Z cthedot $' + +import os +import re +import sys +import urllib + +class Deprecated(object): + """This is a decorator which can be used to mark functions + as deprecated. It will result in a warning being emitted + when the function is used. + + It accepts a single paramter ``msg`` which is shown with the warning. + It should contain information which function or method to use instead. + """ + def __init__(self, msg): + self.msg = msg + + def __call__(self, func): + def newFunc(*args, **kwargs): + import warnings + warnings.warn("Call to deprecated method %r. %s" % + (func.__name__, self.msg), + category=DeprecationWarning, + stacklevel=2) + return func(*args, **kwargs) + newFunc.__name__ = func.__name__ + newFunc.__doc__ = func.__doc__ + newFunc.__dict__.update(func.__dict__) + return newFunc + +# simple escapes, all non unicodes +_simpleescapes = re.compile(ur'(\\[^0-9a-fA-F])').sub +def normalize(x): + """ + normalizes x, namely: + + - remove any \ before non unicode sequences (0-9a-zA-Z) so for + x=="c\olor\" return "color" (unicode escape sequences should have + been resolved by the tokenizer already) + - lowercase + """ + if x: + def removeescape(matchobj): + return matchobj.group(0)[1:] + x = _simpleescapes(removeescape, x) + return x.lower() + else: + return x + +def path2url(path): + """Return file URL of `path`""" + return u'file:' + urllib.pathname2url(os.path.abspath(path)) + +def pushtoken(token, tokens): + """Return new generator starting with token followed by all tokens in + ``tokens``""" + # TODO: may use itertools.chain? + yield token + for t in tokens: + yield t + +def string(value): + """ + Serialize value with quotes e.g.:: + + ``a \'string`` => ``'a \'string'`` + """ + # \n = 0xa, \r = 0xd, \f = 0xc + value = value.replace(u'\n', u'\\a ').replace( + u'\r', u'\\d ').replace( + u'\f', u'\\c ').replace( + u'"', u'\\"') + + if value.endswith(u'\\'): + value = value[:-1] + u'\\\\' + + return u'"%s"' % value + +def stringvalue(string): + """ + Retrieve actual value of string without quotes. Escaped + quotes inside the value are resolved, e.g.:: + + ``'a \'string'`` => ``a 'string`` + """ + return string.replace(u'\\'+string[0], string[0])[1:-1] + +_match_forbidden_in_uri = re.compile(ur'''.*?[\(\)\s\;,'"]''', re.U).match +def uri(value): + """ + Serialize value by adding ``url()`` and with quotes if needed e.g.:: + + ``"`` => ``url("\"")`` + """ + if _match_forbidden_in_uri(value): + value = string(value) + return u'url(%s)' % value + +def urivalue(uri): + """ + Return actual content without surrounding "url(" and ")" + and removed surrounding quotes too including contained + escapes of quotes, e.g.:: + + ``url("\"")`` => ``"`` + """ + uri = uri[uri.find('(')+1:-1].strip() + if uri and (uri[0] in '\'"') and (uri[0] == uri[-1]): + return stringvalue(uri) + else: + return uri + +#def normalnumber(num): +# """ +# Return normalized number as string. +# """ +# sign = '' +# if num.startswith('-'): +# sign = '-' +# num = num[1:] +# elif num.startswith('+'): +# num = num[1:] +# +# if float(num) == 0.0: +# return '0' +# else: +# if num.find('.') == -1: +# return sign + str(int(num)) +# else: +# a, b = num.split('.') +# if not a: +# a = '0' +# return '%s%s.%s' % (sign, int(a), b) diff --git a/libs/cssutils/parse.py b/libs/cssutils/parse.py new file mode 100755 index 00000000..715a320a --- /dev/null +++ b/libs/cssutils/parse.py @@ -0,0 +1,232 @@ +#!/usr/bin/env python +"""A validating CSSParser""" +__all__ = ['CSSParser'] +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from helper import path2url +import codecs +import cssutils +import os +import sys +import tokenize2 +import urllib + +from cssutils import css + +if sys.version_info < (2,6): + bytes = str + +class CSSParser(object): + """Parse a CSS StyleSheet from URL, string or file and return a DOM Level 2 + CSS StyleSheet object. + + Usage:: + + parser = CSSParser() + # optionally + parser.setFetcher(fetcher) + sheet = parser.parseFile('test1.css', 'ascii') + print sheet.cssText + """ + def __init__(self, log=None, loglevel=None, raiseExceptions=None, + fetcher=None, parseComments=True, + validate=True): + """ + :param log: + logging object + :param loglevel: + logging loglevel + :param raiseExceptions: + if log should simply log (default) or raise errors during + parsing. Later while working with the resulting sheets + the setting used in cssutils.log.raiseExeptions is used + :param fetcher: + see ``setFetcher(fetcher)`` + :param parseComments: + if comments should be added to CSS DOM or simply omitted + :param validate: + if parsing should validate, may be overwritten in parse methods + """ + if log is not None: + cssutils.log.setLog(log) + if loglevel is not None: + cssutils.log.setLevel(loglevel) + + # remember global setting + self.__globalRaising = cssutils.log.raiseExceptions + if raiseExceptions: + self.__parseRaising = raiseExceptions + else: + # DEFAULT during parse + self.__parseRaising = False + + self.__tokenizer = tokenize2.Tokenizer(doComments=parseComments) + self.setFetcher(fetcher) + + self._validate = validate + + def __parseSetting(self, parse): + """during parse exceptions may be handled differently depending on + init parameter ``raiseExceptions`` + """ + if parse: + cssutils.log.raiseExceptions = self.__parseRaising + else: + cssutils.log.raiseExceptions = self.__globalRaising + + def parseStyle(self, cssText, encoding='utf-8', validate=None): + """Parse given `cssText` which is assumed to be the content of + a HTML style attribute. + + :param cssText: + CSS string to parse + :param encoding: + It will be used to decode `cssText` if given as a (byte) + string. + :param validate: + If given defines if validation is used. Uses CSSParser settings as + fallback + :returns: + :class:`~cssutils.css.CSSStyleDeclaration` + """ + self.__parseSetting(True) + if isinstance(cssText, bytes): + # TODO: use codecs.getdecoder('css') here? + cssText = cssText.decode(encoding) + if validate is None: + validate = self._validate + style = css.CSSStyleDeclaration(cssText, validating=validate) + self.__parseSetting(False) + return style + + def parseString(self, cssText, encoding=None, href=None, media=None, + title=None, + validate=None): + """Parse `cssText` as :class:`~cssutils.css.CSSStyleSheet`. + Errors may be raised (e.g. UnicodeDecodeError). + + :param cssText: + CSS string to parse + :param encoding: + If ``None`` the encoding will be read from BOM or an @charset + rule or defaults to UTF-8. + If given overrides any found encoding including the ones for + imported sheets. + It also will be used to decode `cssText` if given as a (byte) + string. + :param href: + The ``href`` attribute to assign to the parsed style sheet. + Used to resolve other urls in the parsed sheet like @import hrefs. + :param media: + The ``media`` attribute to assign to the parsed style sheet + (may be a MediaList, list or a string). + :param title: + The ``title`` attribute to assign to the parsed style sheet. + :param validate: + If given defines if validation is used. Uses CSSParser settings as + fallback + :returns: + :class:`~cssutils.css.CSSStyleSheet`. + """ + self.__parseSetting(True) + # TODO: py3 needs bytes here! + if isinstance(cssText, bytes): + cssText = codecs.getdecoder('css')(cssText, encoding=encoding)[0] + + if validate is None: + validate = self._validate + + sheet = cssutils.css.CSSStyleSheet(href=href, + media=cssutils.stylesheets.MediaList(media), + title=title, + validating=validate) + sheet._setFetcher(self.__fetcher) + # tokenizing this ways closes open constructs and adds EOF + sheet._setCssTextWithEncodingOverride(self.__tokenizer.tokenize(cssText, + fullsheet=True), + encodingOverride=encoding) + self.__parseSetting(False) + return sheet + + def parseFile(self, filename, encoding=None, + href=None, media=None, title=None, + validate=None): + """Retrieve content from `filename` and parse it. Errors may be raised + (e.g. IOError). + + :param filename: + of the CSS file to parse, if no `href` is given filename is + converted to a (file:) URL and set as ``href`` of resulting + stylesheet. + If `href` is given it is set as ``sheet.href``. Either way + ``sheet.href`` is used to resolve e.g. stylesheet imports via + @import rules. + :param encoding: + Value ``None`` defaults to encoding detection via BOM or an + @charset rule. + Other values override detected encoding for the sheet at + `filename` including any imported sheets. + :returns: + :class:`~cssutils.css.CSSStyleSheet`. + """ + if not href: + # prepend // for file URL, urllib does not do this? + #href = u'file:' + urllib.pathname2url(os.path.abspath(filename)) + href = path2url(filename) + + return self.parseString(open(filename, 'rb').read(), + encoding=encoding, # read returns a str + href=href, media=media, title=title, + validate=validate) + + def parseUrl(self, href, encoding=None, media=None, title=None, + validate=None): + """Retrieve content from URL `href` and parse it. Errors may be raised + (e.g. URLError). + + :param href: + URL of the CSS file to parse, will also be set as ``href`` of + resulting stylesheet + :param encoding: + Value ``None`` defaults to encoding detection via HTTP, BOM or an + @charset rule. + A value overrides detected encoding for the sheet at ``href`` + including any imported sheets. + :returns: + :class:`~cssutils.css.CSSStyleSheet`. + """ + encoding, enctype, text = cssutils.util._readUrl(href, + fetcher=self.__fetcher, + overrideEncoding=encoding) + if enctype == 5: + # do not use if defaulting to UTF-8 + encoding = None + + if text is not None: + return self.parseString(text, encoding=encoding, + href=href, media=media, title=title, + validate=validate) + + def setFetcher(self, fetcher=None): + """Replace the default URL fetch function with a custom one. + + :param fetcher: + A function which gets a single parameter + + ``url`` + the URL to read + + and must return ``(encoding, content)`` where ``encoding`` is the + HTTP charset normally given via the Content-Type header (which may + simply omit the charset in which case ``encoding`` would be + ``None``) and ``content`` being the string (or unicode) content. + + The Mimetype should be 'text/css' but this has to be checked by the + fetcher itself (the default fetcher emits a warning if encountering + a different mimetype). + + Calling ``setFetcher`` with ``fetcher=None`` resets cssutils + to use its default function. + """ + self.__fetcher = fetcher diff --git a/libs/cssutils/prodparser.py b/libs/cssutils/prodparser.py new file mode 100755 index 00000000..ac7825cc --- /dev/null +++ b/libs/cssutils/prodparser.py @@ -0,0 +1,733 @@ +# -*- coding: utf-8 -*- +"""Productions parser used by css and stylesheets classes to parse +test into a cssutils.util.Seq and at the same time retrieving +additional specific cssutils.util.Item objects for later use. + +TODO: + - ProdsParser + - handle EOF or STOP? + - handle unknown @rules + - handle S: maybe save to Seq? parameterized? + - store['_raw']: always? + + - Sequence: + - opt first(), naive impl for now + +""" +__all__ = ['ProdParser', 'Sequence', 'Choice', 'Prod', 'PreDef'] +__docformat__ = 'restructuredtext' +__version__ = '$Id: parse.py 1418 2008-08-09 19:27:50Z cthedot $' + +from helper import pushtoken +import cssutils +import re +import string +import sys + + +class ParseError(Exception): + """Base Exception class for ProdParser (used internally).""" + pass + +class Done(ParseError): + """Raised if Sequence or Choice is finished and no more Prods left.""" + pass + +class Exhausted(ParseError): + """Raised if Sequence or Choice is finished but token is given.""" + pass + +class Missing(ParseError): + """Raised if Sequence or Choice is not finished but no matching token given.""" + pass + +class NoMatch(ParseError): + """Raised if nothing in Sequence or Choice does match.""" + pass + + +class Choice(object): + """A Choice of productions (Sequence or single Prod).""" + + def __init__(self, *prods, **options): + """ + *prods + Prod or Sequence objects + options: + optional=False + """ + self._prods = prods + + try: + self.optional = options['optional'] + except KeyError, e: + for p in self._prods: + if p.optional: + self.optional = True + break + else: + self.optional = False + + self.reset() + + def reset(self): + """Start Choice from zero""" + self._exhausted = False + + def matches(self, token): + """Check if token matches""" + for prod in self._prods: + if prod.matches(token): + return True + return False + + def nextProd(self, token): + """ + Return: + + - next matching Prod or Sequence + - ``None`` if any Prod or Sequence is optional and no token matched + - raise ParseError if nothing matches and all are mandatory + - raise Exhausted if choice already done + + ``token`` may be None but this occurs when no tokens left.""" + if not self._exhausted: + optional = False + for x in self._prods: + if x.matches(token): + self._exhausted = True + x.reset() + return x + elif x.optional: + optional = True + else: + if not optional: + # None matched but also None is optional + raise ParseError(u'No match in %s' % self) + elif token: + raise Exhausted(u'Extra token') + + def __str__(self): + return u'Choice(%s)' % u', '.join([str(x) for x in self._prods]) + + +class Sequence(object): + """A Sequence of productions (Choice or single Prod).""" + def __init__(self, *prods, **options): + """ + *prods + Prod or Sequence objects + **options: + minmax = lambda: (1, 1) + callback returning number of times this sequence may run + """ + self._prods = prods + try: + minmax = options['minmax'] + except KeyError: + minmax = lambda: (1, 1) + + self._min, self._max = minmax() + if self._max is None: + # unlimited + try: + # py2.6/3 + self._max = sys.maxsize + except AttributeError: + # py<2.6 + self._max = sys.maxint + + self._prodcount = len(self._prods) + self.reset() + + def matches(self, token): + """Called by Choice to try to find if Sequence matches.""" + for prod in self._prods: + if prod.matches(token): + return True + try: + if not prod.optional: + break + except AttributeError: + pass + return False + + def reset(self): + """Reset this Sequence if it is nested.""" + self._roundstarted = False + self._i = 0 + self._round = 0 + + def _currentName(self): + """Return current element of Sequence, used by name""" + # TODO: current impl first only if 1st if an prod! + for prod in self._prods[self._i:]: + if not prod.optional: + return str(prod) + else: + return 'Sequence' + + optional = property(lambda self: self._min == 0) + + def nextProd(self, token): + """Return + + - next matching Prod or Choice + - raises ParseError if nothing matches + - raises Exhausted if sequence already done + """ + while self._round < self._max: + # for this round + i = self._i + round = self._round + p = self._prods[i] + if i == 0: + self._roundstarted = False + + # for next round + self._i += 1 + if self._i == self._prodcount: + self._round += 1 + self._i = 0 + + if p.matches(token): + self._roundstarted = True + # reset nested Choice or Prod to use from start + p.reset() + return p + + elif p.optional: + continue + + elif round < self._min: + raise Missing(u'Missing token for production %s' % p) + + elif not token: + if self._roundstarted: + raise Missing(u'Missing token for production %s' % p) + else: + raise Done() + + else: + raise NoMatch(u'No matching production for token') + + if token: + raise Exhausted(u'Extra token') + + def __str__(self): + return u'Sequence(%s)' % u', '.join([str(x) for x in self._prods]) + + +class Prod(object): + """Single Prod in Sequence or Choice.""" + def __init__(self, name, match, optional=False, + toSeq=None, toStore=None, + stop=False, stopAndKeep=False, + nextSor=False, mayEnd=False, + storeToken=None, + exception=None): + """ + name + name used for error reporting + match callback + function called with parameters tokentype and tokenvalue + returning True, False or raising ParseError + toSeq callback (optional) or False + calling toSeq(token, tokens) returns (type_, val) == (token[0], token[1]) + to be appended to seq else simply unaltered (type_, val) + + if False nothing is added + + toStore (optional) + key to save util.Item to store or callback(store, util.Item) + optional = False + wether Prod is optional or not + stop = False + if True stop parsing of tokens here + stopAndKeep + if True stop parsing of tokens here but return stopping + token in unused tokens + nextSor=False + next is S or other like , or / (CSSValue) + mayEnd = False + no token must follow even defined by Sequence. + Used for operator ',/ ' currently only + + storeToken = None + if True toStore saves simple token tuple and not and Item object + to store. Old style processing, TODO: resolve + + exception = None + exception to be raised in case of error, normaly SyntaxErr + """ + self._name = name + self.match = match + self.optional = optional + self.stop = stop + self.stopAndKeep = stopAndKeep + self.nextSor = nextSor + self.mayEnd = mayEnd + self.storeToken = storeToken + self.exception = exception + + def makeToStore(key): + "Return a function used by toStore." + def toStore(store, item): + "Set or append store item." + if key in store: + _v = store[key] + if not isinstance(_v, list): + store[key] = [_v] + store[key].append(item) + else: + store[key] = item + return toStore + + if toSeq or toSeq is False: + # called: seq.append(toSeq(value)) + self.toSeq = toSeq + else: + self.toSeq = lambda t, tokens: (t[0], t[1]) + + if hasattr(toStore, '__call__'): + self.toStore = toStore + elif toStore: + self.toStore = makeToStore(toStore) + else: + # always set! + self.toStore = None + + def matches(self, token): + """Return if token matches.""" + if not token: + return False + type_, val, line, col = token + return self.match(type_, val) + + def reset(self): + pass + + def __str__(self): + return self._name + + def __repr__(self): + return "" % ( + self.__class__.__name__, self._name, id(self)) + + +# global tokenizer as there is only one! +tokenizer = cssutils.tokenize2.Tokenizer() + +class ProdParser(object): + """Productions parser.""" + def __init__(self, clear=True): + self.types = cssutils.cssproductions.CSSProductions + self._log = cssutils.log + if clear: + tokenizer.clear() + + def _texttotokens(self, text): + """Build a generator which is the only thing that is parsed! + old classes may use lists etc + """ + if isinstance(text, basestring): + # DEFAULT, to tokenize strip space + return tokenizer.tokenize(text.strip()) + + elif isinstance(text, tuple): + # OLD: (token, tokens) or a single token + if len(text) == 2: + # (token, tokens) + chain([token], tokens) + else: + # single token + return iter([text]) + + elif isinstance(text, list): + # OLD: generator from list + return iter(text) + + else: + # DEFAULT, already tokenized, assume generator + return text + + def _SorTokens(self, tokens, until=',/'): + """New tokens generator which has S tokens removed, + if followed by anything in ``until``, normally a ``,``.""" + for token in tokens: + if token[0] == self.types.S: + try: + next_ = tokens.next() + except StopIteration: + yield token + else: + if next_[1] in until: + # omit S as e.g. ``,`` has been found + yield next_ + elif next_[0] == self.types.COMMENT: + # pass COMMENT + yield next_ + else: + yield token + yield next_ + + elif token[0] == self.types.COMMENT: + # pass COMMENT + yield token + else: + yield token + break + # normal mode again + for token in tokens: + yield token + + + def parse(self, text, name, productions, keepS=False, store=None): + """ + text (or token generator) + to parse, will be tokenized if not a generator yet + + may be: + - a string to be tokenized + - a single token, a tuple + - a tuple of (token, tokensGenerator) + - already tokenized so a tokens generator + + name + used for logging + productions + used to parse tokens + keepS + if WS should be added to Seq or just be ignored + store UPDATED + If a Prod defines ``toStore`` the key defined there + is a key in store to be set or if store[key] is a list + the next Item is appended here. + + TODO: NEEDED? : + Key ``raw`` is always added and holds all unprocessed + values found + + returns + :wellformed: True or False + :seq: a filled cssutils.util.Seq object which is NOT readonly yet + :store: filled keys defined by Prod.toStore + :unusedtokens: token generator containing tokens not used yet + """ + tokens = self._texttotokens(text) + if not tokens: + self._log.error(u'No content to parse.') + # TODO: return??? + + seq = cssutils.util.Seq(readonly=False) + if not store: # store for specific values + store = {} + prods = [productions] # stack of productions + wellformed = True + + # while no real token is found any S are ignored + started = False + stopall = False + prod = None + # flag if default S handling should be done + defaultS = True + while True: + try: + token = tokens.next() + except StopIteration: + break + type_, val, line, col = token + + # default productions + if type_ == self.types.COMMENT: + # always append COMMENT + seq.append(cssutils.css.CSSComment(val), + cssutils.css.CSSComment, line, col) + elif defaultS and type_ == self.types.S: + # append S (but ignore starting ones) + if not keepS or not started: + continue + else: + seq.append(val, type_, line, col) +# elif type_ == self.types.ATKEYWORD: +# # @rule +# r = cssutils.css.CSSUnknownRule(cssText=val) +# seq.append(r, type(r), line, col) + elif type_ == self.types.INVALID: + # invalidate parse + wellformed = False + self._log.error(u'Invalid token: %r' % (token,)) + break + elif type_ == 'EOF': + # do nothing? (self.types.EOF == True!) + pass + else: + started = True # check S now + nextSor = False # reset + + try: + while True: + # find next matching production + try: + prod = prods[-1].nextProd(token) + except (Exhausted, NoMatch), e: + # try next + prod = None + if isinstance(prod, Prod): + # found actual Prod, not a Choice or Sequence + break + elif prod: + # nested Sequence, Choice + prods.append(prod) + else: + # nested exhausted, try in parent + if len(prods) > 1: + prods.pop() + else: + raise ParseError('No match') + except ParseError, e: + wellformed = False + self._log.error(u'%s: %s: %r' % (name, e, token)) + break + else: + # process prod + if prod.toSeq and not prod.stopAndKeep: + type_, val = prod.toSeq(token, tokens) + if val is not None: + seq.append(val, type_, line, col) + if prod.toStore: + if not prod.storeToken: + prod.toStore(store, seq[-1]) + else: + # workaround for now for old style token + # parsing! + # TODO: remove when all new style + prod.toStore(store, token) + + if prod.stop: # EOF? + # stop here and ignore following tokens + break + + if prod.stopAndKeep: # e.g. ; + # stop here and ignore following tokens + # but keep this token for next run + tokenizer.push(token) + stopall = True + break + + if prod.nextSor: + # following is S or other token (e.g. ",")? + # remove S if + tokens = self._SorTokens(tokens, ',/') + defaultS = False + else: + defaultS = True + + lastprod = prod + + if not stopall: + # stop immediately + while True: + # all productions exhausted? + try: + prod = prods[-1].nextProd(token=None) + except Done, e: + # ok + prod = None + + except Missing, e: + prod = None + # last was a S operator which may End a Sequence, then ok + if hasattr(lastprod, 'mayEnd') and not lastprod.mayEnd: + wellformed = False + self._log.error(u'%s: %s' % (name, e)) + + except ParseError, e: + prod = None + wellformed = False + self._log.error(u'%s: %s' % (name, e)) + + else: + if prods[-1].optional: + prod = None + elif prod and prod.optional: + # ignore optional + continue + + if prod and not prod.optional: + wellformed = False + self._log.error(u'%s: Missing token for production %r' + % (name, str(prod))) + break + elif len(prods) > 1: + # nested exhausted, next in parent + prods.pop() + else: + break + + # trim S from end + seq.rstrip() + return wellformed, seq, store, tokens + + +class PreDef(object): + """Predefined Prod definition for use in productions definition + for ProdParser instances. + """ + types = cssutils.cssproductions.CSSProductions + reHexcolor = re.compile(r'^\#(?:[0-9abcdefABCDEF]{3}|[0-9abcdefABCDEF]{6})$') + + @staticmethod + def calc(toSeq=None, nextSor=False): + return Prod(name=u'calcfunction', + match=lambda t, v: u'calc(' == cssutils.helper.normalize(v), + toSeq=toSeq, + nextSor=nextSor) + + @staticmethod + def char(name='char', char=u',', toSeq=None, + stop=False, stopAndKeep=False, + optional=True, nextSor=False): + "any CHAR" + return Prod(name=name, match=lambda t, v: v == char, toSeq=toSeq, + stop=stop, stopAndKeep=stopAndKeep, optional=optional, + nextSor=nextSor) + + @staticmethod + def comma(): + return PreDef.char(u'comma', u',') + + @staticmethod + def dimension(nextSor=False, stop=False): + return Prod(name=u'dimension', + match=lambda t, v: t == PreDef.types.DIMENSION, + toSeq=lambda t, tokens: (t[0], cssutils.helper.normalize(t[1])), + stop=stop, + nextSor=nextSor) + + @staticmethod + def function(toSeq=None, nextSor=False): + return Prod(name=u'function', + match=lambda t, v: t == PreDef.types.FUNCTION, + toSeq=toSeq, + nextSor=nextSor) + + @staticmethod + def funcEnd(stop=False): + ")" + return PreDef.char(u'end FUNC ")"', u')', + stop=stop) + + @staticmethod + def hexcolor(stop=False, nextSor=False): + "#123 or #123456" + return Prod(name='HEX color', + match=lambda t, v: ( + t == PreDef.types.HASH and + PreDef.reHexcolor.match(v) + ), + stop=stop, + nextSor=nextSor) + + @staticmethod + def ident(stop=False, toStore=None, nextSor=False): + return Prod(name=u'ident', + match=lambda t, v: t == PreDef.types.IDENT, + stop=stop, + toStore=toStore, + nextSor=nextSor) + + @staticmethod + def number(stop=False, toSeq=None, nextSor=False): + return Prod(name=u'number', + match=lambda t, v: t == PreDef.types.NUMBER, + stop=stop, + toSeq=toSeq, + nextSor=nextSor) + + @staticmethod + def percentage(stop=False, toSeq=None, nextSor=False): + return Prod(name=u'percentage', + match=lambda t, v: t == PreDef.types.PERCENTAGE, + stop=stop, + toSeq=toSeq, + nextSor=nextSor) + + @staticmethod + def string(stop=False, nextSor=False): + "string delimiters are removed by default" + return Prod(name=u'string', + match=lambda t, v: t == PreDef.types.STRING, + toSeq=lambda t, tokens: (t[0], cssutils.helper.stringvalue(t[1])), + stop=stop, + nextSor=nextSor) + + @staticmethod + def S(name=u'whitespace', toSeq=None, optional=False): + return Prod(name=name, + match=lambda t, v: t == PreDef.types.S, + toSeq=toSeq, + optional=optional, + mayEnd=True) + + @staticmethod + def unary(stop=False, toSeq=None, nextSor=False): + "+ or -" + return Prod(name=u'unary +-', match=lambda t, v: v in (u'+', u'-'), + optional=True, + stop=stop, + toSeq=toSeq, + nextSor=nextSor) + + @staticmethod + def uri(stop=False, nextSor=False): + "'url(' and ')' are removed and URI is stripped" + return Prod(name=u'URI', + match=lambda t, v: t == PreDef.types.URI, + toSeq=lambda t, tokens: (t[0], cssutils.helper.urivalue(t[1])), + stop=stop, + nextSor=nextSor) + + @staticmethod + def unicode_range(stop=False, nextSor=False): + "u+123456-abc normalized to lower `u`" + return Prod(name='unicode-range', + match=lambda t, v: t == PreDef.types.UNICODE_RANGE, + toSeq=lambda t, tokens: (t[0], t[1].lower()), + stop=stop, + nextSor=nextSor + ) + + @staticmethod + def variable(toSeq=None, stop=False, nextSor=False): + return Prod(name=u'variable', + match=lambda t, v: u'var(' == cssutils.helper.normalize(v), + toSeq=toSeq, + stop=stop, + nextSor=nextSor) + + # used for MarginRule for now: + @staticmethod + def unknownrule(name=u'@', toStore=None): + """@rule dummy (matches ATKEYWORD to remove unknown rule tokens from + stream:: + + @x; + @x {...} + + no nested yet! + """ + def rule(tokens): + saved = [] + for t in tokens: + saved.append(t) + if (t[1] == u'}' or t[1] == u';'): + return cssutils.css.CSSUnknownRule(saved) + + return Prod(name=name, + match=lambda t, v: t == u'ATKEYWORD', + toSeq=lambda t, tokens: (u'CSSUnknownRule', + rule(pushtoken(t, tokens)) + ), + toStore=toStore + ) diff --git a/libs/cssutils/profiles.py b/libs/cssutils/profiles.py new file mode 100755 index 00000000..57c63bd4 --- /dev/null +++ b/libs/cssutils/profiles.py @@ -0,0 +1,791 @@ +"""CSS profiles. + +Profiles is based on code by Kevin D. Smith, orginally used as cssvalues, +thanks! +""" +__all__ = ['Profiles'] +__docformat__ = 'restructuredtext' +__version__ = '$Id: cssproperties.py 1116 2008-03-05 13:52:23Z cthedot $' + +import re +import types + +class NoSuchProfileException(Exception): + """Raised if no profile with given name is found""" + pass + + +# dummies, replaced in Profiles.addProfile +_fontRegexReplacements = { + '__FONT_FAMILY_SINGLE': lambda f: False, + '__FONT_WITH_1_FAMILY': lambda f: False + } + +def _fontFamilyValidator(families): + """Check if ``font-family`` value is valid, regex is too slow. + + Splits on ``,`` and checks each family separately. + Somehow naive as font-family name could contain a "," but this is unlikely. + Still should be a TODO. + """ + match = _fontRegexReplacements['__FONT_FAMILY_SINGLE'] + + for f in families.split(u','): + if not match(f.strip()): + return False + return True + +def _fontValidator(font): + """Check if font value is valid, regex is too slow. + + Checks everything before ``,`` on basic font value. Everything after should + be a valid font-family value. + """ + if u',' in font: + # split off until 1st family + font1, families2 = font.split(u',', 1) + else: + font1, families2 = font, None + + if not _fontRegexReplacements['__FONT_WITH_1_FAMILY'](font1.strip()): + return False + + if families2 and not _fontFamilyValidator(families2): + return False + + return True + + +class Profiles(object): + """ + All profiles used for validation. ``cssutils.profile`` is a + preset object of this class and used by all properties for validation. + + Predefined profiles are (use + :meth:`~cssutils.profiles.Profiles.propertiesByProfile` to + get a list of defined properties): + + :attr:`~cssutils.profiles.Profiles.CSS_LEVEL_2` + Properties defined by CSS2.1 + :attr:`~cssutils.profiles.Profiles.CSS3_BASIC_USER_INTERFACE` + Currently resize and outline properties only + :attr:`~cssutils.profiles.Profiles.CSS3_BOX` + Currently overflow related properties only + :attr:`~cssutils.profiles.Profiles.CSS3_COLOR` + CSS 3 color properties + :attr:`~cssutils.profiles.Profiles.CSS3_PAGED_MEDIA` + As defined at http://www.w3.org/TR/css3-page/ (at 090307) + + Predefined macros are: + + :attr:`~cssutils.profiles.Profiles._TOKEN_MACROS` + Macros containing the token values as defined to CSS2 + :attr:`~cssutils.profiles.Profiles._MACROS` + Additional general macros. + + If you want to redefine any of these macros do this in your custom + macros. + """ + CSS_LEVEL_2 = u'CSS Level 2.1' + CSS3_BACKGROUNDS_AND_BORDERS = u'CSS Backgrounds and Borders Module Level 3' + CSS3_BASIC_USER_INTERFACE = u'CSS3 Basic User Interface Module' + CSS3_BOX = CSS_BOX_LEVEL_3 = u'CSS Box Module Level 3' + CSS3_COLOR = CSS_COLOR_LEVEL_3 = u'CSS Color Module Level 3' + CSS3_FONTS = u'CSS Fonts Module Level 3' + CSS3_FONT_FACE = u'CSS Fonts Module Level 3 @font-face properties' + CSS3_PAGED_MEDIA = u'CSS3 Paged Media Module' + CSS3_TEXT = u'CSS Text Level 3' + + _TOKEN_MACROS = { + 'ident': r'[-]?{nmstart}{nmchar}*', + 'name': r'{nmchar}+', + 'nmstart': r'[_a-z]|{nonascii}|{escape}', + 'nonascii': r'[^\0-\177]', + 'unicode': r'\\[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])?', + 'escape': r'{unicode}|\\[ -~\200-\777]', + # 'escape': r'{unicode}|\\[ -~\200-\4177777]', + 'int': r'[-]?\d+', + 'nmchar': r'[\w-]|{nonascii}|{escape}', + 'num': r'[-]?\d+|[-]?\d*\.\d+', + 'positivenum': r'\d+|\d*\.\d+', + 'number': r'{num}', + 'string': r'{string1}|{string2}', + 'string1': r'"(\\\"|[^\"])*"', + 'uri': r'url\({w}({string}|(\\\)|[^\)])+){w}\)', + 'string2': r"'(\\\'|[^\'])*'", + 'nl': r'\n|\r\n|\r|\f', + 'w': r'\s*', + } + _MACROS = { + 'hexcolor': r'#[0-9a-f]{3}|#[0-9a-f]{6}', + 'rgbcolor': r'rgb\({w}{int}{w}\,{w}{int}{w}\,{w}{int}{w}\)|rgb\({w}{num}%{w}\,{w}{num}%{w}\,{w}{num}%{w}\)', + 'namedcolor': r'(transparent|orange|maroon|red|orange|yellow|olive|purple|fuchsia|white|lime|green|navy|blue|aqua|teal|black|silver|gray)', + 'uicolor': r'(ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText)', + 'color': r'{namedcolor}|{hexcolor}|{rgbcolor}|{uicolor}', + #'color': r'(maroon|red|orange|yellow|olive|purple|fuchsia|white|lime|green|navy|blue|aqua|teal|black|silver|gray|ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText)|#[0-9a-f]{3}|#[0-9a-f]{6}|rgb\({w}{int}{w},{w}{int}{w},{w}{int}{w}\)|rgb\({w}{num}%{w},{w}{num}%{w},{w}{num}%{w}\)', + 'integer': r'{int}', + 'length': r'0|{num}(em|ex|px|in|cm|mm|pt|pc)', + 'positivelength': r'0|{positivenum}(em|ex|px|in|cm|mm|pt|pc)', + 'angle': r'0|{num}(deg|grad|rad)', + 'time': r'0|{num}m?s', + 'frequency': r'0|{num}k?Hz', + 'percentage': r'{num}%', + 'shadow': '(inset)?{w}{length}{w}{length}{w}{length}?{w}{length}?{w}{color}?' + } + + def __init__(self, log=None): + """A few profiles are predefined.""" + self._log = log + + # macro cache + self._usedMacros = Profiles._TOKEN_MACROS.copy() + self._usedMacros.update(Profiles._MACROS.copy()) + + # to keep order, REFACTOR! + self._profileNames = [] + # for reset if macro changes + self._rawProfiles = {} + # already compiled profiles: {profile: {property: checkfunc, ...}, ...} + self._profilesProperties = {} + + self._defaultProfiles = None + + self.addProfiles([(self.CSS_LEVEL_2, + properties[self.CSS_LEVEL_2], + macros[self.CSS_LEVEL_2] + ), + (self.CSS3_BACKGROUNDS_AND_BORDERS, + properties[self.CSS3_BACKGROUNDS_AND_BORDERS], + macros[self.CSS3_BACKGROUNDS_AND_BORDERS] + ), + (self.CSS3_BASIC_USER_INTERFACE, + properties[self.CSS3_BASIC_USER_INTERFACE], + macros[self.CSS3_BASIC_USER_INTERFACE] + ), + (self.CSS3_BOX, + properties[self.CSS3_BOX], + macros[self.CSS3_BOX] + ), + (self.CSS3_COLOR, + properties[self.CSS3_COLOR], + macros[self.CSS3_COLOR] + ), + (self.CSS3_FONTS, + properties[self.CSS3_FONTS], + macros[self.CSS3_FONTS] + ), + # new object for font-face only? + (self.CSS3_FONT_FACE, + properties[self.CSS3_FONT_FACE], + macros[self.CSS3_FONTS] + ), + (self.CSS3_PAGED_MEDIA, + properties[self.CSS3_PAGED_MEDIA], + macros[self.CSS3_PAGED_MEDIA] + ), + (self.CSS3_TEXT, + properties[self.CSS3_TEXT], + macros[self.CSS3_TEXT] + ) + ]) + + self.__update_knownNames() + + def _expand_macros(self, dictionary, macros): + """Expand macros in token dictionary""" + def macro_value(m): + return '(?:%s)' % macros[m.groupdict()['macro']] + + for key, value in dictionary.items(): + if not hasattr(value, '__call__'): + while re.search(r'{[a-z][a-z0-9-]*}', value): + value = re.sub(r'{(?P[a-z][a-z0-9-]*)}', + macro_value, value) + dictionary[key] = value + + return dictionary + + def _compile_regexes(self, dictionary): + """Compile all regular expressions into callable objects""" + for key, value in dictionary.items(): + # might be a function (font-family) as regex is too slow + if not hasattr(value, '__call__') and not isinstance(value, + types.FunctionType): + value = re.compile('^(?:%s)$' % value, re.I).match + dictionary[key] = value + + return dictionary + + def __update_knownNames(self): + self._knownNames = [] + for properties in self._profilesProperties.values(): + self._knownNames.extend(properties.keys()) + + def _getDefaultProfiles(self): + "If not explicitly set same as Profiles.profiles but in reverse order." + if not self._defaultProfiles: + return self.profiles + else: + return self._defaultProfiles + + def _setDefaultProfiles(self, profiles): + "profiles may be a single or a list of profile names" + if isinstance(profiles, basestring): + self._defaultProfiles = (profiles,) + else: + self._defaultProfiles = profiles + + defaultProfiles = property(_getDefaultProfiles, + _setDefaultProfiles, + doc=u"Names of profiles to use for validation." + u"To use e.g. the CSS2 profile set " + u"``cssutils.profile.defaultProfiles = " + u"cssutils.profile.CSS_LEVEL_2``") + + profiles = property(lambda self: self._profileNames, + doc=u'Names of all profiles in order as defined.') + + knownNames = property(lambda self: self._knownNames, + doc="All known property names of all profiles.") + + def _resetProperties(self, newMacros=None): + "reset all props from raw values as changes in macros happened" + # base + macros = Profiles._TOKEN_MACROS.copy() + macros.update(Profiles._MACROS.copy()) + + # former + for profile in self._profileNames: + macros.update(self._rawProfiles[profile]['macros']) + + # new + if newMacros: + macros.update(newMacros) + + # reset properties + self._profilesProperties.clear() + for profile in self._profileNames: + properties = self._expand_macros( + # keep raw + self._rawProfiles[profile]['properties'].copy(), + macros) + self._profilesProperties[profile] = self._compile_regexes(properties) + + # save + self._usedMacros = macros + + + def addProfiles(self, profiles): + """Add a list of profiles at once. Useful as if profiles define custom + macros these are used in one go. Using `addProfile` instead my be + **very** slow instead. + """ + # add macros + for profile, properties, macros in profiles: + if macros: + self._usedMacros.update(macros) + self._rawProfiles[profile] = {'macros': macros.copy()} + + # only add new properties + for profile, properties, macros in profiles: + self.addProfile(profile, properties.copy(), None) + + + def addProfile(self, profile, properties, macros=None): + """Add a new profile with name `profile` (e.g. 'CSS level 2') + and the given `properties`. + + :param profile: + the new `profile`'s name + :param properties: + a dictionary of ``{ property-name: propery-value }`` items where + property-value is a regex which may use macros defined in given + ``macros`` or the standard macros Profiles.tokens and + Profiles.generalvalues. + + ``propery-value`` may also be a function which takes a single + argument which is the value to validate and which should return + True or False. + Any exceptions which may be raised during this custom validation + are reported or raised as all other cssutils exceptions depending + on cssutils.log.raiseExceptions which e.g during parsing normally + is False so the exceptions would be logged only. + :param macros: + may be used in the given properties definitions. There are some + predefined basic macros which may always be used in + :attr:`Profiles._TOKEN_MACROS` and :attr:`Profiles._MACROS`. + """ + if macros: + # check if known macros would change and if yes reset properties + if len(set(macros.keys()).intersection(self._usedMacros.keys())): + self._resetProperties(newMacros=macros) + + else: + # no replacement, simply continue + self._usedMacros.update(macros) + + else: + # might have been set by addProfiles before + try: + macros = self._rawProfiles[profile]['macros'] + except KeyError, e: + macros = {} + + # save name and raw props/macros if macros change to completely reset + self._profileNames.append(profile) + self._rawProfiles[profile] = {'properties': properties.copy(), + 'macros': macros.copy()} + # prepare and save properties + properties = self._expand_macros(properties, self._usedMacros) + self._profilesProperties[profile] = self._compile_regexes(properties) + + self.__update_knownNames() + + # hack for font and font-family which are too slow with regexes + if '__FONT_WITH_1_FAMILY' in properties: + _fontRegexReplacements['__FONT_WITH_1_FAMILY'] = properties['__FONT_WITH_1_FAMILY'] + if '__FONT_FAMILY_SINGLE' in properties: + _fontRegexReplacements['__FONT_FAMILY_SINGLE'] = properties['__FONT_FAMILY_SINGLE'] + + + def removeProfile(self, profile=None, all=False): + """Remove `profile` or remove `all` profiles. + + If the removed profile used custom macros all remaining profiles + are reset to reflect the macro changes. This may be quite an expensive + operation! + + :param profile: + profile name to remove + :param all: + if ``True`` removes all profiles to start with a clean state + :exceptions: + - :exc:`cssutils.profiles.NoSuchProfileException`: + If given `profile` cannot be found. + """ + if all: + self._profilesProperties.clear() + self._rawProfiles.clear() + del self._profileNames[:] + else: + reset = False + + try: + if (self._rawProfiles[profile]['macros']): + reset = True + + del self._profilesProperties[profile] + del self._rawProfiles[profile] + del self._profileNames[self._profileNames.index(profile)] + except KeyError: + raise NoSuchProfileException(u'No profile %r.' % profile) + + else: + if reset: + # reset properties as macros were removed + self._resetProperties() + + self.__update_knownNames() + + def propertiesByProfile(self, profiles=None): + """Generator: Yield property names, if no `profiles` is given all + profile's properties are used. + + :param profiles: + a single profile name or a list of names. + """ + if not profiles: + profiles = self.profiles + elif isinstance(profiles, basestring): + profiles = (profiles, ) + try: + for profile in sorted(profiles): + for name in sorted(self._profilesProperties[profile].keys()): + yield name + except KeyError, e: + raise NoSuchProfileException(e) + + def validate(self, name, value): + """Check if `value` is valid for given property `name` using **any** + profile. + + :param name: + a property name + :param value: + a CSS value (string) + :returns: + if the `value` is valid for the given property `name` in any + profile + """ + for profile in self.profiles: + if name in self._profilesProperties[profile]: + try: + # custom validation errors are caught + r = bool(self._profilesProperties[profile][name](value)) + except Exception, e: + # TODO: more specific exception? + # Validate should not be fatal though! + self._log.error(e, error=Exception) + r = False + if r: + return r + return False + + def validateWithProfile(self, name, value, profiles=None): + """Check if `value` is valid for given property `name` returning + ``(valid, profile)``. + + :param name: + a property name + :param value: + a CSS value (string) + :param profiles: + internal parameter used by Property.validate only + :returns: + ``valid, matching, profiles`` where ``valid`` is if the `value` + is valid for the given property `name` in any profile, + ``matching==True`` if it is valid in the given `profiles` + and ``profiles`` the profile names for which the value is valid + (or ``[]`` if not valid at all) + + Example:: + + >>> cssutils.profile.defaultProfiles = cssutils.profile.CSS_LEVEL_2 + >>> print cssutils.profile.validateWithProfile('color', 'rgba(1,1,1,1)') + (True, False, Profiles.CSS3_COLOR) + """ + if name not in self.knownNames: + return False, False, [] + else: + if not profiles: + profiles = self.defaultProfiles + elif isinstance(profiles, basestring): + profiles = (profiles, ) + for profilename in reversed(profiles): + # check given profiles + if name in self._profilesProperties[profilename]: + validate = self._profilesProperties[profilename][name] + try: + if validate(value): + return True, True, [profilename] + except Exception, e: + self._log.error(e, error=Exception) + + for profilename in (p for p in self._profileNames + if p not in profiles): + # check remaining profiles as well + if name in self._profilesProperties[profilename]: + validate = self._profilesProperties[profilename][name] + try: + if validate(value): + return True, False, [profilename] + except Exception, e: + self._log.error(e, error=Exception) + + names = [] + for profilename, properties in self._profilesProperties.items(): + # return profile to which name belongs + if name in properties.keys(): + names.append(profilename) + names.sort() + return False, False, names + + +properties = {} +macros = {} + + +""" +Define some regular expression fragments that will be used as +macros within the CSS property value regular expressions. +""" +macros[Profiles.CSS_LEVEL_2] = { + 'background-color': r'{color}|transparent|inherit', + 'background-image': r'{uri}|none|inherit', + #'background-position': r'({percentage}|{length})(\s*({percentage}|{length}))?|((top|center|bottom)\s*(left|center|right)?)|((left|center|right)\s*(top|center|bottom)?)|inherit', + 'background-position': r'({percentage}|{length}|left|center|right)(\s*({percentage}|{length}|top|center|bottom))?|((top|center|bottom)\s*(left|center|right)?)|((left|center|right)\s*(top|center|bottom)?)|inherit', + 'background-repeat': r'repeat|repeat-x|repeat-y|no-repeat|inherit', + 'background-attachment': r'scroll|fixed|inherit', + 'shape': r'rect\(({w}({length}|auto}){w},){3}{w}({length}|auto){w}\)', + 'counter': r'counter\({w}{ident}{w}(?:,{w}{list-style-type}{w})?\)', + 'identifier': r'{ident}', + 'family-name': r'{string}|{ident}({w}{ident})*', + 'generic-family': r'serif|sans-serif|cursive|fantasy|monospace', + 'absolute-size': r'(x?x-)?(small|large)|medium', + 'relative-size': r'smaller|larger', + + #[[ | ] [, | ]* ] | inherit + #'font-family': r'(({family-name}|{generic-family})({w},{w}({family-name}|{generic-family}))*)|inherit', + # EXTREMELY SLOW REGEX + #'font-family': r'({family-name}({w},{w}{family-name})*)|inherit', + + 'font-size': r'{absolute-size}|{relative-size}|{positivelength}|{percentage}|inherit', + 'font-style': r'normal|italic|oblique|inherit', + 'font-variant': r'normal|small-caps|inherit', + 'font-weight': r'normal|bold|bolder|lighter|[1-9]00|inherit', + 'line-height': r'normal|{number}|{length}|{percentage}|inherit', + 'list-style-image': r'{uri}|none|inherit', + 'list-style-position': r'inside|outside|inherit', + 'list-style-type': r'disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-(latin|alpha)|upper-(latin|alpha)|armenian|georgian|none|inherit', + 'margin-width': r'{length}|{percentage}|auto', + 'padding-width': r'{length}|{percentage}', + 'specific-voice': r'{ident}', + 'generic-voice': r'male|female|child', + 'content': r'{string}|{uri}|{counter}|attr\({w}{ident}{w}\)|open-quote|close-quote|no-open-quote|no-close-quote', + 'background-attrs': r'{background-color}|{background-image}|{background-repeat}|{background-attachment}|{background-position}', + 'list-attrs': r'{list-style-type}|{list-style-position}|{list-style-image}', + 'font-attrs': r'{font-style}|{font-variant}|{font-weight}', + 'text-attrs': r'underline|overline|line-through|blink', + 'overflow': r'visible|hidden|scroll|auto|inherit', +} + +""" +Define the regular expressions for validation all CSS values +""" +properties[Profiles.CSS_LEVEL_2] = { + 'azimuth': r'{angle}|(behind\s+)?(left-side|far-left|left|center-left|center|center-right|right|far-right|right-side)(\s+behind)?|behind|leftwards|rightwards|inherit', + 'background-attachment': r'{background-attachment}', + 'background-color': r'{background-color}', + 'background-image': r'{background-image}', + 'background-position': r'{background-position}', + 'background-repeat': r'{background-repeat}', + # Each piece should only be allowed one time + 'background': r'{background-attrs}(\s+{background-attrs})*|inherit', + 'border-collapse': r'collapse|separate|inherit', + 'border-spacing': r'{length}(\s+{length})?|inherit', + 'bottom': r'{length}|{percentage}|auto|inherit', + 'caption-side': r'top|bottom|inherit', + 'clear': r'none|left|right|both|inherit', + 'clip': r'{shape}|auto|inherit', + 'color': r'{color}|inherit', + 'content': r'none|normal|{content}(\s+{content})*|inherit', + 'counter-increment': r'({ident}(\s+{integer})?)(\s+({ident}(\s+{integer})?))*|none|inherit', + 'counter-reset': r'({ident}(\s+{integer})?)(\s+({ident}(\s+{integer})?))*|none|inherit', + 'cue-after': r'{uri}|none|inherit', + 'cue-before': r'{uri}|none|inherit', + 'cue': r'({uri}|none|inherit){1,2}|inherit', + #'cursor': r'((({uri}{w},{w})*)?(auto|crosshair|default|pointer|move|(e|ne|nw|n|se|sw|s|w)-resize|text|wait|help|progress))|inherit', + 'direction': r'ltr|rtl|inherit', + 'display': r'inline|block|list-item|run-in|inline-block|table|inline-table|table-row-group|table-header-group|table-footer-group|table-row|table-column-group|table-column|table-cell|table-caption|none|inherit', + 'elevation': r'{angle}|below|level|above|higher|lower|inherit', + 'empty-cells': r'show|hide|inherit', + 'float': r'left|right|none|inherit', + + # regex too slow: + # 'font-family': r'{font-family}', + 'font-family': _fontFamilyValidator, + '__FONT_FAMILY_SINGLE': r'{family-name}', + + 'font-size': r'{font-size}', + 'font-style': r'{font-style}', + 'font-variant': r'{font-variant}', + 'font-weight': r'{font-weight}', + + # regex too slow and wrong too: + # 'font': r'({font-attrs}\s+)*{font-size}({w}/{w}{line-height})?\s+{font-family}|caption|icon|menu|message-box|small-caption|status-bar|inherit', + 'font': _fontValidator, + '__FONT_WITH_1_FAMILY': r'(({font-attrs}\s+)*{font-size}({w}/{w}{line-height})?\s+{family-name})|caption|icon|menu|message-box|small-caption|status-bar|inherit', + + 'height': r'{length}|{percentage}|auto|inherit', + 'left': r'{length}|{percentage}|auto|inherit', + 'letter-spacing': r'normal|{length}|inherit', + 'line-height': r'{line-height}', + 'list-style-image': r'{list-style-image}', + 'list-style-position': r'{list-style-position}', + 'list-style-type': r'{list-style-type}', + 'list-style': r'{list-attrs}(\s+{list-attrs})*|inherit', + 'margin-right': r'{margin-width}|inherit', + 'margin-left': r'{margin-width}|inherit', + 'margin-top': r'{margin-width}|inherit', + 'margin-bottom': r'{margin-width}|inherit', + 'margin': r'{margin-width}(\s+{margin-width}){0,3}|inherit', + 'max-height': r'{length}|{percentage}|none|inherit', + 'max-width': r'{length}|{percentage}|none|inherit', + 'min-height': r'{length}|{percentage}|none|inherit', + 'min-width': r'{length}|{percentage}|none|inherit', + 'orphans': r'{integer}|inherit', + 'overflow': r'{overflow}', + 'padding-top': r'{padding-width}|inherit', + 'padding-right': r'{padding-width}|inherit', + 'padding-bottom': r'{padding-width}|inherit', + 'padding-left': r'{padding-width}|inherit', + 'padding': r'{padding-width}(\s+{padding-width}){0,3}|inherit', + 'page-break-after': r'auto|always|avoid|left|right|inherit', + 'page-break-before': r'auto|always|avoid|left|right|inherit', + 'page-break-inside': r'avoid|auto|inherit', + 'pause-after': r'{time}|{percentage}|inherit', + 'pause-before': r'{time}|{percentage}|inherit', + 'pause': r'({time}|{percentage}){1,2}|inherit', + 'pitch-range': r'{number}|inherit', + 'pitch': r'{frequency}|x-low|low|medium|high|x-high|inherit', + 'play-during': r'{uri}(\s+(mix|repeat))*|auto|none|inherit', + 'position': r'static|relative|absolute|fixed|inherit', + 'quotes': r'({string}\s+{string})(\s+{string}\s+{string})*|none|inherit', + 'richness': r'{number}|inherit', + 'right': r'{length}|{percentage}|auto|inherit', + 'speak-header': r'once|always|inherit', + 'speak-numeral': r'digits|continuous|inherit', + 'speak-punctuation': r'code|none|inherit', + 'speak': r'normal|none|spell-out|inherit', + 'speech-rate': r'{number}|x-slow|slow|medium|fast|x-fast|faster|slower|inherit', + 'stress': r'{number}|inherit', + 'table-layout': r'auto|fixed|inherit', + 'text-align': r'left|right|center|justify|inherit', + 'text-decoration': r'none|{text-attrs}(\s+{text-attrs})*|inherit', + 'text-indent': r'{length}|{percentage}|inherit', + 'text-transform': r'capitalize|uppercase|lowercase|none|inherit', + 'top': r'{length}|{percentage}|auto|inherit', + 'unicode-bidi': r'normal|embed|bidi-override|inherit', + 'vertical-align': r'baseline|sub|super|top|text-top|middle|bottom|text-bottom|{percentage}|{length}|inherit', + 'visibility': r'visible|hidden|collapse|inherit', + 'voice-family': r'({specific-voice}|{generic-voice}{w},{w})*({specific-voice}|{generic-voice})|inherit', + 'volume': r'{number}|{percentage}|silent|x-soft|soft|medium|loud|x-loud|inherit', + 'white-space': r'normal|pre|nowrap|pre-wrap|pre-line|inherit', + 'widows': r'{integer}|inherit', + 'width': r'{length}|{percentage}|auto|inherit', + 'word-spacing': r'normal|{length}|inherit', + 'z-index': r'auto|{integer}|inherit', +} + + +macros[Profiles.CSS3_BACKGROUNDS_AND_BORDERS] = { + 'border-style': 'none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset', + 'border-width': '{length}|thin|medium|thick', + 'b1': r'{border-width}?({w}{border-style})?({w}{color})?', + 'b2': r'{border-width}?({w}{color})?({w}{border-style})?', + 'b3': r'{border-style}?({w}{border-width})?({w}{color})?', + 'b4': r'{border-style}?({w}{color})?({w}{border-width})?', + 'b5': r'{color}?({w}{border-style})?({w}{border-width})?', + 'b6': r'{color}?({w}{border-width})?({w}{border-style})?', + 'border-attrs': r'{b1}|{b2}|{b3}|{b4}|{b5}|{b6}', + 'border-radius-part': '({length}|{percentage})(\s+({length}|{percentage}))?' + } +properties[Profiles.CSS3_BACKGROUNDS_AND_BORDERS] = { + 'border-color': r'({color}|transparent)(\s+({color}|transparent)){0,3}|inherit', + 'border-style': r'{border-style}(\s+{border-style}){0,3}|inherit', + 'border-top': r'{border-attrs}|inherit', + 'border-right': r'{border-attrs}|inherit', + 'border-bottom': r'{border-attrs}|inherit', + 'border-left': r'{border-attrs}|inherit', + 'border-top-color': r'{color}|transparent|inherit', + 'border-right-color': r'{color}|transparent|inherit', + 'border-bottom-color': r'{color}|transparent|inherit', + 'border-left-color': r'{color}|transparent|inherit', + 'border-top-style': r'{border-style}|inherit', + 'border-right-style': r'{border-style}|inherit', + 'border-bottom-style': r'{border-style}|inherit', + 'border-left-style': r'{border-style}|inherit', + 'border-top-width': r'{border-width}|inherit', + 'border-right-width': r'{border-width}|inherit', + 'border-bottom-width': r'{border-width}|inherit', + 'border-left-width': r'{border-width}|inherit', + 'border-width': r'{border-width}(\s+{border-width}){0,3}|inherit', + 'border': r'{border-attrs}|inherit', + 'border-top-right-radius': '{border-radius-part}', + 'border-bottom-right-radius': '{border-radius-part}', + 'border-bottom-left-radius': '{border-radius-part}', + 'border-top-left-radius': '{border-radius-part}', + 'border-radius': '({length}{w}|{percentage}{w}){1,4}(/{w}({length}{w}|{percentage}{w}){1,4})?', + 'box-shadow': 'none|{shadow}({w},{w}{shadow})*', + } + +# CSS3 Basic User Interface Module +macros[Profiles.CSS3_BASIC_USER_INTERFACE] = { + 'border-style': macros[Profiles.CSS3_BACKGROUNDS_AND_BORDERS]['border-style'], + 'border-width': macros[Profiles.CSS3_BACKGROUNDS_AND_BORDERS]['border-width'], + 'outline-1': r'{outline-color}(\s+{outline-style})?(\s+{outline-width})?', + 'outline-2': r'{outline-color}(\s+{outline-width})?(\s+{outline-style})?', + 'outline-3': r'{outline-style}(\s+{outline-color})?(\s+{outline-width})?', + 'outline-4': r'{outline-style}(\s+{outline-width})?(\s+{outline-color})?', + 'outline-5': r'{outline-width}(\s+{outline-color})?(\s+{outline-style})?', + 'outline-6': r'{outline-width}(\s+{outline-style})?(\s+{outline-color})?', + 'outline-color': r'{color}|invert|inherit', + 'outline-style': r'auto|{border-style}|inherit', + 'outline-width': r'{border-width}|inherit', + } +properties[Profiles.CSS3_BASIC_USER_INTERFACE] = { + 'box-sizing': r'content-box|border-box', + 'cursor': r'((({uri}{w}({number}{w}{number}{w})?,{w})*)?(auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|(e|n|ne|nw|s|se|sw|w|ew|ns|nesw|nwse|col|row)-resize|all-scroll))|inherit', + 'nav-index': r'auto|{number}|inherit', + 'outline-color': r'{outline-color}', + 'outline-style': r'{outline-style}', + 'outline-width': r'{outline-width}', + 'outline-offset': r'{length}|inherit', + #'outline': r'{outline-attrs}(\s+{outline-attrs})*|inherit', + 'outline': r'{outline-1}|{outline-2}|{outline-3}|{outline-4}|{outline-5}|{outline-6}|inherit', + 'resize': 'none|both|horizontal|vertical|inherit', + } + +# CSS Box Module Level 3 +macros[Profiles.CSS3_BOX] = { + 'overflow': macros[Profiles.CSS_LEVEL_2]['overflow'] + } +properties[Profiles.CSS3_BOX] = { + 'overflow': '{overflow}{w}{overflow}?|inherit', + 'overflow-x': '{overflow}|inherit', + 'overflow-y': '{overflow}|inherit' + } + +# CSS Color Module Level 3 +macros[Profiles.CSS3_COLOR] = { + # orange and transparent in CSS 2.1 + 'namedcolor': r'(currentcolor|transparent|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)', + # orange? + 'rgbacolor': r'rgba\({w}{int}{w}\,{w}{int}{w}\,{w}{int}{w}\,{w}{num}{w}\)|rgba\({w}{num}%{w}\,{w}{num}%{w}\,{w}{num}%{w}\,{w}{num}{w}\)', + 'hslcolor': r'hsl\({w}{int}{w}\,{w}{num}%{w}\,{w}{num}%{w}\)|hsla\({w}{int}{w}\,{w}{num}%{w}\,{w}{num}%{w}\,{w}{num}{w}\)', + 'x11color': r'aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen', + 'uicolor': r'(ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText)', + 'color': r'{namedcolor}|{hexcolor}|{rgbcolor}|{rgbacolor}|{hslcolor}|{x11color}|inherit', + } +properties[Profiles.CSS3_COLOR] = { + 'opacity': r'{num}|inherit', + } + +# CSS Fonts Module Level 3 http://www.w3.org/TR/css3-fonts/ +macros[Profiles.CSS3_FONTS] = { + #'family-name': r'{string}|{ident}', + 'family-name': r'{string}|{ident}({w}{ident})*', + 'font-face-name': 'local\({w}{family-name}{w}\)', + 'font-stretch-names': r'(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded)', + 'unicode-range': r'[uU]\+[0-9A-Fa-f?]{1,6}(\-[0-9A-Fa-f]{1,6})?' + } +properties[Profiles.CSS3_FONTS] = { + 'font-size-adjust': r'{number}|none|inherit', + 'font-stretch': r'normal|wider|narrower|{font-stretch-names}|inherit' + } +properties[Profiles.CSS3_FONT_FACE] = { + 'font-family': '{family-name}', + 'font-stretch': r'{font-stretch-names}', + 'font-style': r'normal|italic|oblique', + 'font-weight': r'normal|bold|[1-9]00', + 'src': r'({uri}{w}(format\({w}{string}{w}(\,{w}{string}{w})*\))?|{font-face-name})({w},{w}({uri}{w}(format\({w}{string}{w}(\,{w}{string}{w})*\))?|{font-face-name}))*', + 'unicode-range': '{unicode-range}({w},{w}{unicode-range})*' + } + +# CSS3 Paged Media +macros[Profiles.CSS3_PAGED_MEDIA] = { + 'page-size': 'a5|a4|a3|b5|b4|letter|legal|ledger', + 'page-orientation': 'portrait|landscape', + 'page-1': '{page-size}(?:{w}{page-orientation})?', + 'page-2': '{page-orientation}(?:{w}{page-size})?', + 'page-size-orientation': '{page-1}|{page-2}', + 'pagebreak': 'auto|always|avoid|left|right' + } +properties[Profiles.CSS3_PAGED_MEDIA] = { + 'fit': 'fill|hidden|meet|slice', + 'fit-position': r'auto|(({percentage}|{length})(\s*({percentage}|{length}))?|((top|center|bottom)\s*(left|center|right)?)|((left|center|right)\s*(top|center|bottom)?))', + 'image-orientation': 'auto|{angle}', + 'orphans': r'{integer}|inherit', + 'page': 'auto|{ident}', + 'page-break-before': '{pagebreak}|inherit', + 'page-break-after': '{pagebreak}|inherit', + 'page-break-inside': 'auto|avoid|inherit', + 'size': '({length}{w}){1,2}|auto|{page-size-orientation}', + 'widows': r'{integer}|inherit' + } + +macros[Profiles.CSS3_TEXT] = { + } +properties[Profiles.CSS3_TEXT] = { + 'text-shadow': 'none|{shadow}({w},{w}{shadow})*', + } diff --git a/libs/cssutils/sac.py b/libs/cssutils/sac.py new file mode 100755 index 00000000..d46a0b70 --- /dev/null +++ b/libs/cssutils/sac.py @@ -0,0 +1,428 @@ +#!/usr/bin/env python +"""A validating CSSParser""" +__all__ = ['CSSParser'] +__docformat__ = 'restructuredtext' +__version__ = '$Id: parse.py 1754 2009-05-30 14:50:13Z cthedot $' + +import helper +import codecs +import errorhandler +import os +import tokenize2 +import urllib +import sys + + +class ErrorHandler(object): + """Basic class for CSS error handlers. + + This class class provides a default implementation ignoring warnings and + recoverable errors and throwing a SAXParseException for fatal errors. + + If a CSS application needs to implement customized error handling, it must + extend this class and then register an instance with the CSS parser + using the parser's setErrorHandler method. The parser will then report all + errors and warnings through this interface. + + The parser shall use this class instead of throwing an exception: it is + up to the application whether to throw an exception for different types of + errors and warnings. Note, however, that there is no requirement that the + parser continue to provide useful information after a call to fatalError + (in other words, a CSS driver class could catch an exception and report a + fatalError). + """ + def __init__(self): + self._log = errorhandler.ErrorHandler() + + def error(self, exception, token=None): + self._log.error(exception, token, neverraise=True) + + def fatal(self, exception, token=None): + self._log.fatal(exception, token) + + def warn(self, exception, token=None): + self._log.warn(exception, token, neverraise=True) + + +class DocumentHandler(object): + """ + void endFontFace() + Receive notification of the end of a font face statement. + void endMedia(SACMediaList media) + Receive notification of the end of a media statement. + void endPage(java.lang.String name, java.lang.String pseudo_page) + Receive notification of the end of a media statement. + void importStyle(java.lang.String uri, SACMediaList media, java.lang.String defaultNamespaceURI) + Receive notification of a import statement in the style sheet. + void startFontFace() + Receive notification of the beginning of a font face statement. + void startMedia(SACMediaList media) + Receive notification of the beginning of a media statement. + void startPage(java.lang.String name, java.lang.String pseudo_page) + Receive notification of the beginning of a page statement. + """ + def __init__(self): + def log(msg): + sys.stderr.write('INFO\t%s\n' % msg) + self._log = log + + def comment(self, text, line=None, col=None): + "Receive notification of a comment." + self._log("comment %r at [%s, %s]" % (text, line, col)) + + def startDocument(self, encoding): + "Receive notification of the beginning of a style sheet." + # source + self._log("startDocument encoding=%s" % encoding) + + def endDocument(self, source=None, line=None, col=None): + "Receive notification of the end of a document." + self._log("endDocument EOF") + + def importStyle(self, uri, media, name, line=None, col=None): + "Receive notification of a import statement in the style sheet." + # defaultNamespaceURI??? + self._log("importStyle at [%s, %s]" % (line, col)) + + def namespaceDeclaration(self, prefix, uri, line=None, col=None): + "Receive notification of an unknown rule t-rule not supported by this parser." + # prefix might be None! + self._log("namespaceDeclaration at [%s, %s]" % (line, col)) + + def startSelector(self, selectors=None, line=None, col=None): + "Receive notification of the beginning of a rule statement." + # TODO selectorList! + self._log("startSelector at [%s, %s]" % (line, col)) + + def endSelector(self, selectors=None, line=None, col=None): + "Receive notification of the end of a rule statement." + self._log("endSelector at [%s, %s]" % (line, col)) + + def property(self, name, value='TODO', important=False, line=None, col=None): + "Receive notification of a declaration." + # TODO: value is LexicalValue? + self._log("property %r at [%s, %s]" % (name, line, col)) + + def ignorableAtRule(self, atRule, line=None, col=None): + "Receive notification of an unknown rule t-rule not supported by this parser." + self._log("ignorableAtRule %r at [%s, %s]" % (atRule, line, col)) + + + +class EchoHandler(DocumentHandler): + "Echos all input to property `out`" + def __init__(self): + super(EchoHandler, self).__init__() + self._out = [] + + out = property(lambda self: u''.join(self._out)) + + def startDocument(self, encoding): + super(EchoHandler, self).startDocument(encoding) + if u'utf-8' != encoding: + self._out.append(u'@charset "%s";\n' % encoding) + +# def comment(self, text, line=None, col=None): +# self._out.append(u'/*%s*/' % text) + + def importStyle(self, uri, media, name, line=None, col=None): + "Receive notification of a import statement in the style sheet." + # defaultNamespaceURI??? + super(EchoHandler, self).importStyle(uri, media, name, line, col) + self._out.append(u'@import %s%s%s;\n' % (helper.string(uri), + u'%s ' % media if media else u'', + u'%s ' % name if name else u'') + ) + + + def namespaceDeclaration(self, prefix, uri, line=None, col=None): + super(EchoHandler, self).namespaceDeclaration(prefix, uri, line, col) + self._out.append(u'@namespace %s%s;\n' % (u'%s ' % prefix if prefix else u'', + helper.string(uri))) + + def startSelector(self, selectors=None, line=None, col=None): + super(EchoHandler, self).startSelector(selectors, line, col) + if selectors: + self._out.append(u', '.join(selectors)) + self._out.append(u' {\n') + + def endSelector(self, selectors=None, line=None, col=None): + self._out.append(u' }') + + def property(self, name, value, important=False, line=None, col=None): + super(EchoHandler, self).property(name, value, line, col) + self._out.append(u' %s: %s%s;\n' % (name, value, + u' !important' if important else u'')) + + +class Parser(object): + """ + java.lang.String getParserVersion() + Returns a string about which CSS language is supported by this parser. + boolean parsePriority(InputSource source) + Parse a CSS priority value (e.g. + LexicalUnit parsePropertyValue(InputSource source) + Parse a CSS property value. + void parseRule(InputSource source) + Parse a CSS rule. + SelectorList parseSelectors(InputSource source) + Parse a comma separated list of selectors. + void parseStyleDeclaration(InputSource source) + Parse a CSS style declaration (without '{' and '}'). + void parseStyleSheet(InputSource source) + Parse a CSS document. + void parseStyleSheet(java.lang.String uri) + Parse a CSS document from a URI. + void setConditionFactory(ConditionFactory conditionFactory) + + void setDocumentHandler(DocumentHandler handler) + Allow an application to register a document event handler. + void setErrorHandler(ErrorHandler handler) + Allow an application to register an error event handler. + void setLocale(java.util.Locale locale) + Allow an application to request a locale for errors and warnings. + void setSelectorFactory(SelectorFactory selectorFactory) + """ + def __init__(self, documentHandler=None, errorHandler=None): + self._tokenizer = tokenize2.Tokenizer() + if documentHandler: + self.setDocumentHandler(documentHandler) + else: + self.setDocumentHandler(DocumentHandler()) + + if errorHandler: + self.setErrorHandler(errorHandler) + else: + self.setErrorHandler(ErrorHandler()) + + def parseString(self, cssText, encoding=None): + if isinstance(cssText, str): + cssText = codecs.getdecoder('css')(cssText, encoding=encoding)[0] + + tokens = self._tokenizer.tokenize(cssText, fullsheet=True) + + def COMMENT(val, line, col): + self._handler.comment(val[2:-2], line, col) + + def EOF(val, line, col): + self._handler.endDocument(val, line, col) + + def simple(t): + map = {'COMMENT': COMMENT, + 'S': lambda val, line, col: None, + 'EOF': EOF} + type_, val, line, col = t + if type_ in map: + map[type_](val, line, col) + return True + else: + return False + + # START PARSING + t = tokens.next() + type_, val, line, col = t + + encoding = 'utf-8' + if 'CHARSET_SYM' == type_: + # @charset "encoding"; + # S + encodingtoken = tokens.next() + semicolontoken = tokens.next() + if 'STRING' == type_: + encoding = helper.stringvalue(val) + # ; + if 'STRING' == encodingtoken[0] and semicolontoken: + encoding = helper.stringvalue(encodingtoken[1]) + else: + self._errorHandler.fatal(u'Invalid @charset') + + t = tokens.next() + type_, val, line, col = t + + self._handler.startDocument(encoding) + + while True: + start = (line, col) + try: + if simple(t): + pass + + elif 'ATKEYWORD' == type_ or type_ in ('PAGE_SYM', 'MEDIA_SYM', 'FONT_FACE_SYM'): + atRule = [val] + braces = 0 + while True: + # read till end ; + # TODO: or {} + t = tokens.next() + type_, val, line, col = t + atRule.append(val) + if u';' == val and not braces: + break + elif u'{' == val: + braces += 1 + elif u'}' == val: + braces -= 1 + if braces == 0: + break + + self._handler.ignorableAtRule(u''.join(atRule), *start) + + elif 'IMPORT_SYM' == type_: + # import URI or STRING media? name? + uri, media, name = None, None, None + while True: + t = tokens.next() + type_, val, line, col = t + if 'STRING' == type_: + uri = helper.stringvalue(val) + elif 'URI' == type_: + uri = helper.urivalue(val) + elif u';' == val: + break + + if uri: + self._handler.importStyle(uri, media, name) + else: + self._errorHandler.error(u'Invalid @import' + u' declaration at %r' + % (start,)) + + elif 'NAMESPACE_SYM' == type_: + prefix, uri = None, None + while True: + t = tokens.next() + type_, val, line, col = t + if 'IDENT' == type_: + prefix = val + elif 'STRING' == type_: + uri = helper.stringvalue(val) + elif 'URI' == type_: + uri = helper.urivalue(val) + elif u';' == val: + break + if uri: + self._handler.namespaceDeclaration(prefix, uri, *start) + else: + self._errorHandler.error(u'Invalid @namespace' + u' declaration at %r' + % (start,)) + + else: + # CSSSTYLERULE + selector = [] + selectors = [] + while True: + # selectors[, selector]* { + if 'S' == type_: + selector.append(u' ') + elif simple(t): + pass + elif u',' == val: + selectors.append(u''.join(selector).strip()) + selector = [] + elif u'{' == val: + selectors.append(u''.join(selector).strip()) + self._handler.startSelector(selectors, *start) + break + else: + selector.append(val) + + t = tokens.next() + type_, val, line, col = t + + end = None + while True: + # name: value [!important][;name: value [!important]]*;? + name, value, important = None, [], False + + while True: + # name: + t = tokens.next() + type_, val, line, col = t + if 'S' == type_: + pass + elif simple(t): + pass + elif 'IDENT' == type_: + if name: + self._errorHandler.error('more than one property name', t) + else: + name = val + elif u':' == val: + if not name: + self._errorHandler.error('no property name', t) + break + elif u';' == val: + self._errorHandler.error('premature end of property', t) + end = val + break + elif u'}' == val: + if name: + self._errorHandler.error('premature end of property', t) + end = val + break + else: + self._errorHandler.error('unexpected property name token %r' % val, t) + + while not u';' == end and not u'}' == end: + # value !;} + t = tokens.next() + type_, val, line, col = t + + if 'S' == type_: + value.append(u' ') + elif simple(t): + pass + elif u'!' == val or u';' == val or u'}' == val: + value = ''.join(value).strip() + if not value: + self._errorHandler.error('premature end of property (no value)', t) + end = val + break + else: + value.append(val) + + while u'!' == end: + # !important + t = tokens.next() + type_, val, line, col = t + + if simple(t): + pass + elif u'IDENT' == type_ and not important: + important = True + elif u';' == val or u'}' == val: + end = val + break + else: + self._errorHandler.error('unexpected priority token %r' % val) + + if name and value: + self._handler.property(name, value, important) + + if u'}' == end: + self._handler.endSelector(selectors, line=line, col=col) + break + else: + # reset + end = None + + else: + self._handler.endSelector(selectors, line=line, col=col) + + t = tokens.next() + type_, val, line, col = t + + except StopIteration: + break + + + + def setDocumentHandler(self, handler): + "Allow an application to register a document event `handler`." + self._handler = handler + + def setErrorHandler(self, handler): + "TODO" + self._errorHandler = handler + \ No newline at end of file diff --git a/libs/cssutils/script.py b/libs/cssutils/script.py new file mode 100755 index 00000000..56c1c6e2 --- /dev/null +++ b/libs/cssutils/script.py @@ -0,0 +1,362 @@ +"""classes and functions used by cssutils scripts +""" +__all__ = ['CSSCapture', 'csscombine'] +__docformat__ = 'restructuredtext' +__version__ = '$Id: parse.py 1323 2008-07-06 18:13:57Z cthedot $' + +import HTMLParser +import codecs +import cssutils +import errno +import logging +import os +import sys +import urllib2 +import urlparse + +try: + import cssutils.encutils as encutils +except ImportError: + try: + import encutils + except ImportError: + sys.exit("You need encutils from http://cthedot.de/encutils/") + +# types of sheets in HTML +LINK = 0 # +STYLE = 1 # + +class CSSCaptureHTMLParser(HTMLParser.HTMLParser): + """CSSCapture helper: Parse given data for link and style elements""" + curtag = u'' + sheets = [] # (type, [atts, cssText]) + + def _loweratts(self, atts): + return dict([(a.lower(), v.lower()) for a, v in atts]) + + def handle_starttag(self, tag, atts): + if tag == u'link': + atts = self._loweratts(atts) + if u'text/css' == atts.get(u'type', u''): + self.sheets.append((LINK, atts)) + elif tag == u'style': + # also get content of style + atts = self._loweratts(atts) + if u'text/css' == atts.get(u'type', u''): + self.sheets.append((STYLE, [atts, u''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DtgI_zs z@j^UJpY*=jIJzE|`%+w+fujh!4A-w`i%?fQ56^V4rMNx~eWv>s|C{?FJ$JU^&V_i= zd}jo-^bz!A-ko`Kbchy5$Sn97CxYTx^j)6hu%nZnmm|>UPo{?3+E9wB25#~ zynrpin-=142B@Z9Q*Sa)Q*ZlZ^knx;wD#}*K^KYfmf=5HFe+AzBUZG)`*6X(awCdG zq66dX2UZ+}RD>{wVT@fq#pE$6d zeu&5V13CNw^5p}tTJl2F;0(sPxkgCdFpSY~b}@Q4l8r)!xe2Si#=!S!2JgqQ@vH^C zoq*q;XvN%bV-r!WaV2X<4gF+xHJiewatX4xnmxkqfdyU5?&As|6BXeHYLWn{I=PEy z;b%s&xrcj!k?e#N{+^}S6KoCp4bnn>9$@$KpmoXhv-|cP+Bdx)PWyP@zTzDF+Vpum zy-%d~{nGoo^uB+3U!UIpAiZx$?}wWE+Vp#CYaKIZU$bQ4jE<>`W|?2bN0|G%5z56& z7S5xSi$TY3-o0Am_p#BMZCsnq`41=RBj|VAG!K6CEzp94+a?y`N7mZgn5IN7*5u0J znl*B9QaLLDxWb8w6YF*96AMn%Qu72=#p(O)k&E{*+pXP90v0#o20Y}zefIy#oKDmN GmH!73$*E-k literal 0 HcmV?d00001 diff --git a/couchpotato/static/fonts/OpenSans-Bold-webfont.woff b/couchpotato/static/fonts/OpenSans-Bold-webfont.woff new file mode 100755 index 0000000000000000000000000000000000000000..cd86852d0a0c1930dab144b687318df762aa7ad3 GIT binary patch literal 14036 zcmY*=b8sfl_w^Iowr$(qc*6~!*tV@rHnummy|HcEww*Vh@9(d-r%p}Zb8lm+rn{zk z&UI6ilmvhPz6<9(0QtZBPxSw@|EvH1MN(2#9smHb{$}yMfv=z3wJRkqA^FXPf7=A# zAO_R{z!X)OSiiZFZ(Hvhz&sm&ej^(LdjJ3w`kTl4#^|#)J-?BwGcf=F_6-2}e}MUf z7dN#xv-#%4zhi2@<4uqnn2OB|oW9$FKYz!3xBnlI&8$640RV_^lU@q|5C=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WJYXvHaEd@zue597Vd)nrxIlC#gO?TWC+otR}`2}>1g3s4( ziEW#p3I873Hp2#d72AHD%|zv3Eh>Db;5QGyTY%TnM{*~k#+yEq8^A{pXR+Csb8wTm zYATKf*z@?610|);TfUmU7!v7R}UUw4qdSUw}+)Yb*p7Dv@lHd8P?(ct| zcLAO<9u%Mt^UnL7y8`U@@B43`^lkezaNCE0i!a=N=|_Qwv8ib3T(rOK%>h&%j}u3x zphYwBGx}rDYCNbDK>MbOKKF^WmOei`2lWCs;M$vTX1buxrFRom=-V8OqUhGic-!y& zEyF>Q3mF_W!52eSI8aABbHJB~1Ha=@1?qu3_>j9xfGi||*C{L&b(QI;Z_Gpt7(h-h z8}(>8sItfdqSy}KZfnm9!LMSxzf|zC95_rz%rdFOS0X#HYIX%?Hg`cyT@B{ab!R<5 zr(Teg-mDKe+z+2nu44mG9eX7zRj*=$+10369?FK{+fpN-BkD0nZWOzgjRw9whF#Cb zvT;ZZ-Nlxn?%*C++Er{dKvoks!z;IP8@F=@W-Z2{I47RFxd%8x1HMD_5{t6!nA!Fx z?!{zpKf9MFSmw{Xp+kor9b)TRT9X5 zaokzl{vp`7V`K(C+B&+Pp;o20Di_wOae>|uWx52n13OOa#0`w?II!a^ zitX3~y>~GOPhhcq8&2ADVmnss*wSM=7VKF4u^lsZEW=|vChVAXrh;nczEi?BR<^eo!xf9NY!8Xe*oAsvHSo4 literal 0 HcmV?d00001 diff --git a/couchpotato/static/fonts/OpenSans-BoldItalic-webfont.svg b/couchpotato/static/fonts/OpenSans-BoldItalic-webfont.svg new file mode 100755 index 00000000..8392240a --- /dev/null +++ b/couchpotato/static/fonts/OpenSans-BoldItalic-webfont.svg @@ -0,0 +1,146 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/couchpotato/static/fonts/OpenSans-BoldItalic-webfont.ttf b/couchpotato/static/fonts/OpenSans-BoldItalic-webfont.ttf new file mode 100755 index 0000000000000000000000000000000000000000..f74e0e3ca7fc8276e5ad7adf934032d4f6f8f7b6 GIT binary patch literal 23304 zcmbt+2Yggj_W!-_z3G$5wDdNUNg3`vMUXrTo}q!|#A&_#*}2#8n~0YMSPhKgkY z5m{y5n+%97vY{xt7M4{(7EusUV?j5oE-HEXf6sjrio5&&|33d;@|oAmz2}^J%J-c6 z7-x*Ru}~Q6*Kfp?*FU;6NXQ2c81F%1S;>?Dd z&Rtv74f|X0`^&^z<^?#yn>lZx`@NJEj19*# zB>#-r6C0*Kc{{EjiRW?W%!Y+G@h$vS#zu9*^?_LpGbeZWpwI2tAByvz-86gdys%W# z%vgPA?7w}}&696>H0kJfjE%wN+)4}l*qbY7m(lty^9$&USbM}77j}~A2$RJA-B^Nd z*h3c;N!ra!jG3M=h4G*)V=W(MQ|Pqhu$pBPu2D`h>ARjRa4ilJRasfD;eA+;1x_+^ zmhNYFTUSf<0mh%9bILf=4y>??CHNqI>0*zu1K6YE>1YG!&+>4c!p!V;_AJ}To?|bt zZ7dqF2mFDQKt>=tkQXQoTpxHbn0=D9wc+{zuG=84dkNREfIE;JNdN71ZKvDzwe4+d zYJ0V9SKIcJ(@#!5IpO5^lVeYgK6&-Y>`#t-(hwjj{15-QIYwe!&jne2b0eN4D<-qW zYO_0>ajtl`$LsSaBqk-Nq^6~3WM&0|*`b`=y!;LY9Se(!OG-PHm4`c5R91DVzM^Zl z?lnDn_UhdSQrmyPz`8+$uN-pK(5r_HA2D*&HT9#%Ts!u8C(ZOO>F1jH(p!OVEA5?peE>@Ky zx-}RI-dcYm?VZtSxURl6?c335p`dCitXKQpGFqG%JsQt56~&DmQ>>bcv}}G4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}Tw?7w7x8G0hL@4x(?4Cy)PIh8p>bLQo&%XvNLr`){UO7Z_&1kO zgN%{I@k<2F7`}BUi?ddslGsv^bY?f>XKZuSoZTGTraSJAZBzD~`~tdOVI5KBY;2pL z3I7(`Hp2#d72AG;%|hj1Eh>Db;x`Y!TY=Y3VgdXbu-|~KiLe+qVa~zL;;Lyl8elKr zR}Pf448P*oRvG582k@1a+4!HzX5cyaDk8RT#@)1}=iPvC_*CRue#-0QRO~KfwCMT1$PKgL;7*aP7@FGXv-P zUv@W9g}%+fD2i^Ig17yrzhyW`av_7GCir5g3J2^^KW`0RzbCWuqP~2UQk%KomRR+ie|LA^25{_m>JjmIH_Bj9Dg?_)26K zR?V)!%;s*WsjIewq$sd^O~%C1Jm@^Cf+-!TV3|MbhEAP&b&9QPXc&T8{lls;i5nc-abU+;6x*=}`tD*5p1@-JHk`EQ#CELMv8Bg$EZDL7V>@Q-SVqQn zOxQ6yV>>Q-pu+pKKQJCAT_NKnszG9{^Uzi9J1~t7s9e8W&_pjC@$l4(M|`-`dsF)b Jqg8+5{{i(PmP-Ht literal 0 HcmV?d00001 diff --git a/couchpotato/static/fonts/OpenSans-BoldItalic-webfont.woff b/couchpotato/static/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100755 index 0000000000000000000000000000000000000000..f3248c1142bc295baf37546c887f63cb021bdf00 GIT binary patch literal 15572 zcmY*=V{j(T`}Lh+}O5lXJgy8{(0*6etCQ9)Xa7I^wm?<(^Jzm zeca^5!~j5mpTe^UK=|*h4e`JDzw7_Mh>5Al0suhPKP>hSaP(696vRbD#eTT(pBVQC z1b}(~h`cgA(+^kr6YKmyzrevA+Q`Ph9smIT^~0n8VEjd!hR4X&nE(I)!THhrd?S5{nSs+!TTqN24aENgf|<34=?_N$05DDi05ak37@Pd& zCI&z4*lvC_EI(j-KWV%({~-YYc9Nf%=m#Y5QlR?gHqP!poWxHbkw1N)AS_^pS=$-? z=r|UCG@m~_jAfSZosEI}Prsc1aRmPXs1&H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