mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added app definition for push to project
This commit is contained in:
parent
3650ac489a
commit
3eed7b8de0
3 changed files with 41 additions and 60 deletions
41
openpype/tools/push_to_project/app.py
Normal file
41
openpype/tools/push_to_project/app.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import click
|
||||
from qtpy import QtWidgets, QtCore
|
||||
|
||||
from openpype.tools.push_to_project.window import PushToContextSelectWindow
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.option("--project", help="Source project name")
|
||||
@click.option("--version", help="Source version id")
|
||||
def main(project, version):
|
||||
"""Run PushToProject tool to integrate version in different project.
|
||||
|
||||
Args:
|
||||
project (str): Source project name.
|
||||
version (str): Version id.
|
||||
"""
|
||||
|
||||
app = QtWidgets.QApplication.instance()
|
||||
if not app:
|
||||
# 'AA_EnableHighDpiScaling' must be set before app instance creation
|
||||
high_dpi_scale_attr = getattr(
|
||||
QtCore.Qt, "AA_EnableHighDpiScaling", None
|
||||
)
|
||||
if high_dpi_scale_attr is not None:
|
||||
QtWidgets.QApplication.setAttribute(high_dpi_scale_attr)
|
||||
|
||||
app = QtWidgets.QApplication([])
|
||||
|
||||
attr = getattr(QtCore.Qt, "AA_UseHighDpiPixmaps", None)
|
||||
if attr is not None:
|
||||
app.setAttribute(attr)
|
||||
|
||||
window = PushToContextSelectWindow()
|
||||
window.show()
|
||||
window.controller.set_source(project, version)
|
||||
|
||||
app.exec_()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -1135,28 +1135,3 @@ class ProjectPushItemProcess:
|
|||
|
||||
finally:
|
||||
self._status.set_finished()
|
||||
|
||||
|
||||
def main():
|
||||
# NOTE For development purposes
|
||||
project_name = ""
|
||||
version_id = ""
|
||||
dst_project_name = ""
|
||||
dst_asset_id = ""
|
||||
dst_task_name = ""
|
||||
version = None
|
||||
variant = ""
|
||||
comment = ""
|
||||
|
||||
item = ProjectPushItem(
|
||||
project_name,
|
||||
version_id,
|
||||
dst_project_name,
|
||||
dst_asset_id,
|
||||
dst_task_name,
|
||||
variant,
|
||||
version,
|
||||
dst_version=1
|
||||
)
|
||||
item_process = ProjectPushItemProcess(item)
|
||||
item_process.process()
|
||||
|
|
|
|||
|
|
@ -705,38 +705,3 @@ class PushToContextSelectWindow(QtWidgets.QWidget):
|
|||
|
||||
def _on_select_click(self):
|
||||
self._controller.submit()
|
||||
|
||||
|
||||
def main():
|
||||
app = QtWidgets.QApplication.instance()
|
||||
if not app:
|
||||
# 'AA_EnableHighDpiScaling' must be set before app instance creation
|
||||
high_dpi_scale_attr = getattr(
|
||||
QtCore.Qt, "AA_EnableHighDpiScaling", None
|
||||
)
|
||||
if high_dpi_scale_attr is not None:
|
||||
QtWidgets.QApplication.setAttribute(high_dpi_scale_attr)
|
||||
|
||||
app = QtWidgets.QApplication([])
|
||||
|
||||
for attr_name in (
|
||||
"AA_UseHighDpiPixmaps",
|
||||
):
|
||||
attr = getattr(QtCore.Qt, attr_name, None)
|
||||
if attr is not None:
|
||||
app.setAttribute(attr)
|
||||
|
||||
# TODO find way how to get these
|
||||
project_name = None
|
||||
version_id = None
|
||||
|
||||
# Show window dialog
|
||||
window = PushToContextSelectWindow()
|
||||
window.controller.set_source(project_name, version_id)
|
||||
window.show()
|
||||
|
||||
app.exec_()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue