Ejemplo n.º 1
0
 def _compute_manifest(self, db_dir):
     manifest = {}
     packages = self._db.list()
     for category in packages.iterkeys():
         for pkg in packages[category].iterkeys():
             for version in packages[category][pkg]:
                 description = os.path.join(
                     db_dir,
                     'octave-forge',
                     str(category),
                     pkg,
                     '%s-%s.DESCRIPTION' % (pkg, version)
                 )
                 manifest[pkg + '-' + version] = sha1_compute(description)
     try:
         with open(os.path.join(self._repo_dir, 'manifest.json'), 'w') as fp:
             json.dump(manifest, fp, indent=2, sort_keys=True)
     except:
         pass
Ejemplo n.º 2
0
 def test_filechecksum(self):
     my_checksum = checksum.sha1_compute(self._tempfile)
     self.assertEqual(my_checksum, '8aa49f56d049193b183cb2918f8fb59e0caf1283')
Ejemplo n.º 3
0
 def test_filechecksum(self):
     my_checksum = checksum.sha1_compute(self._tempfile)
     self.assertEqual(my_checksum,
                      '8aa49f56d049193b183cb2918f8fb59e0caf1283')