Exemplo n.º 1
0
  def __init__(self, params, **kwargs):
    MooseObject.__init__(self, params)

    # Set the Image type
    self.__image_type = kwargs.pop('image_type', 'MarkdownImage')

    # Set the parent object, which is the RemarkSlideSet parent object
    self.parent = self.getParam('_parent')

    # The slide number, this is set by the SlideSetWarehouse::__contents method
    self.number = 0

    # Get a reference to the factory, parser, and the root node of the input file
    self.__factory = self.parent.getParam('_factory')
    self.__parser = self.parent.getParam('_parser')
    self.__root = self.parent.getParam('_root')

    # Storage for raw markdown, this is populated by the parent RemarkSlideSet
    self.markdown = None

    # Storage for the comments
    self.comments = []

    # Storage for the slide title
    self.__title = None

    # Initialize the image information storage
    self.__images = dict()

    # Source directory for the PresentationBuilder code
    self.__source_dir = os.path.abspath(os.path.join(os.path.split(inspect.getfile(self.__class__))[0], '..'))

    # Add comments supplied via the optional argument
    if self.isParamValid('comments'):
      self.comments.append(self.getParam('comments'))
Exemplo n.º 2
0
  def __init__(self, name, params, **kwargs):
    MooseObject.__init__(self, name, params)

    # Get a reference to the factory
    self._warehouse = self.getParam('_warehouse')
    self._factory = self.getParam('_factory')
    self._parser = self.getParam('_parser')
    self._root = self.getParam('_root')

    # Set the slide type
    self._slide_type = kwargs.pop('slide_type', 'RemarkSlide')

    # Initialize storage for the generate slides, use an ordered dict to maintain slide ordering
    self._slides = dict()
    self._slide_order = []
    self._content_slides = None # name(s) of contents slides
    self._title_slide = None # name of title slides

    # Count the number of slides, used for assigning default name
    self._count = 0

    # Storage for links
    self._links = []

    # Print a message
    print '  CREATED:', name
Exemplo n.º 3
0
    def __init__(self, name, params, **kwargs):
        MooseObject.__init__(self, name, params)

        # Get a reference to the factory
        self._warehouse = self.getParam('_warehouse')
        self._factory = self.getParam('_factory')
        self._parser = self.getParam('_parser')
        self._root = self.getParam('_root')

        # Set the slide type
        self._slide_type = kwargs.pop('slide_type', 'RemarkSlide')

        # Initialize storage for the generate slides, use an ordered dict to maintain slide ordering
        self._slides = dict()
        self._slide_order = []
        self._content_slides = None  # name(s) of contents slides
        self._title_slide = None  # name of title slides

        # Count the number of slides, used for assigning default name
        self._count = 0

        # Storage for links
        self._links = []

        # Print a message
        print '  CREATED:', name
Exemplo n.º 4
0
  def __init__(self, params, **kwargs):
    MooseObject.__init__(self, params)

    # Set the Image type
    self.__image_type = kwargs.pop('image_type', 'MarkdownImage')

    # Set the parent object, which is the RemarkSlideSet parent object
    self.parent = self.getParam('_parent')

    # The slide number, this is set by the SlideSetWarehouse::__contents method
    self.number = 0

    # Get a reference to the factory, parser, and the root node of the input file
    self.__factory = self.parent.getParam('_factory')
    self.__parser = self.parent.getParam('_parser')
    self.__root = self.parent.getParam('_root')

    # Storage for raw markdown, this is populated by the parent RemarkSlideSet
    self.markdown = None

    # Storage for the comments
    self.comments = []

    # Storage for the slide title
    self.__title = None

    # Initialize the image information storage
    self.__images = dict()

    # Source directory for the PresentationBuilder code
    self.__source_dir = os.path.abspath(os.path.join(os.path.split(inspect.getfile(self.__class__))[0], '..'))

    # Add comments supplied via the optional argument
    if self.isParamValid('comments'):
      self.comments.append(self.getParam('comments'))
Exemplo n.º 5
0
  def __init__(self, name, params):
    MooseObject.__init__(self, name, params)
    self.parent = self.getParam('_parent')

    # Set download flag (default is true)
    self._download = True
    if self.isParamValid('download'):
      self.__download = self.parameters()['download']
Exemplo n.º 6
0
    def __init__(self, name, params):
        MooseObject.__init__(self, name, params)
        self.parent = self.getParam('_parent')

        # Set download flag (default is true)
        self._download = True
        if self.isParamValid('download'):
            self.__download = self.parameters()['download']
Exemplo n.º 7
0
    def __init__(self, name, params):
        MooseObject.__init__(self, name, params)
        self.parent = self.getParam('_parent')
        self.match = self.getParam('_match')

        # Store the complete markdown image text
        self._raw = self.match.group(0)

        # Set download flag (default is true)
        self._download = True
        if self.isParamValid('download'):
            self._download = self._pars['download']
Exemplo n.º 8
0
  def __init__(self, name, params):
    MooseObject.__init__(self, name, params)
    self.parent = self.getParam('_parent')

    # Set download flag (default is true)
    self._download = True
    if self.isParamValid('download'):
      self.__download = self.parameters()['download']

    # Images are formated has html, if backticks where added to equations then need to be removed
    if self.isParamValid('caption'):
      self._pars['caption'] = re.sub(r'`(\$.*?\$)`', r'\1', self._pars['caption'])
Exemplo n.º 9
0
  def __init__(self, name, params):
    MooseObject.__init__(self, name, params)
    self.parent = self.getParam('_parent')
    self.match = self.getParam('_match')

    # Store the complete markdown image text
    self._raw = self.match.group(0)

    # Set download flag (default is true)
    self._download = True
    if self.isParamValid('download'):
      self._download = self._pars['download']
