remove configure.configure, use __version__, remove getRevision() (#94)

* remove configure.configure, use __version__, remove getRevision()

* remove empty configure/ directory

* remove morituri.configure imports
This commit is contained in:
Samantha Baldwin
2016-12-31 10:41:18 -05:00
committed by JoeLametta
parent ee298906ac
commit 976e1bdca2
11 changed files with 21 additions and 65 deletions

View File

@@ -2,6 +2,8 @@ import logging
import os
import sys
__version__ = '0.4.0'
level = logging.WARNING
if 'WHIPPER_DEBUG' in os.environ:
level = os.environ['WHIPPER_DEBUG'].upper()

View File

@@ -6,10 +6,11 @@ import sys
import pkg_resources
import musicbrainzngs
import morituri
from morituri.command import cd, offset, drive, image, accurip, debug
from morituri.command.basecommand import BaseCommand
from morituri.common import common, directory
from morituri.configure import configure
from morituri.extern.task import task
import logging
@@ -17,7 +18,7 @@ logger = logging.getLogger(__name__)
def main():
# set user agent
musicbrainzngs.set_useragent("whipper", configure.version,
musicbrainzngs.set_useragent("whipper", morituri.__version__,
"https://github.com/JoeLametta/whipper")
# register plugins with pkg_resources
distributions, _ = pkg_resources.working_set.find_plugins(
@@ -82,5 +83,5 @@ You can get help on subcommands by using the -h option to the subcommand.
self.parser.print_help()
sys.exit(0)
if self.options.version:
print "whipper %s" % configure.version
print "whipper %s" % morituri.__version__
sys.exit(0)

View File

@@ -333,37 +333,3 @@ class VersionGetter(object):
raise
return version
def getRevision():
"""
Get a revision tag for the current git source tree.
Appends -modified in case there are local modifications.
If this is not a git tree, return the top-level REVISION contents instead.
Finally, return unknown.
"""
topsrcdir = os.path.join(os.path.dirname(__file__), '..', '..')
# only use git if our src directory looks like a git checkout
# if you run git regardless, it recurses up until it finds a .git,
# which may be higher than your current source tree
if os.path.exists(os.path.join(topsrcdir, '.git')):
# always falls back to the current commit hash if no tags are found
status, describe = commands.getstatusoutput('git describe --all')
if status == 0:
if commands.getoutput('git diff-index --name-only HEAD --'):
describe += '-modified'
return describe
# check for a top-level REVISION file
path = os.path.join(topsrcdir, 'REVISION')
if os.path.exists(path):
revision = open(path).read().strip()
return revision
return '(unknown)'

View File

@@ -1,2 +0,0 @@
installed.py
uninstalled.py

View File

@@ -1,15 +0,0 @@
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
import os
from morituri.common import common
config_dict = {
'revision': common.getRevision(),
'version': '0.4.0',
}
for key, value in config_dict.items():
dictionary = locals()
dictionary[key] = value

View File

@@ -28,8 +28,9 @@ import copy
import urllib
import urlparse
import morituri
from morituri.common import common
from morituri.configure import configure
import logging
logger = logging.getLogger(__name__)
@@ -555,7 +556,7 @@ class Table(object):
assert self.hasTOC(), "Table does not represent a full CD TOC"
lines.append('REM DISCID %s' % self.getCDDBDiscId().upper())
lines.append('REM COMMENT "%s %s"' % (program, configure.version))
lines.append('REM COMMENT "%s %s"' % (program, morituri.__version__))
if self.catalog:
lines.append("CATALOG %s" % self.catalog)

View File

@@ -1,8 +1,9 @@
import time
import hashlib
import morituri
from morituri.common import common
from morituri.configure import configure
from morituri.result import result
@@ -26,7 +27,7 @@ class MorituriLogger(result.Logger):
# Ripper version
# Only implemented in whipper (ripResult.logger)
lines.append("Log created by: whipper %s (%s logger)" % (
configure.version, ripResult.logger))
morituri.__version__, ripResult.logger))
# Rip date
date = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(epoch)).strip()

View File

@@ -5,11 +5,11 @@ import re
import os
import sys
import morituri
# twisted's unittests have skip support, standard unittest don't
from twisted.trial import unittest
from morituri.configure import configure
# lifted from flumotion
@@ -71,7 +71,7 @@ class TestCase(unittest.TestCase):
).decode('utf-8')
ret = re.sub(
'REM COMMENT "Morituri.*',
'REM COMMENT "Morituri %s"' % (configure.version),
'REM COMMENT "Morituri %s"' % (morituri.__version__),
ret, re.MULTILINE)
return ret

View File

@@ -5,12 +5,12 @@ import os
import tempfile
import unittest
import morituri
from morituri.image import table, cue
from morituri.configure import configure
from morituri.test import common
class KingsSingleTestCase(unittest.TestCase):
def setUp(self):
@@ -85,5 +85,5 @@ FILE "track01.wav" WAVE
INDEX 00 00:13:25
FILE "track02.wav" WAVE
INDEX 01 00:00:00
""" % configure.version, it.cue())
""" % morituri.__version__, it.cue())
os.unlink(path)

View File

@@ -1,9 +1,11 @@
from setuptools import setup, find_packages
from os import system, makedirs, environ
import morituri
setup(
name="whipper",
version="0.4.0",
version=morituri.__version__,
description="a secure cd ripper preferring accuracy over speed",
author=['Thomas Vander Stichele', 'Joe Lametta', 'Samantha Baldwin'],
maintainer=['Joe Lametta', 'Samantha Baldwin'],