Beispiel #1
0
 def wrappedindocument(self, file=None, **kwargs):
     page_kwargs = {}
     write_kwargs = {}
     for name, value in kwargs.items():
         if name.startswith("page_"):
             page_kwargs[name[5:]] = value
         elif name.startswith("write_"):
             write_kwargs[name[6:]] = value
         else:
             warnings.warn("Keyword argument %s of %s method should be prefixed with 'page_'" %
                             (name, method.__name__), DeprecationWarning)
             page_kwargs[name] = value
     d = document.document([document.page(self, **page_kwargs)])
     self.__name__ = method.__name__
     self.__doc__ = method.__doc__
     return method(d, file, **write_kwargs)
Beispiel #2
0
 def wrappedindocument(self, file=None, **kwargs):
     page_kwargs = {}
     write_kwargs = {}
     for name, value in kwargs.items():
         if name.startswith("page_"):
             page_kwargs[name[5:]] = value
         elif name.startswith("write_"):
             write_kwargs[name[6:]] = value
         else:
             warnings.warn(
                 "Keyword argument %s of %s method should be prefixed with 'page_'"
                 % (name, method.__name__), DeprecationWarning)
             page_kwargs[name] = value
     d = document.document([document.page(self, **page_kwargs)])
     self.__name__ = method.__name__
     self.__doc__ = method.__doc__
     return method(d, file, **write_kwargs)
Beispiel #3
0
 def wrappedindocument(self, file=None, **kwargs):
     d = document.document([document.page(self, **kwargs)])
     self.__name__ = method.__name__
     self.__doc__ = method.__doc__
     return method(d, file)
Beispiel #4
0
 def wrappedindocument(self, file, *args, **kwargs):
     d = document.document([document.page(self, *args, **kwargs)])
     self.__name__ = method.__name__
     self.__doc__ = method.__doc__
     return method(d, file)