- infoFile = glob.glob(os.path.join(self.rsrcPath, "*.info"))[0]
- self.mdata = {}
- for line in open(infoFile, "r").readlines():
- line = line.strip()
- if line and line[0] != '#':
- ls = line.split()
- self.mdata[ls[0]] = line[len(ls[0])+1:]
-
+ infoFiles = glob.glob(os.path.join(self.rsrcPath, "*.info"))
+ if infoFiles:
+ # there should be only one
+ infoFile = infoFiles[0]
+ self.mdata = {}
+ for line in open(infoFile, "r").readlines():
+ line = line.strip()
+ if line and line[0] != '#':
+ ls = line.split()
+ self.mdata[ls[0]] = line[len(ls[0])+1:]
+ else:
+ print "WARNING: Unable to find %s/*.info" % self.rsrcPath
+ raise ReceiptError
+