Beispiel #1
0
	def __init__(self, **kwargs):
		# The DataStructure object to be used for as the source of data
		self.source = kwargs["source"]

		del kwargs["source"]
		super(VariableBox, self).__init__(**kwargs)

		# A PointerBox object which mirrors self.source but stores Label widgets corresponding
		# to each data item in the source at the matching key and index position
		self.mirror = VariableData(self.source.keys)

		self.orientation = 'vertical'

		# For the purpose of ensuring that the widget works as
		#  a child of the ScrollView object
		#  widget's height is binded to and set as the minimum height
		self.size_hint_y = None
		self.bind(minimum_height = self.setter('height'))

		# Customizing the visuals

		self.spacing = "5px"
		self.padding = "5px"

		self.buildInternal()
Beispiel #2
0
	def __init__(self, **kwargs):
		super(Queue_Op, self).__init__(**kwargs)
		
		self.variables = VariableData(["A", "B", "C", "Limit"])

		# PseudoCode objects
		self.pseudoCodes = {
			"fibonacci": self.get_fibonacci_PseudoCode()
		}

		self.addAction(
			CLI_Actions(name = 'Generate fibonacci sequence', 
			functionToExecute = self.seq_fibonacci, 
			codeObj = self.pseudoCodes["fibonacci"],
			lockCallBack = self.lockCallBack,
			endTarget = self.endTarget)
			)
Beispiel #3
0
    def __init__(self, **kwargs):
        super(SortOp, self).__init__(**kwargs)

        self.pointers = PointerData(["Current Item"])
        self.variables = VariableData(
            ["Index", "Number of items", "Item to be inserted"])
        self.data = DataStructure(["List Index", "List Item"],
                                  name="List",
                                  size=5)

        sort = CallableActions(name='insertion sort',
                               functionToExecute=self.insertionSort,
                               lockCallBack=self.lockCallBack,
                               endTarget=self.endTarget,
                               codeObj=self.insertion_Sort_PseudoCode())

        self.addAction(sort)
        self.initializeData()