mirror of
https://github.com/RustyRaptor/Community.git
synced 2026-12-04 00:05:17 -07:00
Simple changes to ipfs storage engine
This commit is contained in:
1 parent
d21a1c75d3
commit
6d236adb3c
2 files changed
+8
-10
No files matched your search
@@ -20,8 +20,12 @@ import ipfsapi
|
||||
|
||||
class Engine:
|
||||
def __init__(self, settings: dict):
|
||||
self.ipfs = None
|
||||
self.ipfs_conn = None
|
||||
self.setting = settings
|
||||
self._connect_to_ipfs()
|
||||
|
||||
def connect_ipfs(self):
|
||||
self.ipfs = ipfsapi.connect('127.0.0.1', 5001)
|
||||
def _connect_to_ipfs(self):
|
||||
try:
|
||||
self.ipfs_conn = ipfsapi.connect('127.0.0.1', 5001)
|
||||
except ipfsapi.exceptions.ConnectionError:
|
||||
print("Unable to connect to the ipfs daemon")
|
||||
+1
-7
@@ -25,7 +25,7 @@ import logging
|
||||
|
||||
class Storage:
|
||||
"""
|
||||
Helper class to standardize storage
|
||||
Helper class to simplify storage
|
||||
"""
|
||||
def __init__(self, settings: dict):
|
||||
self.settings = settings
|
||||
@@ -36,9 +36,3 @@ class Storage:
|
||||
module = importlib.import_module("storage.ipfs.engine")
|
||||
self.engine = module.Engine(settings)
|
||||
|
||||
def make_thread(self):
|
||||
"""
|
||||
Make a new thread
|
||||
:return:
|
||||
"""
|
||||
pass
|
||||
Reference in new issue
Block a user