Bug#934273: python3-debian: please support parsing Source: package (version)

2020-10-25 Thread David Bremner
Stuart Prescott writes: > Control: tags -1 patch > > > In [2]: def whatmade(name, cat): > ...: p = [pkg for pkg in cat if pkg['Package'] == name][0] > ...: print("Source %s/%s made binary %s/%s" % ( > ...: p.source, > ...: p.source_version, > ...:

Bug#934273: python3-debian: please support parsing Source: package (version)

2020-10-24 Thread Stuart Prescott
Control: tags -1 patch Hi David Returning to your excellent idea in #9334273, how does the following seem? It adds an accessor for the the `source` and `source_version` to the classes generated by the deb822.Packages class: In [1]: from debian import deb822 In [2]: def whatmade(name, cat):

Bug#934273: python3-debian: please support parsing Source: package (version)

2019-08-09 Thread David Bremner
David Bremner writes: > def parse_source(string): > matches=rex.match(string) > if matches: > return (matches.group(1),matches.group(2)) > else: > return string Probably return type polymorphism is a terrible idea in python. But I guess you knew that. Maybe return

Bug#934273: python3-debian: please support parsing Source: package (version)

2019-08-08 Thread David Bremner
Stuart Prescott writes: > > Any opinions on whether it should return the data unparsed as > > source_package (version) > > or whether it should be clever enough to return a > > namedtuple(..., ['source', 'version']) > Hmm. I'm not (blush) familiar with named tuples. I was thinking

Bug#934273: python3-debian: please support parsing Source: package (version)

2019-08-08 Thread Stuart Prescott
On Friday, 9 August 2019 09:42:02 AEST David Bremner wrote: > Source: 0x (0.8-1) > > is a legit line in a Packages (and buildinfo) file, we should > impliment a parser for that once, rather than letting everyone > re-invent their own hack. Yes, sounds very sensible. Since that field is also

Bug#934273: python3-debian: please support parsing Source: package (version)

2019-08-08 Thread David Bremner
Package: python3-debian Version: 0.1.35 Severity: wishlist Since Source: 0x (0.8-1) is a legit line in a Packages (and buildinfo) file, we should impliment a parser for that once, rather than letting everyone re-invent their own hack. -- System Information: Debian Release: bullseye/sid