-
Notifications
You must be signed in to change notification settings - Fork 129
[draft] convert premiere to pype2 #92
[draft] convert premiere to pype2 #92
Conversation
@@ -0,0 +1,138 @@ | |||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'os' imported but unused
self._sentry_logging_handler = None | ||
self._database = None | ||
self._is_installed = False | ||
self.Session = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
over-indented
@@ -0,0 +1,2 @@ | |||
from .publishing import PUBLISH_PATHS | |||
from .lib import AdobeRestApi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'.lib.AdobeRestApi' imported but unused
@@ -0,0 +1,2 @@ | |||
from .publishing import PUBLISH_PATHS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'.publishing.PUBLISH_PATHS' imported but unused
} | ||
|
||
for (var key in arguments) { | ||
var string_key = '{' + key + '}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
_pype.displayError('Data comming from `{url}` are not correct'.format({url: url})); | ||
callback(null) | ||
} | ||
}).catch(err => _pype.displayError('Data comming from `{url}` are not correct.\n\nError: {error}'.format({url: url, error: err}))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
callback(json.data); | ||
} else { | ||
_pype.displayError('Data comming from `{url}` are not correct'.format({url: url})); | ||
callback(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
} catch (e) { | ||
return res.text(); | ||
} | ||
}).then(json => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
_pype.displayResult('options: ' + JSON.stringify(options)); | ||
|
||
// send post request to rest api server | ||
fetch(url, options).then(res => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
import json | ||
import bson | ||
import bson.json_util | ||
from pype.services.rest_api import RestApi, abort, CallbackResult |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'pype.services.rest_api.abort' imported but unused
import re | ||
import json | ||
import bson | ||
import bson.json_util |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'bson.json_util' imported but unused
@@ -0,0 +1,48 @@ | |||
import os | |||
import re | |||
import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'json' imported but unused
@@ -0,0 +1,48 @@ | |||
import os | |||
import re |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
're' imported but unused
*/ | ||
getApiServerUrl: function () { | ||
var url = _pype.ENV.PYPE_REST_API_URL; | ||
return url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
_pype.csi.evalScript('$.pype.encodeRepresentation(' + JSON.stringify(request) + ');', function (result) { | ||
// create json for pyblish | ||
const jsonfile = require('jsonfile'); | ||
const fs = require('fs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
||
_pype.csi.evalScript('$.pype.encodeRepresentation(' + JSON.stringify(request) + ');', function (result) { | ||
// create json for pyblish | ||
const jsonfile = require('jsonfile'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
// copy project file to stagingDir | ||
_pype.csi.evalScript('$.pype.getProjectFileData();', function (result) { | ||
const path = require('path'); | ||
const fs = require('fs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
||
// copy project file to stagingDir | ||
_pype.csi.evalScript('$.pype.getProjectFileData();', function (result) { | ||
const path = require('path'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
const mkdirp = require('mkdirp'); | ||
const os = require('os'); | ||
const path = require('path'); | ||
const UUID = require('pure-uuid'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
__import__("pype.premiere") | ||
__import__("pyblish") | ||
|
||
except ImportError as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__import__()
can return in some cases ValueError
on python < 3.9. See (https://bugs.python.org/issue37444)
outdated merged locally into #100 |
This description is WIP..
dependent repository: ynput/pype-config#19
resources:
https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_9.x/Documentation/CEP%209.0%20HTML%20Extension%20Cookbook.md
https://github.com/Adobe-CEP/Samples/tree/master/PProPanel
https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_7.x/CEP_7.0_HTML_Extension_Cookbook.pdf