8 self
.backup_path
= None
13 def validate_row_func(line
):
14 """ Simple function to validate row
15 from common delimited file """
17 coln
= len(line
.split("\t"))
18 return (n
>= 0) and (not line
.startswith("#")) and (coln
== 4)
20 def create_backup_bean(row
):
21 """ Separate the columns and create a bean from the data"""
22 cols
= [s
.strip() for s
in row
.split("\t")]
24 rec
.backup_path
= cols
[0]
26 rec
.path_mode
= cols
[2]
30 def read_datafile(datafile
):
31 """ The data file contains a line by line
32 file format for paths that shall be queued
34 all_lines
= open(datafile
, "r").readlines()
35 valid_rows
= filter(validate_row_func
, all_lines
)
36 backup_recs
= map(create_backup_bean
, valid_rows
)