From 75a05fe5cea9c0f179a51216bccc9e90ff9a95f7 Mon Sep 17 00:00:00 2001 From: James Westman Date: Sat, 23 Oct 2021 00:35:24 -0500 Subject: [PATCH] Remove an unused file --- gtkblueprinttool/main.py | 1 - gtkblueprinttool/pipeline.py | 86 ------------------------------------ 2 files changed, 87 deletions(-) delete mode 100644 gtkblueprinttool/pipeline.py diff --git a/gtkblueprinttool/main.py b/gtkblueprinttool/main.py index 1e86c0f..44de006 100644 --- a/gtkblueprinttool/main.py +++ b/gtkblueprinttool/main.py @@ -22,7 +22,6 @@ import argparse, json, os, sys from .errors import PrintableError, report_compile_error, MultipleErrors from .lsp import LanguageServer -from .pipeline import Pipeline from . import parser, tokenizer diff --git a/gtkblueprinttool/pipeline.py b/gtkblueprinttool/pipeline.py deleted file mode 100644 index 92c587c..0000000 --- a/gtkblueprinttool/pipeline.py +++ /dev/null @@ -1,86 +0,0 @@ -# pipeline.py -# -# Copyright 2021 James Westman -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 3 of the -# License, or (at your option) any later version. -# -# This file is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program. If not, see . -# -# SPDX-License-Identifier: LGPL-3.0-or-later - - -from . import ast, parser, tokenizer, xml_emitter - - -class Pipeline: - """ Represents the pipeline from blueprint code to XML, through the - tokenizer and abstract syntax tree steps. Setting any step - automatically updates the later steps. """ - - def __init__(self, string=None): - self._string = string - self._tokens = None - self._ast = None - self._xml = None - - @property - def string(self) -> str: - """ Blueprint code """ - return self._string - @string.setter - def string(self, new_val): - self._reset() - self._string = new_val - - @property - def tokens(self) -> [tokenizer.Token]: - """ List of tokens """ - if self._tokens is None: - if self.string is not None: - self._tokens = tokenizer.tokenize(self._string) - return self._tokens - @tokens.setter - def tokens(self, new_val): - self._reset() - self._tokens = new_val - - @property - def ast(self) -> ast.UI: - """ Abstract syntax tree """ - if self._ast is None: - if self.tokens is not None: - self._ast = parser.parse_ast(self.tokens) - return self._ast - @ast.setter - def ast(self, new_val): - self._reset() - self._ast = new_val - - @property - def xml(self) -> str: - """ GtkBuilder XML string """ - if self._xml is None: - if self.ast is not None: - emitter = xml_emitter.XmlEmitter() - self.ast.generate(emitter) - self._xml = emitter.result - return self._xml - @xml.setter - def xml(self, new_val): - self._reset() - self._xml = new_val - - - def _reset(self): - self._string = None - self._tokens = None -