summaryrefslogtreecommitdiff
path: root/alot/settings
Commit message (Collapse)AuthorAge
...
* Merge pull request #1089 from dcbaker/submit/sign-without-hintDylan Baker2017-07-27
|\ | | | | commands/envelope: Fall back to account for signing key
| * settings/manager: Extend the get_account_by_address with return_defaultDylan Baker2017-07-27
| | | | | | | | | | | | This new return_default flag (which is an optional and default to False) will try to return the default account if it cannot find an account matching the address hint.
* | settings: Allow loading themes from system locationsDylan Baker2017-07-19
|/ | | | | | | | | | | | | This adds additional system locations to search for theme files, which are either defined as the environment variable XDG_DATA_DIRS, or the generic fallback (per the xdg base directories spec) as /usr/local/share and /usr/share. We then add alot/themees to those paths to search for themes in. This allows a package manager to install the theme files system wide along with alot, and for alot to load them from the system wide directories. The Archlinux alot-git package is already installing the packages like this.
* settings: Add a reload methodDylan Baker2017-07-10
| | | | | | | | | | | This patch does a bit of refactoring to the Settings class for it's setup, and adds a reload method. The refactoring encapsulates the handling of NoneType for the read_*config methods, and reworks the constructor just a bit so that it doesn't rely on calling methods to create instance variables. The end result is slightly cleaner, and will be useful for adding a reload command to alot itself.
* Extend docs for settings.utils.read_configLucas Hoffmann2017-06-06
| | | | | The argument is handed to ConfigObj directly and allowing lines of text to be passed here makes future tests much easier.
* Merge pull request #1000 from dcbaker/pr/argument-validatorLucas Hoffmann2017-01-27
|\ | | | | argparse validators
| * move alot/settings/checks to alot/utils/configobjDylan Baker2017-01-25
| | | | | | | | This is just more reorganization.
* | settings/manager: Use getattrDylan Baker2017-01-26
|/
* Use absolute_imports from __future__Lucas Hoffmann2017-01-18
|
* Merge pull request #975 from lucc/tests/doctestsPatrick Totzke2017-01-18
|\ | | | | Porting old doctests to unittest
| * Port old doctests to unittest: alot.settings.checksLucas Hoffmann2017-01-18
| |
* | settings/manager: fix typo in docstringDylan Baker2017-01-17
|/
* fix odd continuation and indentationDylan Baker2016-12-27
| | | | This is just whitespace changes.
* settings/manager: remove list comprehension for clarityDylan Baker2016-12-21
| | | | | | | The use of a list comprehension here saves one line of code, but doesn't make the code clearer, a simple loop is more obvious. This also replaces ``if not v or v == ''`` with simply ``if not v``, since they're equivalent.
* Replace map() and filter() with comprehensionsDylan Baker2016-12-21
| | | | | | | | This had the advantage of being more readable to people without a functional programming background, and it avoids the need to use lambdas which are both slow and have many corners in python. In a few cases it also allows us to use a generator expression instead of a materialized list, which save some memory.
* Use raw strings with backslashesDylan Baker2016-12-21
| | | | This just adds the `r` prefix to a few strings.
* Turn methods with no `self` usage into staticmethodsLucas Hoffmann2016-12-18
|
* fix interpolation in config files #902.Patrick Totzke2016-12-16
| | | | | | | | | Configobj's string interpolation feature does not work as expected in account sections of alot configuration files. The reason is that interpolation is done in ConfigObj.__getitem__ which alot does not use directly for account sections. This patch causes all values to be read via ConfigObj.__getitem__ explicitly.
* Replace mutable keyword argumentsDylan Baker2016-12-13
| | | | | | | | | | | | | | | | | | | | | | | There are a number of cases of mutable keyword arguments (list and dict in this case). Mutable keyword arguments are rather dangerous, since any mutation of the default value is persistent, which will inevitably lead to bugs. For example, imagine this code: def func(def=[]): def.append('foo') return def >>> func() ['foo'] >>> func() ['foo', 'foo'] This is almost certainly not what was intended. This code generally uses the idiom of setting the default value to None, and then assigning with or `value = value or []` which will replace value with the empty list (or dict) when value is falsey, like None or another empty list.
* settings/manager.py: Compare addresses using == instead of inDylan Baker2016-12-13
| | | | | | | I don't think this was correct from the start, since "foo@bar.com" would match "bfoo@bar.com", even if there was a "bfoo@bar.com" in the accountmap, depending on the order that they happened to be sorted in accountmap.
* Further minor style fixesLucas Hoffmann2016-12-09
|
* Fix except syntaxLucas Hoffmann2016-12-09
|
* Clean up importsLucas Hoffmann2016-12-09
| | | | | | - use relative imports if possible - group imports into standard library, third party, and alot modules - sort imports alphabetically
* Use logging's native string interpolationLucas Hoffmann2016-12-09
|
* Remove braces after `del` and `return`Lucas Hoffmann2016-12-09
| | | | | `del` and `return` are keywords and not functions so the braces are not needed.
* alot/settings/utils.py: extend error message on IOError exceptionJohannes 'josch' Schauer2016-01-31
|
* config setting: shellcommand_external_filteringPatrick Totzke2015-04-15
| | | | that exposes ExternalAddressbook's new functionality
* refactor MatchSdtoutAddressbookPatrick Totzke2015-04-15
| | | | | | The class is now called ExternalAddressbook and makes it optional to call the external command with the given search string as parameter when looking up addresses
* refactor addressbook codePatrick Totzke2015-04-15
|
* just formating (pep8 etc.)Patrick Totzke2014-08-02
|
* added check to bindings commands; added settings.get_keybindings(self,mode)Cinghio Pinghio2014-08-02
|
* work around new configobj behaviourPatrick Totzke2014-04-03
| | | | | | | | regarding utf8 chars in the config being read as str, not unicode in python v2.7. This pathc introduces an additional `alot.helper.string_decode` around the translated tagname read from the config, and fixes issue #693. In the long run, we expect configobj to be fully backweards compatible.
* pep8&pyflakes fixesPatrick Totzke2013-07-07
| | | | mostly automatically fixed
* doc: clean up docstring for SettingsManagerPatrick Totzke2013-05-12
|
* pep8/pyflakes fixesPatrick Totzke2013-03-16
|
* introduce new themable thread.body_focus for focussed body text linesPatrick Totzke2013-03-03
|
* postpone binding if candidates with same prefix existPatrick Totzke2013-03-03
| | | | | | | | | | This ensures that commandlines that are bound to a key are not fired right away but wait a little (config option 'input_timeout') in case there are other bindings with this key as prefix. This allows to bind for instance 'g g' to move up while at the same time one can bind 'g' to global replies. Without this change, the 'g' binding would be fired right away.
* correcting error message for themeLukas Zapletal2013-02-26
| | | | | | | When there was a theme parse error, alot was producing incorrect exception: in read_config raise ConfigError((err_msg % str(themestring)) + e.message) TypeError: cannot concatenate 'str' and 'ParseError' objects
* fix #571Patrick Totzke2013-02-25
|
* empty input queue as soon asPatrick Totzke2013-01-11
| | | | | .. the current value cannot be prefix of any bound keysequence. fixes #547
* hotfix silly mistakePatrick Totzke2012-12-16
|
* read configs lazily in SettingsManagerPatrick Totzke2012-12-16
| | | | | | | | | | This causes SettingsManager not to read the default configs upon init when no config paths are passed on. It is safe because alot.init.main triggers reading the config files anyway. This fixes a problem with building the docs on rfd.org due to them not havin configobj available at build time.
* add 'ignorecase' config option for abook sectionsPatrick Totzke2012-09-22
|
* cleanup: pep8/pyflakes fixesPatrick Totzke2012-09-01
|
* fix: don't die because of non-string bindingsPatrick Totzke2012-08-19
| | | | cf issue #500
* fix error caused by leaving out threadline-foo parts..Patrick Totzke2012-08-11
| | | | ..in theme files
* more precise error handling for config parsingPatrick Totzke2012-08-10
|
* cleanup: move SettingsManager to its own filePatrick Totzke2012-08-10
|
* do not write default config if missingPatrick Totzke2012-08-01
| | | | | | This has been done before to provide the default bindings, which are now read directly from defautls/default.bindings during startup.
* read default bindings from default/default.bindingsPatrick Totzke2012-08-01
| | | | | | | | | | | | This re-introduces a separate file containing the default keybindings for alot. The values from this file are *always* used as fallbacks and can be overwritten by bindings from the users config. To be able to unbind a default binding just bind it to an empty string. The same will allow buffer-local bindings to be overwritten by global bindings as described in https://github.com/pazz/alot/issues/403#issuecomment-4434948. cf issue #487