Skip to content

Commit

Permalink
Cleanup and reorganise
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljoseph committed Dec 9, 2014
1 parent f457cf5 commit 2285f08
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
9 changes: 3 additions & 6 deletions changes/changelog.py
Original file line number Diff line number Diff line change
@@ -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:]
Expand All @@ -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))
Expand Down
4 changes: 1 addition & 3 deletions changes/packaging.py
Original file line number Diff line number Diff line change
@@ -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__)

Expand Down
6 changes: 1 addition & 5 deletions changes/vcs.py
Original file line number Diff line number Diff line change
@@ -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__)

Expand Down

0 comments on commit 2285f08

Please sign in to comment.