Skip to content

Commit

Permalink
Add config module
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljoseph committed Oct 18, 2013
1 parent 406a159 commit b797fdc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
19 changes: 3 additions & 16 deletions changes/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,12 @@
import virtualenv

import changes
from changes import attributes, probe, shell, version
from changes import attributes, config, probe, shell, version


log = logging.getLogger(__name__)
CHANGELOG = 'CHANGELOG.md'
arguments = None


def common_arguments():
"""
Return common arguments
:return: tuple of <app_name>, --dry-run, new_version
"""
return (
arguments['<app_name>'],
arguments['--dry-run'],
arguments['new_version'],
)
arguments = config.arguments


def write_new_changelog(app_name, filename, content_lines, dry_run=True):
Expand Down Expand Up @@ -145,7 +132,7 @@ def changelog():

write_new_changelog(
app_name,
CHANGELOG,
config.CHANGELOG,
changelog_content,
dry_run=dry_run
)
Expand Down
18 changes: 18 additions & 0 deletions changes/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CHANGELOG = 'CHANGELOG.md'
arguments = {}

def common_arguments():
"""
Return common arguments
:return: tuple of <app_name>, --dry-run, new_version
"""
version_prefix = arguments['--version-prefix']
new_version = arguments['new_version']

common_arguments = (
arguments['<app_name>'],
arguments['--dry-run'],
version_prefix + new_version if version_prefix else new_version,
)
return common_arguments

0 comments on commit b797fdc

Please sign in to comment.