Пример #1
0
    def callback(p):
        class C:
            pass

        c = C()
        c.x = 'xxx'
        c.y = 'yyy'
        fields = (
            ('a', AttrBinding(c, 'x')),
            ('yyyy', AttrBinding(c, 'y')),
        )
        #p.LoadFields(fields)
        p.Load(Record.Hit('x'))
Пример #2
0

##################################################



if __name__ == '__main__':
	app = wx.PySimpleApp()
	#app.RedirectStdio()

	#frame = RecordTab(None)
	frame = wx.Frame(None, -1, "RecoradPanel", size = (800, 600))
	rt = RecordTab(frame)
	import Record
	import Project
	rt.tree.project = Project.NoneProject()
	rt.tree.AppendNewRecord(Record.Record())
	rt.tree.AppendNewHit(Record.Hit('/'))
	rt.tree.AppendNewHit(Record.Hit('/'))
	rt.tree.AppendNewHit(Record.Hit('/m3oui'))
	rt.tree.AppendNewRecord(Record.Record())
	rt.tree.AppendNewHit(Record.Hit('/'))


	frame.Center()
	frame.Show(True)
	app.MainLoop()


# vim: foldmethod=marker
Пример #3
0

def clean_project(project):
    raise NotImplementedError()


def clean_project_in_path(path):
    project = load_project(path)
    new_project = clone_project(project)
    save_project(new_project, path)


##################################################

if __name__ == '__main__':
    import pickle
    import Player
    import Record
    p = Project()

    p.add_record(Player.Script('print 2'))
    p.add_record(Record.Hit(''))
    p.save('.load/project.pkl')

    p.records = []

    p.load_as_global('.load/project.pkl')
    print p.records[0].uuid

    Repository.lookup(p.records[0].uuid)