Exemplo n.º 10
0
    def __init__(self, name, params):
        MooseObject.__init__(self, name, params)
        self.parent = self.getParam('_parent')

        # Set download flag (default is true)
        self._download = True
        if self.isParamValid('download'):
            self.__download = self.parameters()['download']

        # Images are formated has html, if backticks where added to equations then need to be removed
        if self.isParamValid('caption'):
            self._pars['caption'] = re.sub(r'`(\$.*?\$)`', r'\1',
                                           self._pars['caption'])
Exemplo n.º 11
0
  def __init__(self, name, params, **kwargs):
    MooseObject.__init__(self, name, params)

    # Set the Slide type
    self.__slide_type = kwargs.pop('slide_type', 'RemarkSlide')

    # Get a reference to the items needed to create objects
    self.__factory = self.getParam('_factory')
    self.__parser = self.getParam('_parser')
    self.__root = self.getParam('_root')

    # Create a storage object for the slides created by this set
    self.__slide_warehouse = SlideWarehouse(set_name = name, \
                                            active = self.getParam('active'), \
                                            inactive = self.getParam('inactive'))

    # Print a message
    print '  ', name
Exemplo n.º 12
0
    def __init__(self, name, params, **kwargs):
        MooseObject.__init__(self, name, params)

        # Set the Slide type
        self.__slide_type = kwargs.pop('slide_type', 'RemarkSlide')

        # Get a reference to the items needed to create objects
        self.__factory = self.getParam('_factory')
        self.__parser = self.getParam('_parser')
        self.__root = self.getParam('_root')

        # Create a storage object for the slides created by this set
        self.__slide_warehouse = SlideWarehouse(set_name = name, \
                                                active = self.getParam('active'), \
                                                inactive = self.getParam('inactive'))

        # Print a message
        print '  ', name
Exemplo n.º 13
0
  def __init__(self, name, params, **kwargs):
    MooseObject.__init__(self, name, params)

    # Set the Image type
    self._image_type = kwargs.pop('image_type', 'MarkdownImage')

    # Set the parent object
    self.parent = self.getParam('_parent') # the SlideSet parent object

    # Get a reference to the factory
    self._warehouse = self.parent.getParam('_warehouse')
    self._factory = self.parent.getParam('_factory')
    self._parser = self.parent.getParam('_parser')
    self._root = self.parent.getParam('_root')

    # Initialize member variables
    self.markdown = None                   # storage for parsed markdown (see SlideSet::createSlide)
    self.index = None                      # slide index, this is only populated and used for table of contents generation
    self.comments = []                     # comment storage for the current slide
    self._show_in_contents = self.getParam('show_in_contents')
    self._title = None
    self._previous = None
    self._raw_markdown = self.getParam('markdown')

    # Set the location of PresentationBuilder directory
    self._source_dir = os.path.abspath(os.path.join(os.path.split(inspect.getfile(self.__class__))[0], '..', '..'))

    # Initialize the image information storage
    self._images = dict()
    self._createImages(self._raw_markdown)

    # Add comments supplied via the optional argument
    if self.isParamValid('comments'):
      self.comments.append(self.getParam('comments'))

    # Store the previous slide
    if self.parent._slides:
      self._previous = self.parent._slides.items()[-1]

    # Extract title
    match = re.search(self._title_re, self._raw_markdown)
    if match:
      self._title = (match.group(1) + ' ' + match.group(2)).replace('\r', '')
Exemplo n.º 14
0
  def __init__(self, name, params, **kwargs):
    MooseObject.__init__(self, name, params)

    # Get a reference to the factory
    self._warehouse = self.getParam('_warehouse')
    self._factory = self.getParam('_factory')
    self._parser = self.getParam('_parser')
    self._root = self.getParam('_root')

    # Set the slide type
    self._slide_type = kwargs.pop('slide_type', 'RemarkSlide')

    # Initialize storage for the generate slides, use an ordered dict to maintain slide ordering
    self._slides = OrderedDict()

    # Count the number of slides, used for assigning default name
    self._count = 0

    # Print a message
    print 'Created:', name
Exemplo n.º 15
0
  def __init__(self, name, params, **kwargs):
    MooseObject.__init__(self, name, params)

    # Set the Image type
    self._image_type = kwargs.pop('image_type', 'MarkdownImage')

    # Set the parent object
    self.parent = self.getParam('_parent') # the SlideSet parent object

    # Get a reference to the factory
    self._warehouse = self.parent.getParam('_warehouse')
    self._factory = self.parent.getParam('_factory')
    self._parser = self.parent.getParam('_parser')
    self._root = self.parent.getParam('_root')

    # Initialize member variables
    self.markdown = None                   # storage for parsed markdown (see SlideSet::createSlide)
    self.index = None                      # slide index, this is only populated and used for table of contents generation
    self.comments = []                     # comment storage for the current slide
    self._show_in_contents = self.getParam('show_in_contents')
    self._title = None
    self._previous = None
    self._raw_markdown = self.getParam('markdown')
    self._format = self.getParam('format')

    # Set the location of PresentationBuilder directory
    self._source_dir = os.path.abspath(os.path.join(os.path.split(inspect.getfile(self.__class__))[0], '..'))

    # Initialize the image information storage
    self._images = dict()
    self._createImages(self._raw_markdown)

    # Add comments supplied via the optional argument
    if self.isParamValid('comments'):
      self.comments.append(self.getParam('comments'))

    # Extract title
    match = re.search(self._title_re, self._raw_markdown, re.MULTILINE)
    if match:
      self._title = (match.group(1) + ' ' + match.group(2)).replace('\r', '')