This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 8bfdadb7f739f7eb614d3c4f427a3d075a0669a1 (commit) via 55afb5fd376150afe14f6388749547e07fc02c42 (commit) from 08e5a448761d5d3b25abcf1d42967458e8cdfa62 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/8bfdadb7f739f7eb614d3c4f427a3d075a066...
commit 8bfdadb7f739f7eb614d3c4f427a3d075a0669a1 Merge: 55afb5f 08e5a44 Author: Tomas Gavenciak gavento@ucw.cz Date: Tue Dec 25 03:28:02 2012 +0100
Merge branch 'master' of ssh://repo.or.cz/srv/git/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/55afb5fd376150afe14f6388749547e07fc02...
commit 55afb5fd376150afe14f6388749547e07fc02c42 Author: Tomas Gavenciak gavento@ucw.cz Date: Tue Dec 25 03:26:45 2012 +0100
loaders: pylib: cleanup and Context submodule
diff --git a/pylib/gfxprim/loaders/__init__.py b/pylib/gfxprim/loaders/__init__.py index 5dd476e..621099a 100644 --- a/pylib/gfxprim/loaders/__init__.py +++ b/pylib/gfxprim/loaders/__init__.py @@ -1,11 +1,31 @@ -from . import loaders_c +from . import c_loaders + + +def Load(filename, callback=None): + "Load image from given file, guessing the type." + c = c_loaders.GP_LoadImage(filename, callback) + return c +
def _init(module): + "Extend Context with loaders submodule" + + from ..utils import extend, add_swig_getmethod, add_swig_setmethod + from ..core import Context as _context + + class LoadersSubmodule(object): + def __init__(self, ctx): + self.ctx = ctx + + _context._submodules['loaders'] = LoadersSubmodule + + @extend(LoadersSubmodule) + def Save(self, filename, callback=None): + """Save the image, guessing the type from the extension.
- # Extend Context with convenience methods - from ._extend_context import extend_context - from ..core import Context - extend_context(Context) + Generally, not all pixel types work with all formats. + """ + c_loaders.GP_SaveImage(self.ctx, filename, callback)
# Imports from the SWIG module import re @@ -14,11 +34,13 @@ def _init(module):
# Import functions from the SWIG module from ..utils import import_members - import_members(loaders_c, module, sub=strip_GP, - exclude=[ - '^w+_swigregister$', - '^gfxprim$', - '^_w+$']) + import_members(c_loaders, module, sub=strip_GP, + include=[ + '^GP_Load[A-Z]{3}.*', + '^GP_Save[A-Z]{3}.*', + '^GP_ListLoaders$', + '^GP_LoadMetaData$', + ])
_init(locals()) del _init diff --git a/pylib/gfxprim/loaders/loaders.i b/pylib/gfxprim/loaders/loaders.i index 7c9d903..f72a3e8 100644 --- a/pylib/gfxprim/loaders/loaders.i +++ b/pylib/gfxprim/loaders/loaders.i @@ -1,5 +1,5 @@ %include "../common.i" -%module(package="gfxprim.loaders") loaders_c +%module(package="gfxprim.loaders") c_loaders
%{ #include "core/GP_Core.h" @@ -14,7 +14,7 @@ ERROR_ON_NONZERO(GP_SaveImage);
%newobject GP_LoadImage;
-%include "GP_Loaders.h" +%include "GP_Loader.h"
ERROR_ON_NONZERO(GP_OpenJPG); ERROR_ON_NULL(GP_ReadJPG);
-----------------------------------------------------------------------
Summary of changes: pylib/gfxprim/loaders/__init__.py | 42 ++++++++++++++++++++++++++++-------- pylib/gfxprim/loaders/loaders.i | 4 +- 2 files changed, 34 insertions(+), 12 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.