Skip to content

Commit

Permalink
get stream via client
Browse files Browse the repository at this point in the history
  • Loading branch information
KatKatKateryna committed Dec 4, 2023
1 parent bfcfdd2 commit b47fadc
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions speckle_qgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
import sip

from specklepy.core.api import operations
from specklepy.logging.exceptions import SpeckleException, GraphQLException, SpeckleInvalidUnitException
from specklepy.logging.exceptions import (
SpeckleException,
GraphQLException,
SpeckleInvalidUnitException,
)
from specklepy.core.api.models import Stream, Branch, Commit
from specklepy.core.api.wrapper import StreamWrapper
from specklepy.objects import Base
Expand Down Expand Up @@ -487,10 +491,10 @@ def onSend(self, message: str):

units = str(QgsUnitTypes.encodeUnit(projectCRS.mapUnits()))
self.dataStorage.latestActionUnits = units
try:
try:
units = get_units_from_string(units)
except SpeckleInvalidUnitException:
units = 'none'
units = "none"
self.dataStorage.currentUnits = units

if (
Expand Down Expand Up @@ -1066,7 +1070,10 @@ def run(self):
import requests

# if the standard QGIS libraries are used
if (urllib3.__version__ == "1.25.11" and requests.__version__ == "2.24.0") or (urllib3.__version__.startswith("1.24.") and requests.__version__.startswith("2.23.")):
if (urllib3.__version__ == "1.25.11" and requests.__version__ == "2.24.0") or (
urllib3.__version__.startswith("1.24.")
and requests.__version__.startswith("2.23.")
):
logToUser(
"Dependencies versioning error.\nClick here for details.",
url="dependencies_error",
Expand Down Expand Up @@ -1251,7 +1258,10 @@ def handleStreamAdd(self, objectPacked: Tuple):
index = 0

self.dataStorage.check_for_accounts()
stream = tryGetStream(sw, self.dataStorage, False, self.dockwidget)
stream = sw.get_client().stream.get(
id=sw.stream_id, branch_limit=100, commit_limit=100
)
# stream = tryGetStream(sw, self.dataStorage, False, self.dockwidget)
# print(stream)

if stream is not None and branch in stream.branches.items:
Expand Down

0 comments on commit b47fadc

Please sign in to comment.