Lines 135-141
def idir(self, path):
|
Link Here
|
---|
|
135 |
for root, _, filenames in os.walk(path): |
135 |
for root, _, filenames in os.walk(path): |
136 |
for f in filenames: |
136 |
for f in filenames: |
137 |
files.append(os.path.relpath(os.path.join(root, f), path)) |
137 |
files.append(os.path.relpath(os.path.join(root, f), path)) |
138 |
return files |
138 |
return set(files) |
139 |
|
139 |
|
140 |
def genData(self, file_name, content_type, boundary, flavor): |
140 |
def genData(self, file_name, content_type, boundary, flavor): |
141 |
"""Generates data in the form to be sent via http POST request.\n |
141 |
"""Generates data in the form to be sent via http POST request.\n |
Lines 502-509
def check_distribute(self, users):
|
Link Here
|
---|
|
502 |
path = self.getUserFilesPath(user, 'distribute') |
502 |
path = self.getUserFilesPath(user, 'distribute') |
503 |
print 'file_path=', path |
503 |
print 'file_path=', path |
504 |
existingFiles = self.idir(path) |
504 |
existingFiles = self.idir(path) |
505 |
print 'existingFiles=', existingFiles |
505 |
print 'existingFiles=', sorted(existingFiles) |
506 |
if self.files != existingFiles: |
506 |
print ' Files=', sorted(self.files) |
|
|
507 |
if set(self.files) != existingFiles: |
507 |
utils.fail( |
508 |
utils.fail( |
508 |
'Project files were not distributed for user %s' % |
509 |
'Project files were not distributed for user %s' % |
509 |
(user,)) |
510 |
(user,)) |
Lines 530-537
def check_collect(self, users):
|
Link Here
|
---|
|
530 |
path = self.getUserFilesPath(user, 'collect') |
531 |
path = self.getUserFilesPath(user, 'collect') |
531 |
print 'file_path=', path |
532 |
print 'file_path=', path |
532 |
existingFiles = self.idir(path) |
533 |
existingFiles = self.idir(path) |
533 |
print 'existingFiles=', existingFiles |
534 |
print 'existingFiles=', sorted(existingFiles) |
534 |
if self.files != existingFiles: |
535 |
print ' Files=', sorted(self.files) |
|
|
536 |
if set(self.files) != existingFiles: |
535 |
utils.fail( |
537 |
utils.fail( |
536 |
'Project files were not collected for user %s' % |
538 |
'Project files were not collected for user %s' % |
537 |
(user,)) |
539 |
(user,)) |