diff --git a/blender_cloud/blender.py b/blender_cloud/blender.py index e48100f..919f843 100644 --- a/blender_cloud/blender.py +++ b/blender_cloud/blender.py @@ -180,8 +180,7 @@ class BlenderCloudPreferences(AddonPreferences): if bss.level == 'SUBSCRIBE': self.draw_subscribe_button(sub) - else: - self.draw_sync_buttons(sub, bss) + self.draw_sync_buttons(sub, bss) # Image Share stuff share_box = layout.box() diff --git a/blender_cloud/image_sharing.py b/blender_cloud/image_sharing.py index 948f694..57ea728 100644 --- a/blender_cloud/image_sharing.py +++ b/blender_cloud/image_sharing.py @@ -138,7 +138,7 @@ class PILLAR_OT_image_share(pillar.PillarOperatorMixin, async def share_image(self, context): """Sends files to the Pillar server.""" - self.report({'INFO'}, 'Uploading %s %s' % (self.target.lower(), self.name)) + self.report({'INFO'}, "Uploading %s '%s'" % (self.target.lower(), self.name)) if self.target == 'FILE': node = await self.upload_file(self.name) else: diff --git a/blender_cloud/settings_sync.py b/blender_cloud/settings_sync.py index d065f87..d80f5e4 100644 --- a/blender_cloud/settings_sync.py +++ b/blender_cloud/settings_sync.py @@ -343,10 +343,18 @@ class PILLAR_OT_sync(pillar.PillarOperatorMixin, return self.bss_report({'INFO'}, 'Uploading %s' % fname) - await pillar.attach_file_to_group(path, - self.home_project_id, - self.sync_group_versioned_id, - self.user_id) + try: + await pillar.attach_file_to_group(path, + self.home_project_id, + self.sync_group_versioned_id, + self.user_id) + except sdk_exceptions.RequestEntityTooLarge as ex: + self.log.error('File too big to upload: %s' % ex) + self.log.error('To upload larger files, please subscribe to Blender Cloud.') + self.bss_report({'SUBSCRIBE'}, 'File %s too big to upload. ' + 'Subscribe for unlimited space.' % fname) + self._state = 'QUIT' + return await self.action_refresh(context)