diff --git a/scratch/profile-swhgitloader.py b/scratch/profile-swhgitloader.py deleted file mode 100755 index 43361eb..0000000 --- a/scratch/profile-swhgitloader.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (C) 2015 Stefano Zacchiroli , -# Antoine R. Dumont -# See the AUTHORS file at the top-level directory of this distribution -# License: GNU General Public License version 3, or any later version -# See top-level LICENSE file for more information - -import os - -from swh.gitloader import loader - - -conf = { - 'db_url': 'dbname=swhgitloader', - # 'repository': os.path.expanduser('./test-repo'), - 'repository': os.path.expanduser('../debsources'), - 'content_storage_dir': '/tmp/swh-git-loader/content-storage', - 'folder_depth': 4 -} - -conf['action'] = 'cleandb' -loader.load(conf) - -conf['action'] = 'initdb' -loader.load(conf) - -conf['action'] = 'load' -loader.load(conf) diff --git a/scratch/scratch-pickle.py b/scratch/scratch-pickle.py deleted file mode 100644 index 48e48ac..0000000 --- a/scratch/scratch-pickle.py +++ /dev/null @@ -1,26 +0,0 @@ -import pickle -import zlib -import os - -#file_path_sample = '/home/tony/work/inria/repo/swh-git-loader-testdata/.git/objects/08/2a4aac696b8645e39771c2ba61e6e4a4aaf989' -file_path_sample = '/home/tony/work/inria/repo/swh-git-loader-testdata/.git/objects/26/4f1dacc1460bddb84c3e3e2eeb8b6f03fd172e' - -def read_git_object_content(filepath): - if os.path.exists(filepath): - with open(filepath, 'rb') as f: - content = f.read() - - return zlib.decompress(content) - return None - -map_content = { 'lion': 'yellow' - , 'kitty': 'red' - , 'content': read_git_object_content(file_path_sample) - } - -# marshall/serialize/pickle -pickle.dump(map_content, open( 'save.p', 'wb' )) - -# unmarshal/deserialize/unpickle -map_content_loaded = pickle.load( open( 'save.p', 'rb' ) ) -# {'content': b'tree 37\x00100644 README.md\x00\x8b\xbb\x0b\xcc6\x9a\xb3\xba\xa4#\xda\xcc6\x00a\x81:1\x05\xf3', 'lion': 'yellow', 'kitty': 'red'}