def get_value_4(Window, entry1, entry2, entry3, entry4, protocole, ProtoWindow): """ This program gets 4 values from a label. Entry: Window(Frame): the protocol window entry1(Label variable): the first value to get entry2(Label variable): the second value to get entry3(Label variable): the third value to get entry4(Label variable): the fourth value to get protocole(list): the list of the protocole ProtoWindow(Frame): the protocol frame """ pos = protocole.index(['position']) protocole[pos - 1] = [ protocole[pos - 1][0], entry1.get(), entry2.get(), entry3.get(), entry4.get() ] Prot.EcrireProtocoleFichier(protocole, 'temp.txt') Prot.AfficherProtocol(ProtoWindow, protocole) Window.destroy()
def get_values_matrix(Window, x, y, temp_file, ProtoWindow): """ This program gets 2 positions from a matrix of labels (it is called 2 times each to add one position). Entry: Window(Frame): the protocol window x: the first value to get y(Label variable): the second value to get temp_file(string): the name of the file ProtoWindow(Frame): the protocol frame """ protocole = Prot.ReadProtocolFile(temp_file) pos = protocole.index(['position']) protocole[pos - 1] = protocole[pos - 1] + [x, y] Prot.EcrireProtocoleFichier(protocole, 'temp.txt') if len(protocole[pos - 1]) == 5: Prot.AfficherProtocol(ProtoWindow, protocole) Window.destroy()
def Delete(Window, ProtoWindow, temp_file): """ This program adds the pipeting instruction. Entry: Window(Frame): the protocol window ProtoWindow(Frame): the protocol frame temp_file(string): the name of the file """ protocole = Prot.ReadProtocolFile(temp_file) os.remove(temp_file) pos = protocole.index(['position']) if pos > 1: a = protocole[:pos - 1] else: a = [] b = protocole[pos:] protocole = a + b Prot.EcrireProtocoleFichier(protocole, 'temp.txt') ProtoWindow = Prot.AfficherProtocol(ProtoWindow, protocole) return 1
def thaw(Window, ProtoWindow, temp_file): """ This program adds the pipeting instruction. Entry: Window(Frame): the protocol window ProtoWindow(Frame): the protocol frame temp_file(string): the name of the file """ protocole = Prot.ReadProtocolFile(temp_file) pos = protocole.index(['position']) a = protocole[:pos] if a == []: a = [['tha']] else: a = a + [['tha']] b = protocole[pos:] protocole = a + b Prot.EcrireProtocoleFichier(protocole, 'temp.txt') Prot.AfficherProtocol(ProtoWindow, protocole) return 1
def PosUp(Window, ProtoWindow, temp_file): """ This program adds the pipeting instruction. Entry: Window(Frame): the protocol window ProtoWindow(Frame): the protocol frame temp_file(string): the name of the file """ protocole = Prot.ReadProtocolFile(temp_file) pos = protocole.index(['position']) sze = len(protocole) a = protocole[:pos - 1] b = [protocole[pos - 1]] if pos < sze: c = protocole[pos + 1:] else: c = [] protocole = a + [['position']] + b + c Prot.EcrireProtocoleFichier(protocole, 'temp.txt') Prot.AfficherProtocol(ProtoWindow, protocole) return 1