1
1
Fork 0

🏗️ Refactor mink/pink: mink now contains all internal modules, while pink is dedicated to API users

develop
corentin 10 months ago
parent fb825edb69
commit 9ce7986bb6
  1. 10
      apps/center/app.py
  2. 2
      apps/center/ui/admin/users/edit.py
  3. 2
      apps/explorer/hosted.py
  4. 28
      apps/launcher/app.py
  5. 2
      apps/launcher/ui/main.py
  6. 2
      apps/updater/app.py
  7. 6
      bip/deprecated/app.py
  8. 2
      bip/link/item.py
  9. 2
      bip/link/model.py
  10. 2
      bip/link/path.py
  11. 4
      bip/link/project.py
  12. 4
      bip/link/user.py
  13. 4
      bip/mink/__init__.py
  14. 2
      bip/mink/batches.py
  15. 2
      bip/mink/commands/__init__.py
  16. 6
      bip/mink/content.py
  17. 4
      bip/mink/env.py
  18. 0
      bip/mink/login.py
  19. 2
      bip/mink/plugins/__init__.py
  20. 0
      bip/mink/system.py
  21. 2
      bip/mink/tips.py
  22. 2
      bip/mink/update.py
  23. 5
      bip/pink/__init__.py
  24. 0
      bip/pink/context.py
  25. 4
      bip/sdk/app/main.py
  26. 2
      bip/sink/tools/connector.py
  27. 0
      bip/utils/converter.py
  28. 2
      builtins/commands/set_source.py
  29. 2
      plugins/hosts/maya_bip/utils/playblast.py

@ -2,8 +2,8 @@ import os
import subprocess
import argparse
from packaging import version
from bip import link, pink
from bip.pink.login import check as check_password, auth
from bip import link, mink
from bip.mink.login import check as check_password, auth
from bip.sdk.app import App, run
from bip.utils.versioning import get_remote_tags, get_remote_branches
from bip import compatibility_breakpoint
@ -111,21 +111,21 @@ class Center(App):
config.version_mode = data["mode"]
config.custom_branch = data["custom_branch"]
config.custom_tag = data["custom_tag"]
pink.system.update(config)
mink.system.update(config)
def save_database_system_config(self, data):
config = self.get_system_config()
config.version_mode = data["uri"]
config.custom_branch = data["user"]
config.custom_tag = data["password"]
pink.system.update(config)
mink.system.update(config)
def save_config_system_config(self, data):
config = self.get_system_config()
config.hostname = data["hostname"]
config.working_directory = data["working"]
config.content_directory = data["content"]
pink.system.update(config)
mink.system.update(config)
def save_user(self, user, data):
user.set_properties(data)

@ -5,7 +5,7 @@ from PySide2.QtCore import *
from bip.uink.library import *
from bip.uink.tools import Execute
from bip.uink.utils import Font
from bip.pink.content import get_default_password
from bip.mink.content import get_default_password
from bip.utils.formating import string_cleaner
from bip.sdk.app.decorators import error_handler

@ -1,9 +1,9 @@
from typing import Optional
from .api import Context
from .app import Explorer
from bip.sdk.app import run
from bip.sdk.plugin import Host
from bip.wink import HOSTED
from bip.pink import Context
from bip.uink.library import Dialog
app: Optional[Explorer] = None

