Exemplo n.º 1
0
 def read_embarks(self):
     """Reads list of embark profiles."""
     files = embarks.read_embarks()
     self.embarks.set(files)
     current = embarks.get_installed_files()
     for i, f in enumerate(files):
         if f in current:
             self.embark_files.itemconfig(i, bg='pale green')
         else:
             self.embark_files.itemconfig(i, bg='white')
Exemplo n.º 2
0
 def read_embarks(self):
     """Reads list of embark profiles."""
     files = embarks.read_embarks()
     self.embarks.set(files)
     current = embarks.get_installed_files()
     for i, f in enumerate(files):
         if f in current:
             self.embark_files.itemconfig(i, bg='pale green')
         else:
             self.embark_files.itemconfig(i, bg='white')
Exemplo n.º 3
0
    def toggle_embark(self, event):
        """Toggles selected embark profile."""
        item = self.embark_files.index('active')
        if event.keysym == '??':
            item = self.embark_files.identify(event.y)

        if item is not None:
            embark_file = self.embark_files.get(item)
            files = embarks.get_installed_files()
            if embark_file in files:
                files.remove(embark_file)
            else:
                files.append(embark_file)
            embarks.install_embarks(files)
            self.read_embarks()
Exemplo n.º 4
0
    def toggle_embark(self, event):
        """Toggles selected embark profile."""
        item = self.embark_files.index('active')
        if event.keysym == '??':
            item = self.embark_files.identify(event.y)

        if item is not None:
            embark_file = self.embark_files.get(item)
            files = embarks.get_installed_files()
            if embark_file in files:
                files.remove(embark_file)
            else:
                files.append(embark_file)
            embarks.install_embarks(files)
            self.read_embarks()