All pastes #172527 Raw Edit

Quelqu'un

public text v1 · immutable
·published 2006-09-16 04:52 UTC
rendered paste body
plantRegex = re.compile('^(Plant:)(.*)')
kernelRegex = re.compile('^(Kernel:)(.*)')
updateRegex = re.compile('^(Update:)(.*)')
archRegex = re.compile('^(Architecture:)(.*)')
providesRegex = re.compile('^(Provides:)(.*)')
dependsRegex = re.compile('^(Dependes:)(.*)')
filesRegex = re.compile('^(Files:)(.*)')

for line in plantData:
    tab = line.strip()
    if tab == "" and plant != 0:
        continue

    if m = plantRegex.match(tab):
         # do something with m.group()
    elif m = kernelRegex.match(tab):
         # do something with m.group()
    elif m = updateRegex.match(tab):
         # do something with m.group()

    # and so on ...