ShapeReader

Inheritance diagram of polygon.reader
class ShapeReader(filename='')[source]

Reads JSON files and transfers the data into PolygonDrawer objects

Parameters:filename (str) – Internal filename to write to
pack_shape(shape_list, plot_type, canvas, read_from_str=None)[source]

Stores the data in the JSON into PolygonDrawers

Parameters:
  • shape_list – a Python list of PolygonDrawers
  • plot_type – the current plot being displayed
  • canvas – a Tkinter canvas to initialize the blank PolygonDrawer in the shape_list
read_from_file_json()[source]

Reads the data from the JSON file

read_from_str_json(data)[source]

Reads JSON as a string

Parameters:data (str) – string representation of a JSON object
set_filename(filename)[source]

Sets the file name destination

Parameters:filename (str) – the name of the file