-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce the code base and remove legacy code
These changes are to help with maintaining the project. Many API methods have been changed and removed, so the major version will be changed to 2+. - Remove library class - Remove libraries menu - Remove settings module - Remove metafile module - Remove analytics module - Remove settingsDialog class - Remove the hcolorbar widget - Remove metafile methods from libraryItem - Remove studiolibrarymaya support for the .list and .dict formats - Remove studiolibrary.window, studiolibrary.library and studiolibrary.libraries method - Rename example1 to examples - Merge the utils module and the api module to cmds.py - Add support for relative paths in the database - Add better support for renaming paths in the database - Add a new example for creating a custom library widget - Fix mirrortable error when no mirrortable was found - Fix methods shadowing each other in the combinedwidget
- Loading branch information
Showing
170 changed files
with
1,666 additions
and
5,165 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,17 +19,15 @@ | |
__encoding__ = sys.getfilesystemencoding() | ||
|
||
_resource = None | ||
_analytics = None | ||
|
||
|
||
PATH = unicode(os.path.abspath(__file__), __encoding__) | ||
DIRNAME = os.path.dirname(PATH).replace('\\', '/') | ||
PACKAGES_PATH = DIRNAME + "/packages" | ||
RESOURCE_PATH = DIRNAME + "/gui/resource" | ||
DIRNAME = os.path.dirname(PATH) | ||
PACKAGES_PATH = os.path.join(DIRNAME, "packages") | ||
RESOURCE_PATH = os.path.join(DIRNAME, "resource") | ||
HELP_URL = "http://www.studiolibrary.com" | ||
|
||
HOME_PATH = os.getenv('APPDATA') or os.getenv('HOME') | ||
LIBRARIES_PATH = HOME_PATH + "/StudioLibrary/Libraries" | ||
|
||
LIBRARY_WIDGET_CLASS = None | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
|
||
def setup(path): | ||
|
@@ -42,7 +40,6 @@ def setup(path): | |
:rtype: None | ||
""" | ||
if os.path.exists(path) and path not in sys.path: | ||
print 'Adding "{path}" to the sys.path'.format(path=path) | ||
sys.path.append(path) | ||
|
||
|
||
|
@@ -51,22 +48,12 @@ def setup(path): | |
|
||
import studioqt | ||
|
||
from studiolibrary.main import main | ||
|
||
from studiolibrary.core.utils import * | ||
from studiolibrary.core.metafile import MetaFile | ||
from studiolibrary.core.settings import Settings | ||
from studiolibrary.core.database import Database | ||
from studiolibrary.core.analytics import Analytics | ||
|
||
from studiolibrary.gui.librarywidget import LibraryWidget | ||
from studiolibrary.gui.previewwidget import PreviewWidget | ||
from studiolibrary.gui.librariesmenu import LibrariesMenu | ||
from studiolibrary.gui.settingsdialog import SettingsDialog | ||
from studiolibrary.cmds import * | ||
from studiolibrary.database import Database | ||
from studiolibrary.libraryitem import LibraryItem | ||
from studiolibrary.librarywidget import LibraryWidget | ||
|
||
from studiolibrary.api.cmds import * | ||
from studiolibrary.api.library import Library | ||
from studiolibrary.api.libraryitem import LibraryItem | ||
from studiolibrary.main import main | ||
|
||
|
||
def resource(): | ||
|
@@ -92,52 +79,6 @@ def version(): | |
return __version__ | ||
|
||
|
||
def analytics(): | ||
""" | ||
:rtype: studiolibrary.analytics.Analytics | ||
""" | ||
global _analytics | ||
|
||
if not _analytics: | ||
|
||
_analytics = Analytics( | ||
tid=Analytics.DEFAULT_ID, | ||
name="StudioLibrary", | ||
version=__version__ | ||
) | ||
|
||
_analytics.setEnabled(Analytics.ENABLED) | ||
return _analytics | ||
|
||
|
||
def windows(): | ||
""" | ||
Return a list of all the loaded library windows. | ||
:rtype: list[MainWindow] | ||
""" | ||
return Library.libraryWidgets() | ||
|
||
|
||
def library(name=None): | ||
""" | ||
Return a library by name. | ||
:type name: str | ||
:rtype: studiolibrary.Library | ||
""" | ||
return Library.instance(name) | ||
|
||
|
||
def libraries(): | ||
""" | ||
Return a list of the loaded libraries. | ||
:rtype: list[studiolibrary.Library] | ||
""" | ||
return Library.libraries() | ||
|
||
|
||
def loadFromCommand(): | ||
""" | ||
Triggered when the Studio Library is loaded from the command line. | ||
|
@@ -159,32 +100,8 @@ def loadFromCommand(): | |
main(name=name) | ||
|
||
|
||
def about(): | ||
""" | ||
Return a small description about the Studio Library. | ||
:rtype str | ||
""" | ||
msg = u""" | ||
------------------------------- | ||
Studio Library is a free python script for managing poses and animation in Maya. | ||
Comments, suggestions and bug reports are welcome. | ||
Version: {version} | ||
Package: {package} | ||
www.studiolibrary.com | ||
[email protected] | ||
-------------------------------- | ||
""" | ||
msg = msg.format(version=__version__, package=PATH) | ||
return msg | ||
|
||
|
||
from studiolibrary import config | ||
|
||
from studiolibrary import migrate | ||
migrate.migrate() | ||
|
||
if __name__ == "__main__": | ||
loadFromCommand() | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Hi @krathjen, de you/we need this at all? If you encourage developers to use their own custom widget?