Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvianen committed Dec 17, 2023
1 parent 739e268 commit de285e0
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 132 deletions.
30 changes: 6 additions & 24 deletions src/rite/data/colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@


# Import | Futures
# […]


# Import | Standard Library
# […]


# Import | Libraries
# […]


# Import | Local Modules
# […]






Expand Down Expand Up @@ -115,23 +117,3 @@ def hex_to_hsv(hex_value):
def value(self):
""""""
return (self._r, self._g, self._b, self._a)



# Methods | test

def test_something(self):
"""Test Method"""
pass


def test():
"""Test Function"""
pass


if __name__ == '__main__':
"""Main"""
import doctest
doctest.testmod()
test()
9 changes: 4 additions & 5 deletions src/rite/data/date.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


Expand All @@ -19,17 +18,17 @@


# Import | Futures
# […]


# Import | Standard Library
from datetime import date
# […]


# Import | Libraries
# […]


# Import | Local Modules
# […]



class Date:
Expand Down
9 changes: 4 additions & 5 deletions src/rite/data/image_raster.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


Expand All @@ -19,19 +18,19 @@


# Import | Futures
# […]


# Import | Standard Library
from io import StringIO
from io import BytesIO
# […]


# Import | Libraries
from PIL import Image
# […]


# Import | Local Modules
# […]




Expand Down
9 changes: 4 additions & 5 deletions src/rite/data/pixel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


Expand All @@ -19,18 +18,18 @@


# Import | Futures
# […]


# Import | Standard Library
# […]


# Import | Libraries
# […]


# Import | Local Modules
from starling.data.colour import Colour
from starling.geometry.point import Point
# […]



class Pixel(object):
Expand Down
34 changes: 6 additions & 28 deletions src/rite/data/slug.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


Expand All @@ -19,35 +18,18 @@


# Import | Futures
# […]


# Import | Standard Library
import re
import unicodedata
# […]


# Import | Libraries
# […]

# Import | Local Modules
# […]

# Import | Local Modules

def slugify(value, allow_unicode=False):
"""
Taken from https://github.com/django/django/blob/master/django/utils/text.py
Convert to ASCII if 'allow_unicode' is False. Convert spaces or repeated
dashes to single dashes. Remove characters that aren't alphanumerics,
underscores, or hyphens. Convert to lowercase. Also strip leading and
trailing whitespace, dashes, and underscores.
"""
value = str(value)
if allow_unicode:
value = unicodedata.normalize('NFKC', value)
else:
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
value = re.sub(r'[^\w\s-]', '', value.lower())
return re.sub(r'[-\s]+', '-', value).strip('-_')


class Slug:
Expand Down Expand Up @@ -99,16 +81,12 @@ def test_something(self):


def test():
"""
Test Function
"""
"""Test Function"""
pass


if __name__ == '__main__':
"""
Main
"""
"""Main"""
import doctest
doctest.testmod()
test()
test()
32 changes: 2 additions & 30 deletions src/rite/data/url.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

#!/usr/bin/env python
# -*- coding: utf-8 -*-


Expand All @@ -19,23 +17,18 @@
"""


# Import | Futures
# […]


# Import | Standard Library
import re
import unicodedata
# […]

# Import | Libraries
# […]

# Import | Local Modules
# […]



class Slug:
class Slug(object):
""""""

# Static Methods
Expand All @@ -48,24 +41,3 @@ def is_string_an_url(url_string: str) -> bool:
return False

return result


# Methods | test

def test_something(self):
"""Test Method"""
pass


def test():
"""Test Function"""
pass


if __name__ == '__main__':
"""Main"""
import doctest
doctest.testmod()
test()


9 changes: 4 additions & 5 deletions src/rite/data/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


Expand All @@ -19,16 +18,16 @@


# Import | Futures
# […]


# Import | Standard Library
# […]


# Import | Libraries
# […]


# Import | Local Modules
# […]




Expand Down
9 changes: 4 additions & 5 deletions src/rite/data/uuid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


Expand All @@ -19,17 +18,17 @@


# Import | Futures
# […]


# Import | Standard Library
import uuid
# […]


# Import | Libraries
# […]


# Import | Local Modules
# […]



class UUID:
Expand Down
5 changes: 1 addition & 4 deletions src/rite/file/geojson.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


Expand Down Expand Up @@ -75,9 +74,7 @@ def test():


if __name__ == '__main__':
"""
Main
"""
"""Main"""
import doctest
doctest.testmod()
test()
25 changes: 7 additions & 18 deletions src/rite/file/json.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# -*- coding: utf-8 -*-
"""Provides JSON stuff."""

"""
Provides JSON stuff.
"""


# unused: import geojson
import json


class FileJSON:
"""
A class used to represent a JSON File.
"""
"""A class used to represent a JSON File."""

@staticmethod
def load_json(path):
"""
Load JSON.
"""
"""Load JSON."""
f = open(path)
data = json.loads(f.read())
f.close()
Expand All @@ -26,9 +19,7 @@ def load_json(path):
# NOTE(SB): indent quadruples file size
@staticmethod
def save_dict_to_json(path, dictionary, indent=True):
"""
Save dictionary to a JSON file.
"""
"""Save dictionary to a JSON file."""
with open(path, "w") as outfile:
if indent:
json.dump(dictionary, outfile, indent=4)
Expand All @@ -37,13 +28,11 @@ def save_dict_to_json(path, dictionary, indent=True):


def test():
"""
Test Function.
"""
"""Test Function."""
pass


if __name__ == "__main__":
if __name__ == '__main__':
"""Main"""
import doctest
doctest.testmod()
Expand Down
4 changes: 1 addition & 3 deletions src/rite/file/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@


class OBJWriter(object):
"""
A class used to represent a OBJ File.
"""
"""A class used to represent a OBJ File."""

def __init__(self):
"""Init."""
Expand Down

0 comments on commit de285e0

Please sign in to comment.