示例#1
0
 def __init__(self, paths, parent_module_name, interrupt_if_fail,
              is_logging, log_file_path, stage_name,
              only_fail_notification):
     """
     Parameters
     ----------
     paths : list
         paths to directories with CSV systems
     parent_module_name: str
         a parent module name
     interrupt_if_fail : bool
         interrupt the execution of the all stages if an error has occurred
     is_logging : bool
         write messages to the log file or not
     log_file_path : str
         a path to directory for the log file
     stage_name : str
         stage name
     only_fail_notification : bool
         notification condition
     """
     Stage.__init__(self, parent_module_name, interrupt_if_fail,
                    log_file_path, stage_name, is_logging, "", "", "",
                    only_fail_notification)
     self._vcs_paths = paths.copy()
     for path in self._vcs_paths:
         if not os.path.exists(path):
             raise FileNotFoundError("VCS: Directory " + path +
                                     " doesn't exists!")
     self._commit_msg = 'new '
示例#2
0
    def __init__(self):
        """
        """
        Stage.__init__(self, moduleDescription)

        # Info: NTFS partitions, current partition, total drive size
        self.info = self.addWidget(PartitionWidget())

        # NTFS resizing
        self.ntfs = self.addWidget(NtfsWidget(self.size_changed_cb))

        # Info: space after last NTFS partition
        self.rest = self.addWidget(ShowInfoWidget(
                _("(Potential) free space at end of drive:  ")))

        # Get a list of NTFS partitions (all disks) and then the
        # corresponding info about the disks and partitions
        self.partlist = self.getNTFSparts()
        # Each disk (with NTFS partitions) gets an entry in self.diskinfo.
        # Each entry is a list-pair: [disk info, list of partitions' info]
        # The second item, the partition-info list can be changed if a
        # partition is shrunk or removed.
        self.diskinfo = {}
        for p in self.partlist:
            d = p.rstrip("0123456789")
            if not self.diskinfo.has_key(d):
                self.diskinfo[d] = [install.getDeviceInfo(d), None]
                self.diskChanged(d)

        # List of already 'handled' partitions
        self.donelist = []

        self.reinit()
    def __init__(self, parent, score_to_add = None):
        Stage.__init__(self, parent)

        self.score_to_add = score_to_add
        self.high_scores = load_high_scores()

        self.new_idx = None
        if self.score_to_add != None:
            s = Score("???", self.score_to_add)
            self.new_idx = self.high_scores.potential_position(s)
        if self.new_idx != None:
            self.high_scores.add(s)

        score_frame = Frame(self)
        score_frame.pack()
        for i in range(self.high_scores.max_size):
            score = self.high_scores.get(i)
            if score != None:
                score = self.high_scores.scores[i]
                name = score.name
                points = str(score.points)
            else:
                name = "---"
                points = "---"                
            if i == self.new_idx:
                self.new_entry = Entry(score_frame)
                self.new_entry.grid(row=i, column=0)
            else:
                Label(score_frame, text=name).grid(row=i,column=0)
            Label(score_frame, text=points).grid(row=i,column=1)

        b = Button(self, text="return to main", command=self.button_clicked)
        b.pack()
示例#4
0
    def __init__(self):
        Stage.__init__(self, moduleDescription)

        # Set up grub's device map and a list of existing menu.lst files.
        assert install.set_devicemap(), "Couldn't get device map for GRUB"

        self.addOption('mbr', _("Install GRUB to MBR - make it the main"
                " bootloader"), True, callback=self.mbrtoggled)
        self.mbrinstall = Mbrinstall(self)
        self.addWidget(self.mbrinstall, False)
        # What if there is >1 drive?

        if install.menulst:
            self.addOption('old', _("Add new installation to existing GRUB"
                    " menu."), callback=self.oldtoggled)
            self.oldgrub = Oldgrub(self)
            self.addWidget(self.oldgrub, False)

        self.addOption('part', _("Install GRUB to installation partition."))

        self.ntfsboot = None
        # Seek likely candidate for Windows boot partition
        dinfo = install.fdiskall()
        nlist = install.listNTFSpartitions()
        for np in nlist:
            # First look for (first) partition marked with boot flag
            if re.search(r"^%s +\*" % np, dinfo, re.M):
                self.ntfsboot = np
                break
        if (not self.ntfsboot) and nlist:
            # Else just guess first NTFS partition
            self.ntfsboot = nlist[0]

        self.request_soon(self.init)
