"Fossies" - the Fresh Open Source Software Archive

Member "sk1-2.0rc4/src/uc2/formats/md/md_presenter.py" (25 May 2019, 1228 Bytes) of package /linux/misc/sk1-2.0rc4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "md_presenter.py" see the Fossies "Dox" file reference documentation.

    1 # -*- coding: utf-8 -*-
    2 #
    3 #   Copyright (C) 2018 by Igor E. Novikov
    4 #
    5 #   This program is free software: you can redistribute it and/or modify
    6 #   it under the terms of the GNU General Public License as published by
    7 #   the Free Software Foundation, either version 3 of the License, or
    8 #   (at your option) any later version.
    9 #
   10 #   This program is distributed in the hope that it will be useful,
   11 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
   12 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13 #   GNU General Public License for more details.
   14 #
   15 #   You should have received a copy of the GNU General Public License
   16 #   along with this program.  If not, see <https://www.gnu.org/licenses/>.
   17 
   18 from uc2 import uc2const
   19 from uc2.formats.generic import TextModelPresenter
   20 from uc2.formats.md.md_model import MdLoader, MdModel, MdSaver
   21 
   22 
   23 class MdPresenter(TextModelPresenter):
   24     cid = uc2const.MD
   25 
   26     config = None
   27     doc_file = ''
   28     model = None
   29 
   30     def __init__(self, appdata, cnf=None):
   31         cnf = cnf or {}
   32         self.config = cnf
   33         self.appdata = appdata
   34         self.loader = MdLoader()
   35         self.saver = MdSaver()
   36         self.new()
   37 
   38     def new(self):
   39         self.model = MdModel