Skip to content

Commit

Permalink
Merge pull request #179 from mottosso/master
Browse files Browse the repository at this point in the history
1.1.0
  • Loading branch information
mottosso committed Jun 4, 2015
2 parents ca61d87 + ee44343 commit 1120820
Show file tree
Hide file tree
Showing 61 changed files with 3,061 additions and 2,071 deletions.
4 changes: 3 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ source = pyblish
[report]
include = *pyblish*
omit =
*/vendor*
*/vendor*
*/tests*
*/run_*
38 changes: 38 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,44 @@ pyblish Changelog

This contains all major version changes between pyblish releases.

Version 1.1.0
-------------

- Feature: Dependency Injection (see #127)
- Feature: SimplePlugin (see #186)
- Feature: In-memory plug-ins (see #140)
- Feature: Custom test (see #183)
- Feature: create_instance(name, **kwargs) (see #187)
- Preview: Asset (see #188)
- Enhancement: Logic unified between pyblish.util and pyblish.cli
- Bugfix: Order now works with pyblish.util and pyblish.cli (see #178)
- Standardised time format (see #181)
- pyblish.util minified. For data visualisation, refer to pyblish-qml
- Bugfix: True singleton configuration (see #182)
- Added pyblish.lib.ItemList
- API: Added Plugin.label
- API: Added Plugin.active
- API: Added pyblish.api.register_test()
- API: Added pyblish.api.deregister_test()
- API: Added pyblish.api.registered_test()
- API: Added pyblish.api.plugins_by_instance()
- API: New defaults for `hosts` and `families` of plug-ins. (see #176)
- API: Added pyblish.api.register_plugin()
- API: Added pyblish.api.deregister_plugin()
- API: Added pyblish.api.registered_plugins()
- API: Added pyblish.api.deregister_all_plugins()
- API: Added pyblish.api.register_service()
- API: Added pyblish.api.deregister_service()
- API: Added pyblish.api.registered_services()
- API: Added pyblish.api.deregister_all_services()
- API: Renamed pyblish.api.sort() to pyblish.api.sort_plugins(), original deprecated
- API: Renamed pyblish.api.deregister_all -> deregister_all_paths, original deprecated
- BACKWARD INCOMPATIBLE You can no longer use both process_instance and process_context in the same plug-in; process_instance takes precedence.
- BACKWARD INCOMPATIBLE Removed Extractor.compute_commit_dir
- BACKWARD INCOMPATIBLE Removed Extractor.commit
- BACKWARD INCOMPATIBLE Removed validate_naming_convention plug-in
- Known issue: pyblish.logic.process.next_plugin yields wrong result

Version 1.0.16
--------------

Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build_script:
- run_coverage.py
12 changes: 4 additions & 8 deletions pyblish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
Attributes:
config: Currently active instance of configuration.
manager: Currently active plug-in manager.
_registered_paths: Currently registered plug-in paths.
_registered_plugins: Currently registered plug-ins.
"""

from .version import *


config = {}
manager = None

_registered_paths = list()


def is_initialized():
return True if config else False
_registered_plugins = dict()
_registered_services = dict()
_registered_test = None
170 changes: 121 additions & 49 deletions pyblish/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,162 @@
This way, we as developers are free to refactor the library
without breaking any of your tools.
.. note:: Don't use this in any other module internal to Pyblish
or a cyclic dependency will be created. This is only to be used
by end-users of the library and from integrations/extensions
of Pyblish.
.. note:: Contributors, don't use this in any other module internal
to Pyblish or a cyclic dependency will be created. This is only
to be used by end-users of the library and from
integrations/extensions of Pyblish.
"""

from __future__ import absolute_import

import logging
import getpass
import pyblish

from .plugin import (
Context, Instance, discover,
Selector, Validator, Extractor, Conformer,
plugin_paths, register_plugin_path,
deregister_plugin_path, deregister_all,
registered_paths, environment_paths, configured_paths,
plugins_by_family, plugins_by_host, instances_by_plugin,
current_host, sort)

from .plugin import Config as __Config
from .plugin import sort as sort_plugins

from .lib import log, format_filename
Context,
Instance,
Asset,
Plugin,
Selector,
Validator,
Extractor,
Conformer,
Integrator, # Alias
Collector, # Alias
Config as __Config,
discover,

register_plugin,
deregister_plugin,
deregister_all_plugins,
registered_plugins,

plugin_paths,
register_plugin_path,
deregister_plugin_path,
deregister_all_paths,

register_service,
deregister_service,
deregister_all_services,
registered_services,

sort as sort_plugins,

registered_paths,
environment_paths,
configured_paths,
current_host,
)

from .lib import (
log,
time as __time,
format_filename,
)

from .logic import (
plugins_by_family,
plugins_by_host,
plugins_by_instance,
instances_by_plugin,
register_test,
deregister_test,
registered_test,
default_test as __default_test,
)

from .error import (
PyblishError, SelectionError, ValidationError,
ExtractionError, ConformError, NoInstancesError)

# Aliases
# For forwards-compatibility
Collector = Selector
Integrator = Conformer

# Initialise log
__formatter = logging.Formatter("%(levelname)s - %(message)s")
__handler = logging.StreamHandler()
__handler.setFormatter(__formatter)
__log = logging.getLogger("pyblish")
__log.propagate = True
__log.handlers[:] = []
__log.addHandler(__handler)
__log.setLevel(logging.DEBUG)

if not pyblish.is_initialized():
try:
pyblish.config = __Config()
except Exception as e:
__log.debug("Exception: %s" % e)
__log.warning("Something went wrong whilst "
"initializing configuration")

config = pyblish.config
PyblishError,
SelectionError,
ValidationError,
ExtractionError,
ConformError,
NoInstancesError
)

from .compat import (
deregister_all,
sort,
)


version = pyblish.version
config = __Config()


def __init__():
# Register default services
register_service("time", __time)
register_service("user", getpass.getuser())
register_service("config", config)
register_service("context", None)
register_service("instance", None)

# Register default test
register_test(__default_test)

__init__()


__all__ = [
# Base objects
"Context",
"Instance",
"Asset",

# Plug-ins
"Plugin",

# SVEC plug-ins
"Collector",
"Selector",
"Validator",
"Extractor",
"Conformer",
"Integrator",

# Plug-in utilities
"discover",

"plugin_paths",
"registered_paths",
"configured_paths",
"environment_paths",

"register_plugin",
"deregister_plugin",
"deregister_all_plugins",
"registered_plugins",

"register_service",
"deregister_service",
"deregister_all_services",
"registered_services",

"register_plugin_path",
"deregister_plugin_path",
"deregister_all",
"deregister_all_paths",

"register_test",
"deregister_test",
"registered_test",

"plugins_by_family",
"plugins_by_host",
"plugins_by_instance",
"instances_by_plugin",

"sort_plugins",
"format_filename",
"current_host",
"sort",
"sort_plugins",

# Configuration
"config",
"version",

# Decorators
# Utilities
"log",

# Exceptions
Expand All @@ -103,5 +171,9 @@
"ValidationError",
"ExtractionError",
"ConformError",
"NoInstancesError"
"NoInstancesError",

# Compatibility
"deregister_all",
"sort",
]
Loading

0 comments on commit 1120820

Please sign in to comment.