Open browser at the short URL.
This commit is contained in:
parent
4da601be0c
commit
a9aa961b92
@ -6,8 +6,7 @@ import bpy
|
|||||||
import pillarsdk
|
import pillarsdk
|
||||||
from pillarsdk import exceptions as sdk_exceptions
|
from pillarsdk import exceptions as sdk_exceptions
|
||||||
from .pillar import pillar_call
|
from .pillar import pillar_call
|
||||||
from . import async_loop, pillar, home_project
|
from . import async_loop, pillar, home_project, blender
|
||||||
from .blender import PILLAR_WEB_SERVER_URL, preferences
|
|
||||||
|
|
||||||
REQUIRES_ROLES_FOR_IMAGE_SHARING = {'subscriber', 'demo'}
|
REQUIRES_ROLES_FOR_IMAGE_SHARING = {'subscriber', 'demo'}
|
||||||
IMAGE_SHARING_GROUP_NODE_NAME = 'Image sharing'
|
IMAGE_SHARING_GROUP_NODE_NAME = 'Image sharing'
|
||||||
@ -175,16 +174,13 @@ class PILLAR_OT_image_share(pillar.PillarOperatorMixin,
|
|||||||
|
|
||||||
return node
|
return node
|
||||||
|
|
||||||
async def maybe_open_browser(self, node_id):
|
async def maybe_open_browser(self, url):
|
||||||
prefs = preferences()
|
prefs = blender.preferences()
|
||||||
if not prefs.open_browser_after_share:
|
if not prefs.open_browser_after_share:
|
||||||
return
|
return
|
||||||
|
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import urllib.parse
|
|
||||||
|
|
||||||
url = urllib.parse.urljoin(PILLAR_WEB_SERVER_URL,
|
|
||||||
'/p/%s/%s' % (self.home_project_url, node_id))
|
|
||||||
self.log.info('Opening browser at %s', url)
|
self.log.info('Opening browser at %s', url)
|
||||||
webbrowser.open_new_tab(url)
|
webbrowser.open_new_tab(url)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user