<commit_before>'''
Author:        <NAME>, <NAME>
Created:       2014.12.09
Last Modified: 2014.12.14

List of code blocks to be displayed and manipulated through user interaction.

takes a list of strings and converts them into dragable objects.

***  still need to implement drag and drop and display of draggable code blocks  ***   

'''
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.listview import ListView
from kivy.properties import ObjectProperty, ListProperty
from kivy.uix.scrollview import ScrollView
from kivy.uix.gridlayout import GridLayout
from precodebutton import PreCodeButton

class FunctionList(ScrollView):

	code_List = ListProperty(None)

	def __init__(self, theList, dragLayout, destinationLayout):
		super(FunctionList, self).__init__()
		self.size_hint = (1, 1)
		self.scroll_type = ['content', 'bars']
		self.bar_width='9dp'
		code_window = GridLayout(cols=1, size_hint=(1, None))
		code_window.bind(minimum_height=code_window.setter('height'),)

		for function in theList:
			self.InsertInstruction(function, dragLayout, destinationLayout)

		self.add_widget(code_window)

	''' insert an instruction into the scrollable list '''
	def InsertInstruction(self, name, dragLayout, destinationLayout):
		code_window.add_widget(PreCodeButton(name, dragLayout, destinationLayout))

	''' remove an instruction from the scrollable list '''
	def RemoveInstruction(self, name):
		error('not yet implemented')

	


class testFunctionList(App):
    def build(self):
    	
        return FunctionList(['(+ 4 5)', '(- 3 5)', '(define x TRUE)',
         '(if x 5)','(* 3 7)', '(move 4)', '(turn 3)', '(/ 9 4)',
          '(if x 5)','(* 3 7)', '(move 4)', '(turn 3)', '(/ 9 4)'])

if __name__ == '__main__':
    testFunctionList().run()
<commit_msg>fixed code. now running correctly<commit_after>'''
Author:        <NAME>, <NAME>
Created:       2014.12.09
Last Modified: 2014.12.14

List of code blocks to be displayed and manipulated through user interaction.

takes a list of strings and converts them into dragable objects.

***  still need to implement drag and drop and display of draggable code blocks  ***   

'''
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.listview import ListView
from kivy.properties import ObjectProperty, ListProperty
from kivy.uix.scrollview import ScrollView
from kivy.uix.gridlayout import GridLayout
from precodebutton import PreCodeButton

class FunctionList(ScrollView):

	code_List = ListProperty(None)

	def __init__(self, theList, dragLayout, destinationLayout):
		super(FunctionList, self).__init__()
		self.size_hint = (1, 1)
		self.scroll_type = ['content', 'bars']
		self.bar_width='9dp'
		code_window = GridLayout(cols=1, size_hint=(1, None))
		code_window.bind(minimum_height=code_window.setter('height'),)

		for function in theList:
			code_window.add_widget(PreCodeButton(function, dragLayout, destinationLayout))
		
		self.add_widget(code_window)

	''' insert an instruction into the scrollable list '''
	def InsertInstruction(self, name, dragLayout, destinationLayout):
		code_window.add_widget(PreCodeButton(name, dragLayout, destinationLayout))

	''' remove an instruction from the scrollable list '''
	def RemoveInstruction(self, name):
		error('not yet implemented')

	


class testFunctionList(App):
    def build(self):
    	
        return FunctionList(['(+ 4 5)', '(- 3 5)', '(define x TRUE)',
         '(if x 5)','(* 3 7)', '(move 4)', '(turn 3)', '(/ 9 4)',
          '(if x 5)','(* 3 7)', '(move 4)', '(turn 3)', '(/ 9 4)'], None, None)

if __name__ == '__main__':
    testFunctionList().run()

{'fraction_non_alphanumeric': 0.1250337564137186, 'fraction_numerical': 0.02106400216041048, 'mean_word_length': 4.578313253012048, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '755217', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1131, 'n_words': 358}