示例#5
0
    def __init__(self):
        Stage.__init__(self, moduleDescription)

        self.addLabel(_("Please check that the formatting of the"
                " following partitions and their use within the new"
                " installation (mount-points) corresponds with what you"
                " had in mind. Accidents could well result in serious"
                " data loss."))

        # List of partitions configured for use.
        #    Each entry has the form [mount-point, device, format,
        #                         format-flags, mount-flags]
        parts = install.get_config("partitions", False)
        plist = []
        if parts:
            for p in parts.splitlines():
                pl = p.split(':')
                plist.append(pl + [self.getsize(pl[1])])

        # In case of mounts within mounts
        plist.sort()

        # Swaps ([device, format, include])
        swaps = install.get_config("swaps", False)
        if swaps:
            for s in swaps.splitlines():
                p, f, i = s.split(':')
                if i:
                    plist.append(["swap", p, f, "", "", self.getsize(p)])

        self.addWidget(PartTable(plist))
示例#6
0
    def __init__(self):
        Stage.__init__(self, moduleDescription)

        self.output = self.addWidget(Report())

        self.progress = self.addWidget(Progress(), False)

        self.request_soon(self.run)
示例#7
0
 def __init__(self):
     Stage.__init__(self, moduleDescription)
     self.addLabel(_('Disk(-like) devices will be detected and offered'
             ' for automatic partitioning.\n\n'
             'If a device has mounted partitions it will not be offered'
             ' for automatic partitioning. If you want to partition'
             ' such a device, you must select the "Manual Partitioning"'
             ' stage.'))
     self.getDevices()
示例#8
0
 def __init__(self, loggers):
     """
     Parameters
     ----------
     loggers: list
         list of loggers to send
     """
     Stage.__init__(self, "", False, "", "Notification", False, "", "", "",
                    False)
     self._loggers = loggers
    def __init__(self, parent, *args, **kargs):
        Stage.__init__(self, parent, *args, **kargs)

        Label(self, text="FALLING BLOCK GAME", font=("Helvetica", 30)).pack()

        self.selections = SelectionGroup(self, "Start", "High Scores", "Exit")
        self.selections.pack()
        self.bind_parent("<Up>"  , lambda event: self.selections.previous_selection())
        self.bind_parent("<Down>", lambda event: self.selections.next_selection())
        self.bind_parent("<Return>", self.selection_chosen)
示例#10
0
 def __init__(self):
     Stage.__init__(self, moduleDescription)
     self.addLabel(_('This will install Arch Linux'
             ' from this "live" system on your computer.'
             ' This program was written'
             ' for the <i>larch</i> project:\n'
             '       http://larch.berlios.de\n'
             '\nIt is free software,'
             ' released under the GNU General Public License.\n\n') +
             'Copyright (c) 2008   Michael Towers')