@ -13,7 +13,7 @@ from PySide2.QtWidgets import QApplication
from bip.deprecated.app import BipApp
from bip import pink, link, mink
from bip import link, mink
from bip.wink.paths import changelogs_directory
from bip.wink import REFRESH_CONTENT, LATEST, TAG, BRANCH, RECOMMENDED
from bip.wink.exceptions import MissingConfig
@ -171,10 +171,10 @@ class Launcher(BipApp):
if not user:
raise ValueError("Username not found")
if not pink.login.check(user, password):
if not mink.login.check(user, password):
raise ValueError("Invalid password")
pink.login.auth(user)
mink.login.auth(user)
self.logger.info("User {} logged in".format(username))
return user
@ -183,7 +183,7 @@ class Launcher(BipApp):
self.logger.info("User {} logged out".format(self.current_user.username))
self.clear()
self.view.close()
pink.login.disconnect()
mink.login.disconnect()
self.load_server_config()
self.load_system_config()
self.start()
@ -204,14 +204,14 @@ class Launcher(BipApp):
# Set environment variables
self.splash.update_progress(10, "Updating environment variables")
pink.env.set_bip_environment_variables()
pink.env.set_custom_environment_variables()
mink.env.set_bip_environment_variables()
mink.env.set_custom_environment_variables()
# Update content
self.splash.update_progress(30, "Updating custom content")
if REFRESH_CONTENT:
mink.update.update_content()
pink.env.set_python_path()
mink.env.set_python_path()
self.splash.update_progress(60, "Loading GUI")
self.view = View(controller=self)
@ -297,7 +297,7 @@ class Launcher(BipApp):
self.server_config = link.config.get(autogen=False, force=force)
def load_system_config(self, force=False):
self.system_config = pink.system.get_config(force)
self.system_config = mink.system.get_config(force)
self.__version_mode = self.system_config.version_mode
@online
@ -347,9 +347,9 @@ class Launcher(BipApp):
@online
def update(self, force_recommended=False):
if force_recommended:
system_config = pink.system.get_config()
system_config = mink.system.get_config()
system_config.version_mode = RECOMMENDED
pink.system.update_config(system_config)
mink.system.update_config(system_config)
mink.start.updater()
self.quit()
@ -829,13 +829,13 @@ class Launcher(BipApp):
webbrowser.open(url)
def html_parser(self, html, path):
if "quick_start" in pink.content.get_links():
quick_start = pink.content.get_links()["quick_start"]
if "quick_start" in mink.content.get_links():
quick_start = mink.content.get_links()["quick_start"]
else:
quick_start = "#special-not-found"
if "documentation" in pink.content.get_links():
documentation = pink.content.get_links()["documentation"]
if "documentation" in mink.content.get_links():
documentation = mink.content.get_links()["documentation"]
else:
documentation = "#special-not-found"

@ -20,7 +20,7 @@ from .footer.internal_message import InternalMessage
from .footer.announcement import Announcement
from .footer.tips import Tips
from bip.wink.paths import icons_directory
from bip.pink.system import get_config
from bip.mink.system import get_config
from launcher.constants import IMAGES_PATH
from bip.wink.constants.utils import CURRENT_OS

@ -7,7 +7,7 @@ from updater.view import View
from updater.constants import *
from bip.link.config import get as get_server_config
from bip.utils.versioning import get_remote_tags, get_remote_branches
from bip.pink.system import get as get_system_config
from bip.mink.system import get as get_system_config
from bip.wink.constants import LATEST, TAG, BRANCH, DEFAULT_BRANCH, RECOMMENDED
from packaging import version
from bip.mink.update import update

@ -4,7 +4,7 @@ import os
import sys
from bip.wink.paths import stylesheets_directory, assets_directory, icons_directory
from bip import link, pink
from bip import link, mink
from bip.sink.tools.connector import Database
from bip.uink.library import Dialog
from bip.wink import STANDALONE, NEUTRAL, ERROR, WARNING, INFO, SUCCESS, DEBUG
@ -48,8 +48,8 @@ class BipApp:
self.user_settings = None
self.current_user = None
self._last_version_used = pink.login.get_latest_versions_used(self.name)
pink.login.set_latest_versions_used(self.name, self.version)
self._last_version_used = mink.login.get_latest_versions_used(self.name)
mink.login.set_latest_versions_used(self.name, self.version)
if self.requires_database:
if not self.is_database_responding():

@ -12,7 +12,7 @@ from . import component as _component
from . import group as _group
from . import tools as _tools
from bip.wink.constants.data import *
from bip.pink.content import execute_routine, CREATE
from bip.mink.content import execute_routine, CREATE
from .data import Data
from .group import Group
from bip.utils.formating import standardize_path

@ -2,7 +2,7 @@ import os
import glob
import yaml
from pathlib import Path
from bip.pink.system import get_config
from bip.mink.system import get_config
from bip.wink.paths import bip_root_directory
from bip.wink.constants import *
from . import metadata as _metadata

@ -1,7 +1,7 @@
import os
from pathlib import PurePath
from bip.wink import PROJECT, ITEM, COMPONENT, VERSION
from bip.pink.system import get_config
from bip.mink.system import get_config
from bip.utils.formating import standardize_path
from . import project as _project
from . import item as _item

@ -3,7 +3,7 @@ import os
from pathlib import Path
import json
from typing import List, Union, Optional, Dict, Tuple
from bip.pink.system import get_config
from bip.mink.system import get_config
from bip import sink
from bip import mink
from bip.utils.formating import string_cleaner
@ -17,7 +17,7 @@ from . import task as _task
from . import metadata as _metadata
from . import model as _model
from bip.wink.constants.data import *
from bip.pink.content import execute_routine, CREATE
from bip.mink.content import execute_routine, CREATE
from .data import Data
from .item import Item, ItemTag
from .task import TaskTag

