Skip to content

Commit

Permalink
Add add{Str,Bytes}Sync in the ipfs dweb channel
Browse files Browse the repository at this point in the history
[appimage]
[flatpak]
[docker-x11]
[deploy]
  • Loading branch information
cipres authored and cipres committed May 2, 2022
1 parent c316ec7 commit 09b282f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
4 changes: 1 addition & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@ release:
--assets-link \
"{\"name\" :\"${NSI_FILENAME}\", \"filepath\": \"/${NSI_FILEPATH}\", \"url\": \"${NSI_ASSET_URL}\"}" \
--assets-link \
"{\"name\" :\"${FLATPAK_REPO_FILENAME}\", \"filepath\": \"/${FLATPAK_REPO_FILENAME}\", \"url\": \"${FLATPAK_REPO_ASSET_URL}\"}" \
--assets-link \
"{\"name\" :\"${FLATPAK_FILENAME}\", \"filepath\": \"/${FLATPAK_X64_BRANCH_LATEST}\", \"url\": \"${FLATPAK_ASSET_URL}\"}"
"{\"name\" :\"${FLATPAK_REPO_FILENAME}\", \"filepath\": \"/${FLATPAK_REPO_FILENAME}\", \"url\": \"${FLATPAK_REPO_ASSET_URL}\"}"
fi
docker_x11vnc:
Expand Down
22 changes: 18 additions & 4 deletions galacteek/dweb/channels/ipfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ async def add(self, path, options):

return await self.a_addFromPath(ipfsop, path, opts)

@opSlot(str)
async def addStr(self, data):
async def __addString(self, data):
ipfsop = self.app.ipfsOperatorForLoop()

try:
Expand All @@ -142,8 +141,15 @@ async def addStr(self, data):
else:
return entry

@opSlot(QByteArray)
async def addBytes(self, data):
@opSlot(str)
async def addStr(self, data):
return await self.__addString(data)

@tcSlot(str)
async def addStrSync(self, data):
return await self.__addString(data)

async def __addBytes(self, data):
ipfsop = self.app.ipfsOperatorForLoop()

try:
Expand All @@ -154,6 +160,14 @@ async def addBytes(self, data):
else:
return entry

@opSlot(QByteArray)
async def addBytes(self, data):
return await self.__addBytes(data)

@tcSlot(QByteArray)
async def addBytesSync(self, data):
return await self.__addBytes(data)

@tcSlot(QJsonValue)
async def addJson(self, obj):
ipfsop = self.app.ipfsOperatorForLoop()
Expand Down

0 comments on commit 09b282f

Please sign in to comment.