Added docstring
This commit is contained in:
parent
bc825941d8
commit
5b45e40144
2 changed files with 44 additions and 0 deletions
|
|
@ -172,6 +172,10 @@ because the order of how tags are opened and closed are important to display in
|
||||||
|
|
||||||
|
|
||||||
class RootTag:
|
class RootTag:
|
||||||
|
"""
|
||||||
|
The Root tag class made to contain other tags.
|
||||||
|
"""
|
||||||
|
|
||||||
__slots__ = ('child',)
|
__slots__ = ('child',)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
@ -182,6 +186,10 @@ class RootTag:
|
||||||
|
|
||||||
|
|
||||||
class ChildTag:
|
class ChildTag:
|
||||||
|
"""
|
||||||
|
A node made to be contained.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
if parent:
|
if parent:
|
||||||
|
|
@ -194,6 +202,11 @@ class ChildTag:
|
||||||
|
|
||||||
|
|
||||||
class TextTag(ChildTag):
|
class TextTag(ChildTag):
|
||||||
|
"""
|
||||||
|
A BBCodeTag node to output regular text.
|
||||||
|
Output: SomeText
|
||||||
|
"""
|
||||||
|
|
||||||
__slots__ = ('parent', 'child', 'text')
|
__slots__ = ('parent', 'child', 'text')
|
||||||
|
|
||||||
def __init__(self, parent, text):
|
def __init__(self, parent, text):
|
||||||
|
|
@ -206,6 +219,10 @@ class TextTag(ChildTag):
|
||||||
|
|
||||||
|
|
||||||
class BBCodeTag(ChildTag):
|
class BBCodeTag(ChildTag):
|
||||||
|
"""
|
||||||
|
Base BBCodeTag node to encapsulate and be encapsulated.
|
||||||
|
"""
|
||||||
|
|
||||||
__slots__ = ('parent', 'child',)
|
__slots__ = ('parent', 'child',)
|
||||||
|
|
||||||
code = ''
|
code = ''
|
||||||
|
|
@ -219,14 +236,29 @@ class BBCodeTag(ChildTag):
|
||||||
|
|
||||||
|
|
||||||
class UnderlineTag(BBCodeTag):
|
class UnderlineTag(BBCodeTag):
|
||||||
|
"""
|
||||||
|
A BBCodeTag node for underlined text.
|
||||||
|
Output: [u]Underlined Text[/u]
|
||||||
|
"""
|
||||||
|
|
||||||
code = 'u'
|
code = 'u'
|
||||||
|
|
||||||
|
|
||||||
class BlinkTag(BBCodeTag):
|
class BlinkTag(BBCodeTag):
|
||||||
|
"""
|
||||||
|
A BBCodeTag node for blinking text.
|
||||||
|
Output: [blink]Blinking Text[/blink]
|
||||||
|
"""
|
||||||
|
|
||||||
code = 'blink'
|
code = 'blink'
|
||||||
|
|
||||||
|
|
||||||
class ColorTag(BBCodeTag):
|
class ColorTag(BBCodeTag):
|
||||||
|
"""
|
||||||
|
A BBCodeTag node for foreground color.
|
||||||
|
Output: [fgcolor=#000000]Colorized Text[/fgcolor]
|
||||||
|
"""
|
||||||
|
|
||||||
__slots__ = ('parent', 'child', 'color_hex',)
|
__slots__ = ('parent', 'child', 'color_hex',)
|
||||||
|
|
||||||
code = 'color'
|
code = 'color'
|
||||||
|
|
@ -240,10 +272,21 @@ class ColorTag(BBCodeTag):
|
||||||
|
|
||||||
|
|
||||||
class BGColorTag(ColorTag):
|
class BGColorTag(ColorTag):
|
||||||
|
"""
|
||||||
|
A BBCodeTag node for background color.
|
||||||
|
Output: [bgcolor=#000000]Colorized Text[/bgcolor]
|
||||||
|
"""
|
||||||
|
|
||||||
code = 'bgcolor'
|
code = 'bgcolor'
|
||||||
|
|
||||||
|
|
||||||
class UrlTag(BBCodeTag):
|
class UrlTag(BBCodeTag):
|
||||||
|
"""
|
||||||
|
A BBCodeTag node used for urls.
|
||||||
|
Output: [url=www.example.com]Child Text[/url]
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
__slots__ = ('parent', 'child', 'url_data',)
|
__slots__ = ('parent', 'child', 'url_data',)
|
||||||
|
|
||||||
code = 'url'
|
code = 'url'
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
Godot Websocket - ChrisLR 2022
|
Godot Websocket - ChrisLR 2022
|
||||||
|
|
||||||
This file contains the code necessary to dedicate a port to communicate with Godot via Websockets.
|
This file contains the code necessary to dedicate a port to communicate with Godot via Websockets.
|
||||||
|
It uses the plugin system and should be plugged via settings as detailed in the readme.
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue