~martin-decky/helenos/rcu

« back to all changes in this revision

Viewing changes to tools/imgutil.py

MergeĀ mainlineĀ changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        for name in os.listdir(path):
92
92
                if name in exclude_names:
93
93
                        continue
 
94
                
94
95
                item = ItemToPack(path, name)
 
96
                
95
97
                if not (item.is_dir or item.is_file):
96
98
                        continue
 
99
                
97
100
                yield item
98
101
 
99
102
def chunks(item, chunk_size):
101
104
        
102
105
        inf = open(item.path, 'rb')
103
106
        rd = 0
 
107
        
104
108
        while (rd < item.size):
105
109
                data = bytes(inf.read(chunk_size))
106
110
                yield data
107
111
                rd += len(data)
 
112
        
108
113
        inf.close()