~martin-decky/helenos/rcu

« back to all changes in this revision

Viewing changes to tools/imgutil.py

  • Committer: Martin Decky
  • Date: 2012-04-13 14:46:01 UTC
  • mto: (1460.2.1 mainline)
  • mto: This revision was merged to the branch mainline in revision 1465.
  • Revision ID: martin@decky.cz-20120413144601-wsh5ujgyfj3vlqcq
cstyle

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()