示例#11
0
    def __init__(self):
        Stage.__init__(self, moduleDescription)

        # Info on drive
        self.device = install.get_config('autodevice', trap=False)
        if not self.device:
            self.device = install.listDevices()[0][0]
        self.dinfo = install.getDeviceInfo(self.device)

        # Info: total drive size
        totalsize = self.addWidget(ShowInfoWidget(
                _("Total capacity of drive %s:  ") % self.device))
        totalsize.set(self.dinfo[0])

        # Get partition info (consider only space after NTFS partitions)
        parts = install.getParts(self.device)
        self.startpart = 1
        self.startsector = 0
        for p in parts:
            if (p[1] == 'ntfs'):
                self.startpart = p[0] + 1
                self.startsector = p[4] + 1

        avsec = (self.dinfo[1] * self.dinfo[2] - self.startsector)
        self.avG = avsec * self.dinfo[3] / 1.0e9
        if (self.startpart > 1):
            popupMessage(_("One or more NTFS (Windows) partitions were"
                    " found. These will be retained. The available space"
                    " is thus reduced to %3.1f GB.\n"
                    "Allocation will begin at partition %d.") %
                        (self.avG, self.startpart))

        self.homesizeG = 0.0
        self.swapsizeG = 0.0
        self.root = None    # To suppress writing before widget is created

        self.swapfc = None  # To suppress errors due to widget not yet ready
        # swap size
        self.swapWidget()

        self.swapfc = self.addCheckButton(_("Check for bad blocks "
                "when formatting swap partition.\nClear this when running "
                "in VirtualBox (it takes forever)."))
        self.setCheck(self.swapfc, True)

        # home size
        self.homeWidget()

        # root size
        self.root = self.addWidget(ShowInfoWidget(
                _("Space for Linux system:  ")))
        self.adjustroot()
示例#12
0
    def __init__(self):
        Stage.__init__(self, moduleDescription)

        ld = install.listDevices()

        # Offer gparted - if available
        if (install.gparted_available() == ""):
            gparted = self.addOption('gparted',
                    _("Use gparted (recommended)"), True)
        else:
            gparted = None

        # Offer cfdisk on each available disk device
        mounts = install.getmounts().splitlines()
        mounteds = 0
        i = 0
        if ld:
            for d, s, n in ld:
                i += 1
                # Determine devices which have mounted partitions
                dstring = "%16s  (%10s : %s)" % (d, s, n)
                style = None
                for m in mounts:
                    if m.startswith(d):
                        style = 'red'
                        mounteds += 1
                        break
                self.addOption('cfdisk-%s' % d,
                        _("Use cfdisk on %s (%s)") % (d, s),
                        (i == 1) and not gparted,
                        style=style)

        else:
            popupError(_("No disk(-like) devices were found,"
                    " so Arch Linux can not be installed on this machine"))
            mainWindow.exit()

        if mounteds:
            self.addLabel(_('WARNING: Editing partitions on a device with'
                    ' mounted partitions (those marked in red) is likely'
                    ' to cause a lot of trouble!\n'
                    'If possible, unmount them and then restart this'
                    ' program.'), style='red')

        # Offer 'use existing partitions/finished'
        self.done = self.addOption('done',
                _("Use existing partitions / finished editing partitions"))
示例#13
0
 def __init__(self, auto_commit_and_push, parent_module_name, is_logging,
              log_file_path, vcs_obj):
     """
     Parameters
     ----------
     parent_module_name: str
         a parent module name
     auto_commit_and_push : bool
         auto commit and push after Test stage
     is_logging : bool
         write messages to the log file or not
     log_file_path : str
         a path to directory for the log file
     vcs_obj : VCS
         VCS object
     """
     Stage.__init__(self, parent_module_name, False, log_file_path,
                    'Commit', is_logging, "", "", "", False)
     self._vcs_obj = vcs_obj
     self._auto_commit_and_push = auto_commit_and_push
示例#14
0
    def __init__(self, path, parent_module_name, interrupt_if_fail, is_logging,
                 log_file_path, stage_name, targets, pre_script_path,
                 main_script_path, post_script_path, only_fail_notification):
        """
        Parameters
        ----------
        path : str
            a path to directory with build file(Makefile and etc)
        parent_module_name: str
            a parent module name
        interrupt_if_fail : bool
            interrupt the execution of the all stages if an error has occurred
        is_logging : bool
            write messages to the log file or not
        log_file_path : str
            a path to directory for the log file
        stage_name : str
            stage name
        targets : list
            list of targets to build
        pre_script_path : str
            script for pre_exec()
        main_script_path : str
            script for exec()
        post_script_path : str
            script for post_exec()
        only_fail_notification : bool
            notification condition
        """
        Stage.__init__(self, parent_module_name, interrupt_if_fail,
                       log_file_path, stage_name, is_logging, pre_script_path,
                       main_script_path, post_script_path,
                       only_fail_notification)
        self._build_path = path
        if self._build_path[-1] != os.sep:
            self._build_path += os.sep
        self._build_targets = targets.copy()

        if not os.path.exists(self._build_path):
            raise FileNotFoundError("Build: Directory " + self._build_path +
                                    " doesn't exists!")
