Merge remote-tracking branch 'origin/develop' into dev/panoramaFisheye

This commit is contained in:
Fabien Castan 2020-03-26 13:56:51 +01:00
commit 2f17e9aa80
7 changed files with 185 additions and 65 deletions

View file

@ -221,31 +221,31 @@ Upload a textured mesh on Sketchfab.
return self._stopped
def processChunk(self, chunk):
self._stopped = False
chunk.logManager.waitUntilCleared()
chunk.logger.setLevel(chunk.logManager.textToLevel(chunk.node.verboseLevel.value))
if not chunk.node.inputFiles:
chunk.logger.warning('Nothing to upload')
return
if chunk.node.apiToken.value == '':
chunk.logger.error('Need API token.')
raise RuntimeError()
if len(chunk.node.title.value) > 48:
chunk.logger.error('Title cannot be longer than 48 characters.')
raise RuntimeError()
if len(chunk.node.description.value) > 1024:
chunk.logger.error('Description cannot be longer than 1024 characters.')
raise RuntimeError()
tags = [ i.value.replace(' ', '-') for i in chunk.node.tags.value.values() ]
if all(len(i) > 48 for i in tags) and len(tags) > 0:
chunk.logger.error('Tags cannot be longer than 48 characters.')
raise RuntimeError()
if len(tags) > 42:
chunk.logger.error('Maximum of 42 separate tags.')
raise RuntimeError()
try:
self._stopped = False
chunk.logManager.start(chunk.node.verboseLevel.value)
uploadFile = ''
if not chunk.node.inputFiles:
chunk.logger.warning('Nothing to upload')
return
if chunk.node.apiToken.value == '':
chunk.logger.error('Need API token.')
raise RuntimeError()
if len(chunk.node.title.value) > 48:
chunk.logger.error('Title cannot be longer than 48 characters.')
raise RuntimeError()
if len(chunk.node.description.value) > 1024:
chunk.logger.error('Description cannot be longer than 1024 characters.')
raise RuntimeError()
tags = [ i.value.replace(' ', '-') for i in chunk.node.tags.value.values() ]
if all(len(i) > 48 for i in tags) and len(tags) > 0:
chunk.logger.error('Tags cannot be longer than 48 characters.')
raise RuntimeError()
if len(tags) > 42:
chunk.logger.error('Maximum of 42 separate tags.')
raise RuntimeError()
data = {
'name': chunk.node.title.value,
'description': chunk.node.description.value,
@ -281,5 +281,7 @@ Upload a textured mesh on Sketchfab.
os.remove(uploadFile)
chunk.logger.debug('Deleted {}'.format(uploadFile))
chunk.logManager.end()
def stopProcess(self, chunk):
self._stopped = True