summaryrefslogtreecommitdiff
path: root/alot/helper.py
Commit message (Collapse)AuthorAge
* Add and update several docstrings.Lucas Hoffmann2016-03-11
|
* fix #841Patrick Totzke2016-02-21
|
* Fix parsing of mailto addressesjosch2014-10-02
| | | | | - the key has been capitalized so compare with "Body" and not "body" - comparison between strings is better done with == than with "is"
* fix small stuff in the docsPatrick Totzke2014-08-02
|
* Move email_as_string function from crypto to helper moduleYann Rouillard2014-08-02
| | | | | | | | | The email_as_string function, and the related RFC3156_canonicalize function, are now used by the ForwardCommand and are not specific anymore to the crypto routine. So we move them to the global helper module. fix an import removal mistake while moving email_as_string function: StringIO was not only used by email_as_string
* always return new Envelope in helper.mailto_to_envelopePatrick Totzke2014-03-21
|
* add mailto helpersPatrick Totzke2014-03-21
| | | | | | parse_mailto parses mailto strings into headers,body and mailto_to_envelope constructs an alot.db.envelope.Envelope for a give mailto string
* add mailto-helperPatrick Totzke2013-12-01
|
* helper: do not strip in string_sanitizeSiim Põder2013-08-07
| | | | | | | | | Stripping the string causes leading whitespace on the first line of a message to be removed leading to weird indentation in thread view for some html messages. string_sanitize is also used for mail header parsing but I would not expect them to contain undesired whitespace too often either.
* add a generic function to test libmagic versionYann Rouillard2013-07-18
|
* add a rough check on the libmagic library version for the libmagic bug ↵Yann Rouillard2013-07-18
| | | | workaround
* workaround a libmagic mimetype detection bug for office documentsYann Rouillard2013-07-18
|
* pep8&pyflakes fixesPatrick Totzke2013-07-07
| | | | mostly automatically fixed
* fix: call_cmd properly read return value from...Patrick Totzke2013-07-07
| | | | subprocess.CalledProcessError
* properly read stderr in call_command helperPatrick Totzke2013-07-07
|
* fix command line escaping for arguments containing spacesYann Rouillard2013-07-03
|
* fix typoPatrick Totzke2013-05-12
|
* Fix guess_encoding()Hamish Downer2013-04-24
| | | | | | | | Turns out commit 7a9da3b0f obliterated a difference that mattered - the different argument to magic.open() in guess_mimetype() and guess_encoding() This commit reinstates that difference, and has a correct use of the pip python-magic library to get the encoding.
* Add inline comments around magic API hackeryHamish Downer2013-04-04
|
* Support two different versions of magicHamish Downer2013-04-02
| | | | | | The API for magic has changed at some point. Debian and Ubuntu still have an old version, but only the new version can be installed via pip. This commit allows us to use either version.
* Reuse magic mime codeHamish Downer2013-04-02
| | | | | The same lines are in guess_encoding() and guess_mimetype() - so have guess_mimetype() call guess_encoding()
* escape double quotes as wellJohannes Kulick2013-02-19
|
* fix issue with empty authors stringsPatrick Totzke2012-12-02
| | | | | | helper.shorten_authors_string was not able to deal with nonempty whitespaces only as author's realnames. cf issue #530.
* cleanup: pep8/pyflakes fixesPatrick Totzke2012-09-09
|
* doc: docstringsPatrick Totzke2012-09-05
|
* fix issue with shlex removing quotesPatrick Totzke2012-09-03
|
* add split_commandline helperPatrick Totzke2012-09-03
| | | | that splits ;-separated commandlines safely using shlex
* Fix the sorting of tags with length == 1Kazuo Teramoto2012-07-25
| | | | | | The tag sorting `cmp()` put single unicode tags before the long tag names, but don't sort the single length tags. This commit fix this behavior sorting the single length tags separately.
* pep8 and pyflakes fixesPatrick Totzke2012-07-21
|
* doc: fix rtfd.org build: missing coding commentPatrick Totzke2012-06-16
| | | | helper.py usrs utf8 chars and sphinx autodoc complained
* add copyright statements to all source filesPatrick Totzke2012-06-14
| | | | cf issue #472
* add helper split_commandstringPatrick Totzke2012-06-03
| | | | | | | | that splits a command string into a list of strings to pass on to subprocess.Popen and the like. This helper is now used throughout the application instead of calling shlex.split directly as this is a potential source for errors because shlex is not yet able to properly deal with unicode bytestrings.
* fix: sanity check libmagics return valuesPatrick Totzke2012-05-30
| | | | | | | | .. when guessing mimetypes. It turns out that it does not always return proper 'type/subtype' strings. This makes helper.guess_mime_type default to 'application/octett' in those cases. cf. issue #459
* Merge branch '0.3-fix-prettyprint' into stagingPatrick Totzke2012-04-08
|\
| * smarter pretty_datetime helperPatrick Totzke2012-03-31
| | | | | | | | | | | | | | * introduces "just now" for <60sec * Nmin ago for <1hour * uses 12 hour clock for minutes iff am/pm is used by locale * lower case "yest" for yesterdays mails
| * decode strftime return values in pretty_datetimePatrick Totzke2012-03-31
| | | | | | | | | | | | datetime.strftime returns UTF-8 encoded strings, not unicodes. This decodes them for later use. fixes #421
* | add helper.parse_mailcap_nametemplatePatrick Totzke2012-03-28
|/ | | | | that splits a nametemplate string as given in the mailcap sensibly into prefix and suffix
* cleanup: imports in helper.pyPatrick Totzke2012-03-11
|
* group settings into a submodulePatrick Totzke2012-03-11
|
* allow custom checks helper.read_configPatrick Totzke2012-03-11
| | | | | | this makes read_config accept a `checks` dict as parameter which it will add to the validator if validation is used. It allows us to define custom checks ~ value types in our spec
* some cleanupsPatrick Totzke2012-03-02
|
* move read_config to helper; ConfigError to errorsPatrick Totzke2012-02-25
| | | | | | this refactors settings.py to make it more modular: errors.py will contain all exception classes, read_config is moved to helper to reuse in elsewhere
* updated settings docsPatrick Totzke2012-02-19
|
* pep8/pyflakes cleanupPatrick Totzke2012-02-19
|
* remove references to settings from helperPatrick Totzke2012-02-19
| | | | thos should not depend on user settings
* replace config.get_* with settings.getPatrick Totzke2012-02-18
| | | | | this changes all "small" calls to a config getter toa theyr counterparts that call SettingsManager.get
* docs lovePatrick Totzke2012-02-16
|
* log commandlist in helper.call_cmd_asyncPatrick Totzke2012-02-08
| | | | makes debugging easier
* sane fall back for guess_mimetypedPatrick Totzke2012-02-08
| | | | | | | helper.guess_mimetype is expected to return a mimetype string. If libmagic fails it used to return None. This makes it fall back to 'application/octet-stream'. close #313
* Fix the args parameter handed to spawnProcessJustus Winter2012-02-07
| | | | | | | | | Quoting http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IReactorProcess.spawnProcess.html: args - the command line arguments to pass to the process; a sequence of strings. The first string should be the executable's name. Fixes #308, possible more.