A module provides basic functions for parsing mime-type names and matching them
against a list of media-ranges.
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the HTTP
specification [RFC 2616] for a complete explanation:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
Contents:
* parse_mime_type(): Parses a mime-type into its component parts.
* parse_media_range(): Media-ranges are mime-types with wild-cards and a "q"
quality parameter.
* quality(): Determines the quality ("q") of a mime-type when compared against
a list of media-ranges.
* quality_parsed(): Just like quality() except the second parameter must be
pre-parsed.
* best_match(): Choose the mime-type with the highest quality ("q") from a list
of candidates.
explicit request a while back. (But use the current version.)
PR 48845.
I don't remember the PR number for the original request but it can be
tracked down if necessary.
Makefile. Updated to 1.1.1.0. Changes:
Version 1.1.1.0
2014-05-09
- Support for STIX v1.1.1
- Updated all schemalocations to reference new STIX v1.1.1 schemas
- Changed Confidence.source to be of type InformationSource
- Changed Statement.source to be of type InformationSource
- Changed Sighting.source to be of type InformationSource
- Updated AvailabilityLossType CV to align with STIX v1.1.1
This module uses ctypes to access the libmagic file type identification
library. It makes use of the local magic database and supports both textual and
MIME-type output.
Change Log
==========
Version 2.0.2 - April, 2014
---------------------------
- Extended "expr(name)" shortcut (same as "expr.setResultsName(name)")
to accept "expr()" as a shortcut for "expr.copy()".
- Added "locatedExpr(expr)" helper, to decorate any returned tokens
with their location within the input string. Adds the results names
locn_start and locn_end to the output parse results.
- Added "pprint()" method to ParseResults, to simplify troubleshooting
and prettified output. Now instead of importing the pprint module
and then writing "pprint.pprint(result)", you can just write
"result.pprint()". This method also accepts addtional positional and
keyword arguments (such as indent, width, etc.), which get passed
through directly to the pprint method
(see http://docs.python.org/2/library/pprint.html#pprint.pprint).
- Removed deprecation warnings when using '<<' for Forward expression
assignment. '<<=' is still preferred, but '<<' will be retained
for cases whre '<<=' operator is not suitable (such as in defining
lambda expressions).
- Expanded argument compatibility for classes and functions that
take list arguments, to now accept generators as well.
- Extended list-like behavior of ParseResults, adding support for
append and extend. NOTE: if you have existing applications using
these names as results names, you will have to access them using
dict-style syntax: res["append"] and res["extend"]
- ParseResults emulates the change in list vs. iterator semantics for
methods like keys(), values(), and items(). Under Python 2.x, these
methods will return lists, under Python 3.x, these methods will
return iterators.
- ParseResults now has a method haskeys() which returns True or False
depending on whether any results names have been defined. This simplifies
testing for the existence of results names under Python 3.x, which
returns keys() as an iterator, not a list.
- ParseResults now supports both list and dict semantics for pop().
If passed no argument or an integer argument, it will use list semantics
and pop tokens from the list of parsed tokens. If passed a non-integer
argument (most likely a string), it will use dict semantics and
pop the corresponding value from any defined results names. A
second default return value argument is supported, just as in
dict.pop().
- Fixed bug in markInputline, thanks for reporting this, Matt Grant!
- Cleaned up my unit test environment, now runs with Python 2.6 and
3.3.
--------------------------
Python/C bindings for the ssdeep library at http://ssdeep.sourceforge.net:
* hash_buf / hash_bytes - returns the ssdeep hash for a given buffer
* hash_file - returns the ssdeep hash for filepath
* compare - returns the % match between 2 hashes
import pydeep
pydeep.hash_buf('somedata')
pydeep.hash_file('path-to-file')
pydeep.compare('hash1','hash2')
* New Features
- Fuzzy Hashing engine re-written to be thread safe.
* Bug Fixes
- Able to handle long file paths on Win32.
- Fixed bug on comparing signatures with the same block size.
- Fixed crash on comparing short signatures.
- Fixed memory leak
changes in sbcl-1.2.0 relative to sbcl-1.1.18:
* bug fix: read-time-eval backquote context mixup. (lp#1321047)
* enhancement: when SAVE-LISP-AND-DIE fails due multiple threads, the
report of the signaled conditions lists currently running threads.
* enhancement: ported to ARM linux.
* enhancement: sb-gmp contrib has been updated. (lp#1305266)
* enhancement: new contrib sb-mpfr by Stephan Frank.
* bug fix: MAKE-SEQUENCE works with sequence types defined via DEFTYPE
(lp#1315846, thanks to Mark Cox)
* bug fix: SET-[DISPATCH-]MACRO-CHARACTER should coerce a symbolic
function-designator to a function only as needed. (lp#1012335)
* bug fix: remove references to asdf-install from the manual. (lp#1207544,
thanks to Thomas Hlavaty)
* bug fix: handle --without-xxx options to make.sh more carefully.
(lp#1246665, thanks to Richard M Kreuter)
* bug fix: prevent maybe-delete-exit from doing semantically broken things
with local exits. (lp#309099, lp#518099, lp#533930)
* bug fix: attempts to subclass BUILT-IN-CLASSes signal errors, as required
by AMOP. (lp#861004)
Changelog (per CHANGELOG.md):
5.9.0
-----
* [Use expanded URIs when available]
* [Deprecate `Twitter::REST::Client#middleware=` and `#connection_options`]
* [Ensure predicate methods return `false` for `Twitter::NullObject`]
* [Make `Twitter::Place#id` attribute accessible]
* [Enable injection of custom TCP/SSL socket classes]
* [Deprecate predicate methods without question marks]
* [Deprecate `Twitter::Base#[]`]
* [Remove statement that TweetStream is not 2.0.0-compatible]
* [Dont allow unacceptable IO objects in `Twitter::REST::Client#update_with_media`]
* [Add support for new REST API endpoint for bulk lookup of Tweets by ID]
* [Make the streaming API raise exceptions for status codes]
* [Call GET users/show if screen name has already been fetched]
* [Add the ability to set user_agent and proxy]
* [Use (immutable) user ID instead of (mutable) screen name]
* [Implement mute functionality]
5.8.0
-----
* [Alias `Twitter::Tweet#reply?` to `Twitter::Tweet#in_reply_to_user_id?`]
* [Add `Twitter::Error::SSL_REQUIRED` error code]
* [`Twitter::Tweet#retweeted_status` always returns the original tweet, not the retweet]