From 2285f088fb423b3c38244d6e7c8ea7e385c1ca47 Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Tue, 9 Dec 2014 12:14:52 +0200 Subject: [PATCH] Cleanup and reorganise --- changes/changelog.py | 9 +++------ changes/packaging.py | 4 +--- changes/vcs.py | 6 +----- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/changes/changelog.py b/changes/changelog.py index 690fdfe..fa45e20 100644 --- a/changes/changelog.py +++ b/changes/changelog.py @@ -1,19 +1,16 @@ import logging +import io import re -import click from plumbum.cmd import git -from changes import version -from changes.attributes import extract_attribute - log = logging.getLogger(__name__) def write_new_changelog(repo_url, filename, content_lines, dry_run=True): heading_and_newline = '# [Changelog](%s/releases)\n' % repo_url - with click.open_file(filename, 'r+') as f: + with io.open(filename, 'r+') as f: existing = f.readlines() output = existing[2:] @@ -27,7 +24,7 @@ def write_new_changelog(repo_url, filename, content_lines, dry_run=True): output = ''.join(output) if not dry_run: - with click.open_file(filename, 'w+') as f: + with io.open(filename, 'w+') as f: f.write(output) else: log.info('New changelog:\n%s', ''.join(content_lines)) diff --git a/changes/packaging.py b/changes/packaging.py index a9c7146..b64d506 100644 --- a/changes/packaging.py +++ b/changes/packaging.py @@ -1,10 +1,8 @@ import logging -import click from path import path -from plumbum.cmd import python -from changes import probe, shell, util, venv, verification +from changes import shell, util, venv, verification log = logging.getLogger(__name__) diff --git a/changes/vcs.py b/changes/vcs.py index 694bea3..1f610b7 100644 --- a/changes/vcs.py +++ b/changes/vcs.py @@ -1,17 +1,13 @@ -import json import io import logging -from pprint import pprint import click import magic -from path import path -from plumbum.cmd import git import requests from uritemplate import expand -from changes import config, shell, packaging +from changes import shell log = logging.getLogger(__name__)