示例#15
0
    def __init__(self):
        """
        """
        Stage.__init__(self, moduleDescription)

        self.swaps = {}
        inuse = install.getActiveSwaps()
        self.done = []
        if inuse:
            self.addLabel(_("The following swap partitions are currently"
                    " in use and will not be formatted (they shouldn't"
                    " need it!)."))
        for p, s in inuse:
            b = self.addCheckButton("%12s - %s %4.1f GB" % (p, _("size"), s))
            self.setCheck(b, True)
            self.done.append(p)
            self.swaps[p] = b

        all = install.getAllSwaps()
        fmt = []
        for p, s in all:
            if not (p in self.done):
                fmt.append((p, s))
        if fmt:
            self.addLabel(_("The following swap partitions will be formatted"
                    " if you select them for inclusion."))
        for p, s in fmt:
            b = self.addCheckButton("%12s - %s %4.1f GB" % (p, _("size"), s))
            self.setCheck(b, True)
            self.swaps[p] = b

        if all:
            self.cformat = self.addCheckButton(_("Check for bad blocks "
                    "when formatting.\nClear this when running in VirtualBox "
                    "(it takes forever)."))
            self.setCheck(self.cformat, True)
        else:
            self.addLabel(_("There are no swap partitions available. If the"
                    " installation computer does not have a large amount of"
                    " memory, you are strongly advised to create one before"
                    " continuing."))
示例#16
0
    def __init__(self):
        Stage.__init__(self, moduleDescription)

        self.device = None
        self.mounts = install.getmounts()
        # List of partitions already configured for use.
        #    Each entry has the form [mount-point, device, format,
        #                         format-flags, mount-flags]
        global used_partitions
        used_partitions = []
        parts = install.get_config("partitions", False)
        if parts:
            for p in parts.splitlines():
                used_partitions.append(p.split(':'))

        self.table = SelTable()
        self.devselect = SelDevice([d[0] for d in install.listDevices()],
                self.setDevice)
        self.addWidget(self.devselect, False)

        self.addWidget(self.table)
示例#17
0
 def __init__(self, script_path, parent_module_name, interrupt_if_fail,
              is_logging, log_file_path, only_fail_notification):
     """
     Parameters
     ----------
     script_path : str
         an absolute path to tests
     parent_module_name: str
         a parent module name
     interrupt_if_fail : bool
         interrupt the execution of the all stages if an error has occurred
     is_logging : bool
         write messages to the log file or not
     log_file_path : str
         an absolute path to directory for the log file
     only_fail_notification : bool
         notification condition
     """
     Stage.__init__(self, parent_module_name, interrupt_if_fail,
                    log_file_path, 'Test', is_logging, "", script_path, "",
                    only_fail_notification)
示例#18
0
    def __init__(self, parent, state):
        Stage.__init__(self, parent)
        self.state = state
        
        self.state = state
        
        self.fps_counter = FpsCounter()

        self.init_widgets()
        self.init_bindings()

        self.ghost_piece = None

        #True when the user pauses the game
        self.paused = False

        #True when a coroutine is playing that should halt game logic, ex. when lines flash before disappearing
        self.blocking = False

        self.state.register_listener(self.model_alert)
        self.state.start()
        self.update_labels()
示例#19
0
 def __init__(self):
     Stage.__init__(self, moduleDescription)
     self.addLabel(
         _("If all went well, your installation should now" " be bootable. Click on OK to quit the installer.")
     )
示例#20
0
    def __init__(self):
        Stage.__init__(self, moduleDescription)

        self.pwe = self.addWidget(PWEnter())
        self.reinit()