Add files via upload

This commit is contained in:
bakachaneee
2023-11-09 09:20:04 +09:00
committed by GitHub
commit c6e8ee04cd

24
tjaf.py Normal file
View File

@@ -0,0 +1,24 @@
import pathlib
class ValueWrapper():
def __init__(self, value):
self.value = value
def as_str(self):
return str(self.value)
def as_file_ext(self):
path_str = self.as_str()
path = pathlib.Path(path_str)
return path.suffix.split(".",1)[1]
def as_simple_str(self):
raw = self.as_str()
no_comment = raw.split("//",1)[0]
return no_comment.strip()
def as_int(self):
return int(self.as_simple_str() or 0)
def as_float(self):
return float(self.as_simple_str() or 0)