~gpanders/pushbroom

fef57b65e7116ac0c106f1365f3d08a58ba18211 — Greg Anders 1 year, 8 months ago 615c907 v0.3.1
Version 0.3.1

Changes:
  - Fix pathlib error with open() call in Python 3.5
  - Look for config file in /etc/pushbroom if not found in user's home
    directory
4 files changed, 15 insertions(+), 7 deletions(-)

M CHANGELOG.md
M pyproject.toml
M src/pushbroom/__init__.py
M src/pushbroom/console.py
M CHANGELOG.md => CHANGELOG.md +10 -2
@@ 6,7 6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.0] - 2019-01-16
## [0.3.1] - 2020-01-27
### Changes
- Use `Path.open()` instead of `open(Path)`, as the latter does not work in
  Python 3.5 (but does in 3.6 and on)
- Look for configuration in `/etc/pushbroom/pushbroom.conf` if not found in
  `$XDG_CONFIG_HOME`

## [0.3.0] - 2020-01-16
### Added
- Empty subdirectories are automatically removed from monitored directories.
  This can be changed with the new `RemoveEmpty` option.


@@ 57,7 64,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.1.0] - 2019-06-18
- Initial Python release

[Unreleased]: https://github.com/gpanders/pushbroom/compare/v0.3.0...HEAD
[Unreleased]: https://github.com/gpanders/pushbroom/compare/v0.3.1...HEAD
[0.3.1]: https://github.com/gpanders/pushbroom/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/gpanders/pushbroom/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/gpanders/pushbroom/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/gpanders/pushbroom/compare/v0.1.5...v0.2.0

M pyproject.toml => pyproject.toml +1 -1
@@ 1,6 1,6 @@
[tool.poetry]
name = "pushbroom"
version = "0.3.0"
version = "0.3.1"
description = "Clean up your filesystem"
authors = ["Greg Anders <greg@gpanders.com>"]
license = "MIT"

M src/pushbroom/__init__.py => src/pushbroom/__init__.py +1 -1
@@ 1,3 1,3 @@
__version__ = "v0.3.0"
__version__ = "v0.3.1"

from .sweep import sweep

M src/pushbroom/console.py => src/pushbroom/console.py +3 -3
@@ 88,18 88,18 @@ def setup_logging(args: argparse.Namespace) -> None:
def read_config(conf_file: Path = None) -> configparser.ConfigParser:
    """Find and read configuration file"""
    if not conf_file:
        # Look under XDG_CONFIG_HOME first, then look for ~/.pushbroomrc
        # Look under XDG_CONFIG_HOME first, then for /etc/pushbroom/pushbroom.conf
        conf_file = (
            Path(os.environ.get("XDG_CONFIG_HOME", Path("~/.config").expanduser()))
            .joinpath("pushbroom")
            .joinpath("config")
        )
        if not conf_file.exists():
            conf_file = Path("~/.pushbroomrc").expanduser()
            conf_file = Path("/etc/pushbroom/pushbroom.conf")

    config = configparser.ConfigParser()
    try:
        with open(conf_file, "r") as fil:
        with conf_file.open() as fil:
            config.read_file(fil)
    except FileNotFoundError:
        logging.error("Configuration file %s not found", conf_file)