|
|
|
@ -39,7 +39,7 @@ import uuid
|
|
|
|
import xdg.BaseDirectory
|
|
|
|
import xdg.BaseDirectory
|
|
|
|
|
|
|
|
|
|
|
|
#import dat
|
|
|
|
#import dat
|
|
|
|
import hashdb
|
|
|
|
import metadatadb
|
|
|
|
|
|
|
|
|
|
|
|
HASH_CHUNK_SIZE = 10485760 # 10mb
|
|
|
|
HASH_CHUNK_SIZE = 10485760 # 10mb
|
|
|
|
SQLITE_FILENAME = 'metadata.db'
|
|
|
|
SQLITE_FILENAME = 'metadata.db'
|
|
|
|
@ -91,7 +91,7 @@ def _kwargs_parse(kwargs_list):
|
|
|
|
action_object = sys.argv[1]
|
|
|
|
action_object = sys.argv[1]
|
|
|
|
action = sys.argv[2]
|
|
|
|
action = sys.argv[2]
|
|
|
|
|
|
|
|
|
|
|
|
db = hashdb.MetadataDB(os.path.join(data_path, SQLITE_FILENAME))
|
|
|
|
db = metadatadb.MetadataDB(os.path.join(data_path, SQLITE_FILENAME))
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: Use a real UI library. This mess is just intended for development.
|
|
|
|
# TODO: Use a real UI library. This mess is just intended for development.
|
|
|
|
if action_object == 'platform':
|
|
|
|
if action_object == 'platform':
|
|
|
|
@ -100,11 +100,8 @@ if action_object == 'platform':
|
|
|
|
platform_shortcode = sys.argv[3]
|
|
|
|
platform_shortcode = sys.argv[3]
|
|
|
|
platform_name = sys.argv[4]
|
|
|
|
platform_name = sys.argv[4]
|
|
|
|
|
|
|
|
|
|
|
|
platform_data = hashdb.Platform(shortcode=platform_shortcode,
|
|
|
|
platform_data = metadatadb.Platform(shortcode=platform_shortcode,
|
|
|
|
name=platform_name)
|
|
|
|
fullname=platform_name)
|
|
|
|
|
|
|
|
|
|
|
|
print(platform_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
db.add_platform(platform_data)
|
|
|
|
db.add_platform(platform_data)
|
|
|
|
|
|
|
|
|
|
|
|
elif action == 'list':
|
|
|
|
elif action == 'list':
|
|
|
|
@ -126,7 +123,7 @@ if action_object == 'platform':
|
|
|
|
platform_shortcode = sys.argv[3]
|
|
|
|
platform_shortcode = sys.argv[3]
|
|
|
|
platform_name = sys.argv[4]
|
|
|
|
platform_name = sys.argv[4]
|
|
|
|
|
|
|
|
|
|
|
|
platform_data = hashdb.Platform(shortcode=platform_shortcode,
|
|
|
|
platform_data = metadatadb.Platform(shortcode=platform_shortcode,
|
|
|
|
fullname=platform_name)
|
|
|
|
fullname=platform_name)
|
|
|
|
|
|
|
|
|
|
|
|
#db.add_platform(platform_data)
|
|
|
|
#db.add_platform(platform_data)
|
|
|
|
|