#!/usr/bin/python
# Copyright (C) 2010 Michael Ligh
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
')
for line in lines:
line = line.strip()
line = line.rstrip()
a_start = line.find('')
f_end = copy.find('<')
if f_start != -1 and f_end != -1:
files.append("%s%s" % (line[0:a_start], copy[f_start+1:f_end]))
elif line.lower().startswith('c:'):
files.append(line)
return files
def process_hashes(self, str):
hashes = {}
lines = str.split('
')
for line in lines:
pair = line.split(':')
hashes[pair[0]] = pair[1].strip()
return hashes
def process_column(self, column, ncol):
start_value = column.find('>')
if start_value == -1:
return
column = column[start_value+1:]
end_column = column.find('')
if end_column == -1:
return
str = column[0:end_column]
if self.column_names[ncol] == 'Name':
files = self.process_filenames(str)
return {'files': files}
elif self.column_names[ncol] == 'Hash':
hashes = self.process_hashes(str)
return {'hashes': hashes}
return None
def process_row(self, row):
end_row = row.find('')
if end_row == -1:
return
row = row[0:end_row]
offset = 0
ncol = 0
row_info = {}
while row[offset:].find('