Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions filehelper.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
class FileHelper:
def __init__(self, filename):
self.filename = filename
self.header = []
self.body = []
self.footer = []
self.indent_level = 0
self.minified = False
def __init__(self, filename):
self.filename = filename
self.header = []
self.body = []
self.footer = []
self.indent_level = 0
self.minified = False

def insert_header(self, content):
""" Insert the Content in the Header section of the file. """
self.header.append(content + "\n")
def insert_header(self, content):
"""Insert the Content in the Header section of the file."""
self.header.append(content + "\n")

def insert_content(self, content):
""" Insert the Content in the Body section of the file. """
if not self.minified:
self.body.append(("\t" * self.indent_level) + content + "\n")
else:
self.body.append(content)
def insert_content(self, content):
"""Insert the Content in the Body section of the file."""
if not self.minified:
self.body.append(("\t" * self.indent_level) + content + "\n")
else:
self.body.append(content)

def insert_footer(self, content):
""" Insert the Content in the Footer section of the file. """
self.footer.append(content + "\n")
def insert_footer(self, content):
"""Insert the Content in the Footer section of the file."""
self.footer.append(content + "\n")

def write_data_to_file(self):
""" Write all the Data stored to File. """
f = open(self.filename, 'w')
f.writelines(self.header)
f.writelines(self.body)
f.writelines(self.footer)
f.close()
def write_data_to_file(self):
"""Write all the Data stored to File."""
f = open(self.filename, "w")
f.writelines(self.header)
f.writelines(self.body)
f.writelines(self.footer)
f.close()
43 changes: 23 additions & 20 deletions langEnums.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
from enum import Enum


class Exceptions(Enum):
InvalidSyntax = 100
AlreadyDefined = 101
NotImplementedException = 102
NotDefinedException = 103
GeneralException = 104
DivideByZeroException = 105
InvalidValue = 106
InvalidTypeException = 107
InvalidSyntax = 100
AlreadyDefined = 101
NotImplementedException = 102
NotDefinedException = 103
GeneralException = 104
DivideByZeroException = 105
InvalidValue = 106
InvalidTypeException = 107


class Types(Enum):
Boolean = 0
Integer = 1
Float = 2
List = 3
Dictionary = 4
Tuple = 5
Dynamic = 6
String = 7
Any = 8
Boolean = 0
Integer = 1
Float = 2
List = 3
Dictionary = 4
Tuple = 5
Dynamic = 6
String = 7
Any = 8


class ConditionType(Enum):
And = 0
Or = 1
Single = 2
And = 0
Or = 1
Single = 2
Loading