Merge develop into main

This commit is contained in:
pypebot 2021-06-07 09:51:44 +02:00 committed by GitHub
commit 228ba50e29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 26 deletions

View file

@ -20,4 +20,4 @@ jobs:
type: now
from_branch: develop
target_branch: main
github_token: ${{ secrets.TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -590,16 +590,21 @@ class MongoSettingsHandler(SettingsHandler):
attributes[key] = value
project_doc_config = project_doc.get("config") or {}
app_names = set()
if "apps" in project_doc_config:
for app_item in project_doc_config.pop("apps"):
if not project_doc_config or "apps" not in project_doc_config:
set_applications = False
else:
set_applications = True
for app_item in project_doc_config["apps"]:
if not app_item:
continue
app_name = app_item.get("name")
if app_name:
app_names.add(app_name)
attributes["applications"] = list(app_names)
if set_applications:
attributes["applications"] = list(app_names)
output = {"attributes": attributes}
for key in self.anatomy_keys:

View file

@ -313,6 +313,8 @@ QAbstractItemView {
border-radius: 0.2em;
background: {color:bg-view};
alternate-background-color: {color:bg-view-alternate};
/* Mac shows selection color on branches. */
selection-background-color: transparent;
}
QAbstractItemView:disabled{
@ -344,30 +346,35 @@ QAbstractItemView::item:selected:hover {
background: {color:bg-view-selection-hover};
}
/* Row colors (alternate colors) are from left - right */
QAbstractItemView:branch {
background: transparent;
}
QAbstractItemView::branch:open:has-children:!has-siblings,
QAbstractItemView::branch:open:has-children:has-siblings {
border-image: none;
image: url(:/openpype/images/branch_open.png);
background: {color:bg-view};
background: transparent;
}
QAbstractItemView::branch:open:has-children:!has-siblings:hover,
QAbstractItemView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url(:/openpype/images//branch_open_on.png);
/* background: {color:bg-view-hover}; */
background: transparent;
}
QAbstractItemView::branch:has-children:!has-siblings:closed,
QAbstractItemView::branch:closed:has-children:has-siblings {
border-image: none;
image: url(:/openpype/images//branch_closed.png);
background: {color:bg-view};
background: transparent;
}
QAbstractItemView::branch:has-children:!has-siblings:closed:hover,
QAbstractItemView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url(:/openpype/images//branch_closed_on.png);
/* background: {color:bg-view-hover}; */
background: transparent;
}
/* Progress bar */

View file

@ -1,7 +1,6 @@
import collections
import copy
import json
from queue import Queue
from uuid import uuid4
from .constants import (
@ -160,6 +159,10 @@ class HierarchyModel(QtCore.QAbstractItemModel):
if self._current_project == project_name and not force:
return
# Reset attributes
self._items_by_id.clear()
self._asset_items_by_name.clear()
self.clear()
self._current_project = project_name
@ -219,13 +222,13 @@ class HierarchyModel(QtCore.QAbstractItemModel):
parent_id = asset_doc["data"].get("visualParent")
asset_docs_by_parent_id[parent_id].append(asset_doc)
appending_queue = Queue()
appending_queue.put((None, project_item))
appending_queue = collections.deque()
appending_queue.append((None, project_item))
asset_items_by_id = {}
non_modifiable_items = set()
while not appending_queue.empty():
parent_id, parent_item = appending_queue.get()
while appending_queue:
parent_id, parent_item = appending_queue.popleft()
asset_docs = asset_docs_by_parent_id.get(parent_id) or []
new_items = []
@ -242,19 +245,19 @@ class HierarchyModel(QtCore.QAbstractItemModel):
asset_items_by_id[asset_id] = new_item
# Add item to appending queue
appending_queue.put((asset_id, new_item))
appending_queue.append((asset_id, new_item))
if new_items:
self.add_items(new_items, parent_item)
# Handle Asset's that are not modifiable
# - pass the information to all it's parents
non_modifiable_queue = Queue()
non_modifiable_queue = collections.deque()
for item_id in non_modifiable_items:
non_modifiable_queue.put(item_id)
non_modifiable_queue.append(item_id)
while not non_modifiable_queue.empty():
item_id = non_modifiable_queue.get()
while non_modifiable_queue:
item_id = non_modifiable_queue.popleft()
item = self._items_by_id[item_id]
item.setData(False, HIERARCHY_CHANGE_ABLE_ROLE)
@ -264,7 +267,7 @@ class HierarchyModel(QtCore.QAbstractItemModel):
and parent.id not in non_modifiable_items
):
non_modifiable_items.add(parent.id)
non_modifiable_queue.put(parent.id)
non_modifiable_queue.append(parent.id)
# Add task items
for asset_id, asset_item in asset_items_by_id.items():
@ -380,6 +383,9 @@ class HierarchyModel(QtCore.QAbstractItemModel):
item_id = source_index.data(IDENTIFIER_ROLE)
item = self.items_by_id[item_id]
if isinstance(item, TaskItem):
item = item.parent()
if isinstance(item, (RootItem, ProjectItem)):
name = "ep"
new_row = None
@ -1127,18 +1133,18 @@ class HierarchyModel(QtCore.QAbstractItemModel):
project_name = project_item.name
project_col = self.dbcon.database[project_name]
to_process = Queue()
to_process.put(project_item)
to_process = collections.deque()
to_process.append(project_item)
bulk_writes = []
while not to_process.empty():
parent = to_process.get()
while to_process:
parent = to_process.popleft()
insert_list = []
for item in parent.children():
if not isinstance(item, AssetItem):
continue
to_process.put(item)
to_process.append(item)
if item.is_new:
insert_list.append(item)

View file

@ -234,16 +234,19 @@ class Window(QtWidgets.QDialog):
footer_button_stop = QtWidgets.QPushButton(
awesome["stop"], footer_widget
)
footer_button_stop.setToolTip("Stop publishing")
footer_button_reset = QtWidgets.QPushButton(
awesome["refresh"], footer_widget
)
footer_button_reset.setToolTip("Restart publishing")
footer_button_validate = QtWidgets.QPushButton(
awesome["flask"], footer_widget
)
footer_button_validate.setToolTip("Run validations")
footer_button_play = QtWidgets.QPushButton(
awesome["play"], footer_widget
)
footer_button_play.setToolTip("Publish")
layout = QtWidgets.QHBoxLayout()
layout.setContentsMargins(5, 5, 5, 5)
layout.addWidget(footer_info, 0)

View file

@ -46,10 +46,16 @@ install_requires = [
"httplib2",
# Harmony implementation
"filecmp",
"dns"
"dns",
# Python defaults (cx_Freeze skip them by default)
"dbm"
]
includes = []
# WARNING: As of cx_freeze there is a bug?
# when this is empty, its hooks will not kick in
# and won't clean platform irrelevant modules
# like dbm mentioned above.
excludes = [
"openpype"
]