debian/lib/python/debian_linux/debian.py: Allow parsing any file as changelog
This commit is contained in:
parent
09697cfec7
commit
354e9c4806
|
@ -47,6 +47,8 @@ linux (4.16-1~exp1) UNRELEASED; urgency=medium
|
|||
* debian/lib/python/debian_linux/gencontrol.py: Allow overriding output
|
||||
filenames
|
||||
* debian/lib/python/debian_linux/debian.py: Close changelog after parsing
|
||||
* debian/lib/python/debian_linux/debian.py: Allow parsing any file as
|
||||
changelog
|
||||
|
||||
-- Roger Shimizu <rogershimizu@gmail.com> Fri, 23 Mar 2018 21:10:34 +0900
|
||||
|
||||
|
|
|
@ -35,10 +35,16 @@ class Changelog(list):
|
|||
self.distribution, self.source, self.version, self.urgency = \
|
||||
distribution, source, version, urgency
|
||||
|
||||
def __init__(self, dir='', version=None):
|
||||
def __init__(self, dir='', version=None, file=None):
|
||||
if version is None:
|
||||
version = Version
|
||||
if file:
|
||||
self._parse(version, file)
|
||||
else:
|
||||
with open(os.path.join(dir, "debian/changelog"), encoding="UTF-8") as f:
|
||||
self._parse(version, f)
|
||||
|
||||
def _parse(self, version, f):
|
||||
while True:
|
||||
line = f.readline()
|
||||
if not line:
|
||||
|
|
Loading…
Reference in New Issue