Пример #1
0
def get_env():
    season = 'season'
    time = 'time'
    inside = 'inside'
    outside = 'outside'
    keys = [season, time, inside, outside]
    return Generator(context='Environment', keys=keys)
Пример #2
0
    def on_enter(self):
        gen = Generator()
        edit_grid = GridLayout()
        edit_grid.cols = 4
        edit_grid.rows = 4
        edit_grid.padding = 10
        for key in gen.lst:
            box = BoxLayout()
            box.orientation = 'vertical'
            box.padding = 10

            label = Label()
            label.text = key
            label.size_hint = (1, .25)

            text_input = EditorText()
            text_input.multiline = True
            text_input.text = self.get_values(gen.lst[key])
            text_input.id = key

            button = Button(text='Submit')
            button.size_hint = (1, .25)
            button.bind(on_press=text_input.update_item)

            box.add_widget(label)
            box.add_widget(text_input)
            box.add_widget(button)
            edit_grid.add_widget(box)

        button = Button()
        button.text = 'Done'
        button.size_hint = (1, .25)
        button.bind(on_press=self.load_art_tools_main)
        edit_grid.add_widget(button)
        self.add_widget(edit_grid)
Пример #3
0
 def update_item(self, *args):
     gen = Generator()
     items = self.text.strip().split('\n')
     items.sort()
     items = set(items)
     gen.lst[self.id] = list(filter(None, items))
     gen.export_lst()
Пример #4
0
def get_character():
    shape = 'shapes'
    nature = 'physical nature'
    characteristic = 'distinguishing characteristic'
    keys = [shape, nature, characteristic]
    return Generator(context='Character', keys=keys)
Пример #5
0
def get_exercise():
    exercise = 'exercise'
    keys = [exercise]
    return Generator(context='Exercise', keys=keys)
Пример #6
0
def get_items():
    items = 'items'
    keys = [items]
    return Generator(context='Items', keys=keys)
Пример #7
0
def get_study():
    study = 'study'
    anatomy = 'anatomy'
    emotion = 'emotion'
    keys = [study, anatomy, emotion]
    return Generator(context='Study', keys=keys)
Пример #8
0
def test_convert_file_to_array():
    expected = ['Hello', 'Please', 'Convert', 'Me', 'To', 'Array']
    converted_file = Generator.convert_file_to_array(
        f'.\\tests\\file_to_convert_to_array.txt')
    assert expected == converted_file
Пример #9
0
def gen():
    yield Generator()