@ -5,9 +5,9 @@ from bip.utils.password import generate_hash
from .tools.template import BipObject
from .tools.decorators import freeze, permission
from bip.utils.formating import slugify
from bip.pink.login import get as get_login
from bip.mink.login import get as get_login
from bip.wink import DATE_FORMAT
from bip.pink.content import execute_routine, CREATE
from bip.mink.content import execute_routine, CREATE
FORBIDDEN_CHARACTERS = " !@#$%^&*()=+\\][';/,<>?\":|}{}`~"

@ -10,3 +10,7 @@ from . import update
from . import connect
from . import plugins
from . import uninstall
from . import env
from . import login
from . import content
from . import system

@ -1,7 +1,7 @@
import os
import yaml
import platform
from bip.pink.system import get_config
from bip.mink.system import get_config
from bip.wink.paths import (
bip_root_directory,
local_batches_directory,

@ -1,5 +1,5 @@
import os
from bip.pink.system import get_config
from bip.mink.system import get_config
from bip.wink.paths import bip_root_directory
from .loader import Loader
from .normalizer import normalize, reset_args

@ -2,8 +2,8 @@ import yaml
import os
import importlib.util
from bip import pink
from bip.pink.system import get_config
from bip import mink
from bip.mink.system import get_config
# Routine modes
CREATE = "create"
@ -61,7 +61,7 @@ def execute_routine(name, mode=None, *args, **kwargs):
if not mode:
mode = MAIN
pink.env.set_bip_environment_variables()
mink.env.set_bip_environment_variables()
name = f"bip_routines.{name}"
spec = importlib.util.spec_from_file_location(name, script)

@ -3,7 +3,7 @@ import sys
import yaml
from string import Template
from bip import __version__
from bip.pink.system import get_config, current_branch
from bip.mink.system import get_config, current_branch
from bip.wink.paths.utils import (
package_directory,
integrations_directory,
@ -15,7 +15,7 @@ from bip.wink.paths.utils import (
dcc_libs,
)
from bip.wink.paths import icons_directory, config_file, auth_file, user_directory
from bip.pink.content import get_env
from bip.mink.content import get_env
from bip import link

@ -1,5 +1,5 @@
from pathlib import Path
from bip.pink.system import get_config
from bip.mink.system import get_config
from bip.wink.paths import plugins_directory
from bip.wink import HOST, TRACKER
from .loader import load, scan

@ -1,7 +1,7 @@
import yaml
import os
import random
from bip.pink.system import get_config
from bip.mink.system import get_config
def get():

@ -14,7 +14,7 @@ from bip.wink.paths import installed_dependencies_file
from bip.utils.versioning import get_latest_hash, get_remote_branches
from bip.wink.constants import TAG, BRANCH, RECOMMENDED, DEFAULT_BRANCH
from git import Repo
from bip.pink.system import (
from bip.mink.system import (
get as get_system_config,
update as update_system_config,
)

@ -1,4 +1 @@
from . import content
from . import env
from . import login
from . import system
from .context import Context

@ -1,6 +1,6 @@
import sys
import bip.sink.utils
from bip import link, pink
from bip import link, mink
from bip.uink.app import BipWindow
from bip.uink.library import Dialog
from bip.wink import HOSTED, STANDALONE, NEUTRAL, ERROR, WARNING, INFO, SUCCESS, BOTTOM
@ -370,7 +370,7 @@ class App:
return link.config.get(autogen=False)
def get_system_config(self):
return pink.system.get()
return mink.system.get()
def get_models(self):
return link.model.get()

@ -1,7 +1,7 @@
import yaml
from neo4j import GraphDatabase
from neo4j.exceptions import ServiceUnavailable, AuthError
from bip.pink.system import get_config
from bip.mink.system import get_config
from bip.link import logger
from bip.utils.decorators import singleton

@ -1,7 +1,7 @@
from bip.mink.commands.constants import OK, SUCCESS, MISSING_ARGS
from bip.wink.constants import LATEST, TAG, BRANCH, RECOMMENDED
from bip.link.config import get as get_server_config
from bip.pink.system import (
from bip.mink.system import (
get as get_system_config,
update as update_system_config,
)

@ -1,5 +1,5 @@
import os
from bip.mink.converter import Converter
from bip.utils.converter import Converter
import maya.cmds as cmds
import maya.mel as mel

Loading…
Cancel
Save