From 09b282f8b2e798e272093754da6b61cced73c10e Mon Sep 17 00:00:00 2001 From: cipres Date: Tue, 3 May 2022 00:25:28 +0200 Subject: [PATCH] Add add{Str,Bytes}Sync in the ipfs dweb channel [appimage] [flatpak] [docker-x11] [deploy] --- .gitlab-ci.yml | 4 +--- galacteek/dweb/channels/ipfs.py | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b0cd2d45..24012722 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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: diff --git a/galacteek/dweb/channels/ipfs.py b/galacteek/dweb/channels/ipfs.py index cf6189d6..0cfbbcfe 100644 --- a/galacteek/dweb/channels/ipfs.py +++ b/galacteek/dweb/channels/ipfs.py @@ -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: @@ -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: @@ -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()