Source files: 67
Click here to show/hide file namesSource files:
./ubiquity/wrap_label.py,
./ubiquity/install_misc.py,
./ubiquity/filteredcommand.py,
./ubiquity/debconffilter.py,
./ubiquity/gtkwidgets.py,
./ubiquity/auto_update.py,
./ubiquity/gconftool.py,
./ubiquity/misc.py,
./ubiquity/i18n.py,
./ubiquity/validation.py,
./ubiquity/progressposition.py,
./ubiquity/timezone_map.py,
./ubiquity/__init__.py,
./ubiquity/debconfcommunicator.py,
./ubiquity/plugin_manager.py,
./ubiquity/tz.py,
./ubiquity/segmented_bar.py,
./ubiquity/plugin.py,
./ubiquity/qtwidgets.py,
./ubiquity/keyboard_detector.py,
./ubiquity/osextras.py,
./ubiquity/im_switch.py,
./ubiquity/casper.py,
./ubiquity/parted_server.py,
./ubiquity/plugins/ubi-timezone.py,
./ubiquity/plugins/ubi-partman.py,
./ubiquity/plugins/ubi-network.py,
./ubiquity/plugins/ubi-migrationassistant.py,
./ubiquity/plugins/ubi-usersetup.py,
./ubiquity/plugins/ubi-console-setup.py,
./ubiquity/plugins/ubi-prepare.py,
./ubiquity/plugins/ubi-tasks.py,
./ubiquity/plugins/ubi-language.py,
./ubiquity/frontend/base.py,
./ubiquity/frontend/gtk_ui.py,
./ubiquity/frontend/noninteractive.py,
./ubiquity/frontend/__init__.py,
./ubiquity/frontend/kde_ui.py,
./ubiquity/frontend/debconf_ui.py,
./ubiquity/frontend/gtk_components/keyboard_query.py,
./ubiquity/frontend/gtk_components/__init__.py,
./ubiquity/frontend/kde_components/PartitionModel.py,
./ubiquity/frontend/kde_components/PartAuto.py,
./ubiquity/frontend/kde_components/PartMan.py,
./ubiquity/frontend/kde_components/Keyboard.py,
./ubiquity/frontend/kde_components/SqueezeLabel.py,
./ubiquity/frontend/kde_components/__init__.py,
./ubiquity/frontend/kde_components/Timezone.py,
./ubiquity/frontend/kde_components/PartitionBar.py,
./ubiquity/frontend/kde_components/ProgressDialog.py,
./ubiquity/frontend/kde_components/testing/partman.py,
./ubiquity/frontend/kde_components/testing/partitionbar.py,
./ubiquity/frontend/kde_components/testing/partauto.py,
./ubiquity/components/yabootinstaller.py,
./ubiquity/components/kbootinstaller.py,
./ubiquity/components/check_kernels.py,
./ubiquity/components/flash_kernel.py,
./ubiquity/components/partman_commit.py,
./ubiquity/components/apt_setup.py,
./ubiquity/components/hw_detect.py,
./ubiquity/components/grubinstaller.py,
./ubiquity/components/__init__.py,
./ubiquity/components/install.py,
./ubiquity/components/plugininstall.py,
./src/cheese/tests/cheese-test-chooser.py,
./scripts/install.py,
./scripts/plugininstall.py
Clones detected: 191
2028 of 14979 lines are duplicates (13.54%)
Parameters
clustering_threshold = 10
distance_threshold = 5
size_threshold = 5
hashing_depth = 1
clusterize_using_hash = False
clusterize_using_dcup = False
Clone # 1
Distance between two fragments = 0
Clone size = 21
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 817 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1000 | |
|
def add_history(self, page, widget): history_entry = (page, widget) if self.history: if history_entry in self.history: idx = self.history.index(history_entry) if (idx) + (1) < len(self.history): self.history = self.history[:(idx) + (1)] return None new_index = self.pages.index(page) old_index = self.pages.index(self.history[-1][0]) if new_index < old_index: while (self.history[-1][0] != page) and (len(self.history) > 1): self.pop_history() i = (old_index) + (1) while i < new_index: for _ in self.pages[i].widgets: self.history.append((self.pages[i], None)) i += 1 if history_entry == self.history[-1]: return None self.history.append(history_entry) |
def add_history(self, page, widget): history_entry = (page, widget) if self.history: if history_entry in self.history: idx = self.history.index(history_entry) if (idx) + (1) < len(self.history): self.history = self.history[:(idx) + (1)] return None new_index = self.pages.index(page) old_index = self.pages.index(self.history[-1][0]) if new_index < old_index: while (self.history[-1][0] != page) and (len(self.history) > 1): self.pop_history() i = (old_index) + (1) while i < new_index: for _ in self.pages[i].widgets: self.history.append((self.pages[i], None)) i += 1 if history_entry == self.history[-1]: return None self.history.append(history_entry) |
Clone # 2
Distance between two fragments = 3
Clone size = 20
| Source file "./scripts/plugininstall.py" The first line is 1152 | Source file "./scripts/install.py" The first line is 180 | |
| manifest_desktop = os.path.join(self.casper_path, 'filesystem.manifest-desktop') | manifest_desktop = os.path.join(self.casper_path, 'filesystem.manifest-desktop') | |
| manifest = os.path.join(self.casper_path, 'filesystem.manifest') | manifest = os.path.join(self.casper_path, 'filesystem.manifest') | |
|
if (os.path.exists(manifest_desktop)) and (os.path.exists(manifest)): desktop_packages = set() manifest_file = open(manifest_desktop) for line in manifest_file: if (line.strip() != '') and (not line.startswith('#')): desktop_packages.add(line.split()[0]) manifest_file.close() live_packages = set() manifest_file = open(manifest) for line in manifest_file: if (line.strip() != '') and (not line.startswith('#')): live_packages.add(line.split()[0]) manifest_file.close() difference = (live_packages) - (desktop_packages) else: difference = set() |
if (os.path.exists(manifest_desktop)) and (os.path.exists(manifest)): desktop_packages = set() manifest_file = open(manifest_desktop) for line in manifest_file: if (line.strip() != '') and (not line.startswith('#')): desktop_packages.add(line.split()[0]) manifest_file.close() live_packages = set() manifest_file = open(manifest) for line in manifest_file: if (line.strip() != '') and (not line.startswith('#')): live_packages.add(line.split()[0]) manifest_file.close() difference = (live_packages) - (desktop_packages) else: difference = set() |
|
| keep = install_misc.query_recorded_installed() | cache = Cache() |
Clone # 3
Distance between two fragments = 3
Clone size = 19
| Source file "./ubiquity/gtkwidgets.py" The first line is 615 | Source file "./ubiquity/gtkwidgets.py" The first line is 589 | |
| self.offscreen_window = gtk.gdk.Window(self.get_root_window(), x=(self.allocation.x) + (border_width), y=(self.allocation.y) + (border_width), width=w, height=h, window_type=gtk.gdk.WINDOW_OFFSCREEN, event_mask=(self.get_events()) | (gtk.gdk.EXPOSURE_MASK) | (gtk.gdk.POINTER_MOTION_MASK) | (gtk.gdk.BUTTON_PRESS_MASK) | (gtk.gdk.BUTTON_RELEASE_MASK) | (gtk.gdk.SCROLL_MASK) | (gtk.gdk.ENTER_NOTIFY_MASK) | (gtk.gdk.LEAVE_NOTIFY_MASK), visual=self.get_visual(), colormap=self.get_colormap(), wclass=gtk.gdk.INPUT_OUTPUT) | self.window = gtk.gdk.Window(self.get_parent_window(), x=(self.allocation.x) + (border_width), y=(self.allocation.y) + (border_width), width=w, height=h, window_type=gtk.gdk.WINDOW_CHILD, event_mask=(self.get_events()) | (gtk.gdk.EXPOSURE_MASK) | (gtk.gdk.POINTER_MOTION_MASK) | (gtk.gdk.BUTTON_PRESS_MASK) | (gtk.gdk.BUTTON_RELEASE_MASK) | (gtk.gdk.SCROLL_MASK) | (gtk.gdk.ENTER_NOTIFY_MASK) | (gtk.gdk.LEAVE_NOTIFY_MASK), visual=self.get_visual(), colormap=self.get_colormap(), wclass=gtk.gdk.INPUT_OUTPUT) | |
| self.offscreen_window.set_user_data(self) | self.window.set_user_data(self) |
Clone # 4
Distance between two fragments = 1
Clone size = 17
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 327 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 857 | |
|
if (current_size is not None) and (size is not None) and (current_size == size): size = None |
if (current_size is not None) and (size is not None) and (current_size == size): size = None |
|
|
if method == current_method: method = None |
if method == current_method: method = None |
|
|
if fmt == current_format: fmt = None |
if fmt == current_format: fmt = None |
|
|
if mountpoint == current_mountpoint: mountpoint = None |
if mountpoint == current_mountpoint: mountpoint = None |
|
|
if (size is not None) or (method is not None) or (fmt is not None) or (mountpoint is not None): self.ctrlr.allow_change_step(False) edits = {'size': size, 'method': method, 'mountpoint': mountpoint} if fmt is not None: edits['fmt'] = 'dummy' self.ctrlr.dbfilter.edit_partition(devpart, **edits) |
if (size is not None) or (method is not None) or (fmt is not None) or (mountpoint is not None): self.controller.allow_change_step(False) edits = {'size': size, 'method': method, 'mountpoint': mountpoint} if fmt is not None: edits['fmt'] = 'dummy' self.controller.dbfilter.edit_partition(devpart, **edits) |
Clone # 5
Distance between two fragments = 0
Clone size = 16
| Source file "./ubiquity/misc.py" The first line is 397 | Source file "./ubiquity/gtkwidgets.py" The first line is 17 | |
|
def format_size(size): if size < 1000: unit = 'B' factor = 1 elif size < (1000) * (1000): unit = 'kB' factor = 1000 elif size < ((1000) * (1000)) * (1000): unit = 'MB' factor = (1000) * (1000) elif size < (((1000) * (1000)) * (1000)) * (1000): unit = 'GB' factor = ((1000) * (1000)) * (1000) else: unit = 'TB' factor = (((1000) * (1000)) * (1000)) * (1000) return ('%.1f %s') % (((float(size)) / (factor), unit)) |
def format_size(size): if size < 1000: unit = 'B' factor = 1 elif size < (1000) * (1000): unit = 'kB' factor = 1000 elif size < ((1000) * (1000)) * (1000): unit = 'MB' factor = (1000) * (1000) elif size < (((1000) * (1000)) * (1000)) * (1000): unit = 'GB' factor = ((1000) * (1000)) * (1000) else: unit = 'TB' factor = (((1000) * (1000)) * (1000)) * (1000) return ('%.1f %s') % (((float(size)) / (factor), unit)) |
Clone # 6
Distance between two fragments = 4
Clone size = 15
| Source file "./ubiquity/gtkwidgets.py" The first line is 504 | Source file "./ubiquity/gtkwidgets.py" The first line is 383 | |
| __gtype_name__ = 'LabelledComboBoxEntry' | __gtype_name__ = 'StateBox' | |
| __gproperties__ = {'label': (gobject.TYPE_STRING, 'Label', None, 'label', gobject.PARAM_READWRITE)} | __gproperties__ = {'label': (gobject.TYPE_STRING, 'Label', None, 'label', gobject.PARAM_READWRITE)} | |
|
def do_get_property(self, prop): if prop.name == 'label': return self.child.get_label() return getattr(self, prop.name) |
def do_get_property(self, prop): if prop.name == 'label': return self.label.get_text() return getattr(self, prop.name) |
|
|
def do_set_property(self, prop, value): if prop.name == 'label': self.child.set_label(value) return None setattr(self, prop.name, value) |
def do_set_property(self, prop, value): if prop.name == 'label': self.label.set_text(value) return None setattr(self, prop.name, value) |
Clone # 7
Distance between two fragments = 4
Clone size = 14
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 1034 | Source file "./ubiquity/frontend/kde_ui.py" The first line is 1024 | |
|
def watch_debconf_fd_helper_write(self, source): debconf_condition = 0 debconf_condition |= filteredcommand.DEBCONF_IO_OUT callback = self.debconf_callbacks[source] if not callback(source, debconf_condition): if callback == self.debconf_callbacks[source]: self.watch_debconf_fd_helper_disconnect(source) |
def watch_debconf_fd_helper_read(self, source): debconf_condition = 0 debconf_condition |= filteredcommand.DEBCONF_IO_IN callback = self.debconf_callbacks[source] if not callback(source, debconf_condition): if callback == self.debconf_callbacks[source]: self.watch_debconf_fd_helper_disconnect(source) |
|
|
def watch_debconf_fd_helper_exception(self, source): debconf_condition = 0 debconf_condition |= filteredcommand.DEBCONF_IO_ERR callback = self.debconf_callbacks[source] if not callback(source, debconf_condition): if callback == self.debconf_callbacks[source]: self.watch_debconf_fd_helper_disconnect(source) |
def watch_debconf_fd_helper_write(self, source): debconf_condition = 0 debconf_condition |= filteredcommand.DEBCONF_IO_OUT callback = self.debconf_callbacks[source] if not callback(source, debconf_condition): if callback == self.debconf_callbacks[source]: self.watch_debconf_fd_helper_disconnect(source) |
Clone # 8
Distance between two fragments = 0
Clone size = 13
| Source file "./ubiquity/frontend/noninteractive.py" The first line is 128 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1268 | |
|
def watch_debconf_fd(self, from_debconf, process_input): gobject.io_add_watch(from_debconf, (gobject.IO_IN) | (gobject.IO_ERR) | (gobject.IO_HUP), self.watch_debconf_fd_helper, process_input) |
def watch_debconf_fd(self, from_debconf, process_input): gobject.io_add_watch(from_debconf, (gobject.IO_IN) | (gobject.IO_ERR) | (gobject.IO_HUP), self.watch_debconf_fd_helper, process_input) |
|
|
def watch_debconf_fd_helper(self, source, cb_condition, callback): debconf_condition = 0 if (cb_condition) & (gobject.IO_IN) != 0: debconf_condition |= filteredcommand.DEBCONF_IO_IN if (cb_condition) & (gobject.IO_ERR) != 0: debconf_condition |= filteredcommand.DEBCONF_IO_ERR if (cb_condition) & (gobject.IO_HUP) != 0: debconf_condition |= filteredcommand.DEBCONF_IO_HUP return callback(source, debconf_condition) |
def watch_debconf_fd_helper(self, source, cb_condition, callback): debconf_condition = 0 if (cb_condition) & (gobject.IO_IN) != 0: debconf_condition |= filteredcommand.DEBCONF_IO_IN if (cb_condition) & (gobject.IO_ERR) != 0: debconf_condition |= filteredcommand.DEBCONF_IO_ERR if (cb_condition) & (gobject.IO_HUP) != 0: debconf_condition |= filteredcommand.DEBCONF_IO_HUP return callback(source, debconf_condition) |
Clone # 9
Distance between two fragments = 0
Clone size = 13
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 1183 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1406 | |
|
if self.dbfilter is not None: self.dbfilter.cancel_handler() |
if self.dbfilter is not None: self.dbfilter.cancel_handler() |
|
| self.pagesindex = -1 | self.pagesindex = -1 | |
|
for page in self.pages: if page.module.NAME == 'partman': self.pagesindex = self.pages.index(page) break |
for page in self.pages: if page.module.NAME == 'partman': self.pagesindex = self.pages.index(page) break |
|
|
if self.pagesindex == -1: return None |
if self.pagesindex == -1: return None |
|
| self.start_debconf() | self.start_debconf() | |
| ui = self.pages[self.pagesindex].ui | ui = self.pages[self.pagesindex].ui | |
| self.dbfilter = self.pages[self.pagesindex].filter_class(self, ui=ui) | self.dbfilter = self.pages[self.pagesindex].filter_class(self, ui=ui) | |
| self.allow_change_step(False) | self.allow_change_step(False) | |
| self.dbfilter.start(auto_process=True) | self.dbfilter.start(auto_process=True) |
Clone # 10
Distance between two fragments = 2
Clone size = 12
| Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 172 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 135 | |
| model = self.keyboardvariantview.get_model() | model = self.keyboardlayoutview.get_model() | |
|
if model is None: return None |
if model is None: return None |
|
| iterator = model.iter_children(None) | iterator = model.iter_children(None) | |
|
while iterator is not None: if unicode(model.get_value(iterator, 0)) == variant: path = model.get_path(iterator) self.keyboardvariantview.get_selection().select_path(path) self.keyboardvariantview.scroll_to_cell(path, use_align=True, row_align=0.5) break iterator = model.iter_next(iterator) |
while iterator is not None: if unicode(model.get_value(iterator, 0)) == layout: path = model.get_path(iterator) self.keyboardlayoutview.get_selection().select_path(path) self.keyboardlayoutview.scroll_to_cell(path, use_align=True, row_align=0.5) break iterator = model.iter_next(iterator) |
Clone # 11
Distance between two fragments = 4
Clone size = 11
| Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 158 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 117 | |
| variants = gtk.ListStore(gobject.TYPE_STRING) | layouts = gtk.ListStore(gobject.TYPE_STRING) | |
| self.keyboardvariantview.set_model(variants) | self.keyboardlayoutview.set_model(layouts) | |
|
for v in sorted(choices): variants.append([v]) |
for v in sorted(choices): layouts.append([v]) |
|
|
if len(self.keyboardvariantview.get_columns()) < 1: column = gtk.TreeViewColumn('Variant', gtk.CellRendererText(), text=0) column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) self.keyboardvariantview.append_column(column) selection = self.keyboardvariantview.get_selection() selection.connect('changed', self.on_keyboard_variant_selected) |
if len(self.keyboardlayoutview.get_columns()) < 1: column = gtk.TreeViewColumn('Layout', gtk.CellRendererText(), text=0) column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) self.keyboardlayoutview.append_column(column) selection = self.keyboardlayoutview.get_selection() selection.connect('changed', self.on_keyboard_layout_selected) |
Clone # 12
Distance between two fragments = 4
Clone size = 11
| Source file "./ubiquity/gtkwidgets.py" The first line is 319 | Source file "./ubiquity/gtkwidgets.py" The first line is 312 | |
| align.add(self.ostitle) | align.add(self.logo) | |
| vbox.pack_start(align, expand=False) | vbox.pack_start(align, expand=False) | |
| self.extra = gtk.Label() | self.ostitle = gtk.Label() | |
| self.extra.set_ellipsize(pango.ELLIPSIZE_END) | self.ostitle.set_ellipsize(pango.ELLIPSIZE_END) | |
| align = gtk.Alignment(0.5, 0.5, 0.5, 0.5) | align = gtk.Alignment(0.5, 0.5, 0.5, 0.5) | |
| align.set_padding(4, 0, 0, 0) | align.set_padding(6, 0, 0, 0) | |
| align.add(self.extra) | align.add(self.ostitle) | |
| vbox.pack_start(align, expand=False) | vbox.pack_start(align, expand=False) | |
| self.size = gtk.Label() | self.extra = gtk.Label() | |
| self.size.set_ellipsize(pango.ELLIPSIZE_END) | self.extra.set_ellipsize(pango.ELLIPSIZE_END) | |
| align = gtk.Alignment(0.5, 0.5, 0.5, 0.5) | align = gtk.Alignment(0.5, 0.5, 0.5, 0.5) |
Clone # 13
Distance between two fragments = 0
Clone size = 11
| Source file "./scripts/install.py" The first line is 75 | Source file "./scripts/plugininstall.py" The first line is 89 | |
| apt_pkg.InitConfig() | apt_pkg.InitConfig() | |
| apt_pkg.Config.set('Dir', self.target) | apt_pkg.Config.set('Dir', self.target) | |
| apt_pkg.Config.set('Dir::State::status', os.path.join(self.target, 'var/lib/dpkg/status')) | apt_pkg.Config.set('Dir::State::status', os.path.join(self.target, 'var/lib/dpkg/status')) | |
| apt_pkg.Config.set('APT::GPGV::TrustedKeyring', os.path.join(self.target, 'etc/apt/trusted.gpg')) | apt_pkg.Config.set('APT::GPGV::TrustedKeyring', os.path.join(self.target, 'etc/apt/trusted.gpg')) | |
| apt_pkg.Config.set('Acquire::gpgv::Options::', '--ignore-time-conflict') | apt_pkg.Config.set('Acquire::gpgv::Options::', '--ignore-time-conflict') | |
| apt_pkg.Config.set('DPkg::Options::', ('--root=%s') % (self.target)) | apt_pkg.Config.set('DPkg::Options::', ('--root=%s') % (self.target)) | |
| apt_pkg.Config.clear('DPkg::Pre-Install-Pkgs') | apt_pkg.Config.clear('DPkg::Pre-Install-Pkgs') | |
| apt_pkg.InitSystem() | apt_pkg.InitSystem() |
Clone # 14
Distance between two fragments = 0
Clone size = 10
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 445 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 571 | |
|
if (self.backup) or (self.dbfilter_handle_status()): if (self.current_page is not None) and (not self.backup): self.process_step() if not self.stay_on_page: self.pagesindex = (self.pagesindex) + (1) if 'UBIQUITY_AUTOMATIC' in os.environ: self.debconf_progress_step(1) self.refresh() if self.backup: self.pagesindex = self.pop_history() |
if (self.backup) or (self.dbfilter_handle_status()): if (self.current_page is not None) and (not self.backup): self.process_step() if not self.stay_on_page: self.pagesindex = (self.pagesindex) + (1) if 'UBIQUITY_AUTOMATIC' in os.environ: self.debconf_progress_step(1) self.refresh() if self.backup: self.pagesindex = self.pop_history() |
Clone # 15
Distance between two fragments = 0
Clone size = 10
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 94 | Source file "./ubiquity/plugins/ubi-language.py" The first line is 419 | |
|
if (self.controller.oem_config) or (auto_update.already_updated()): self.update_installer = False |
if (self.controller.oem_config) or (auto_update.already_updated()): self.update_installer = False |
|
|
try: release_notes = open(_release_notes_url_path) self.release_notes_url = release_notes.read().rstrip('\n') release_notes.close() self.release_notes_found = True except (KeyboardInterrupt, SystemExit): raise except: pass |
try: release_notes = open(_release_notes_url_path) self.release_notes_url = release_notes.read().rstrip('\n') release_notes.close() self.release_notes_found = True except (KeyboardInterrupt, SystemExit): raise except: pass |
Clone # 16
Distance between two fragments = 0
Clone size = 10
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 466 | Source file "./ubiquity/plugins/ubi-language.py" The first line is 138 | |
| bus = dbus.SystemBus() | bus = dbus.SystemBus() | |
| bus.add_signal_receiver(self.network_change, 'DeviceNoLongerActive', 'org.freedesktop.NetworkManager', 'org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') | bus.add_signal_receiver(self.network_change, 'DeviceNoLongerActive', 'org.freedesktop.NetworkManager', 'org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') | |
| bus.add_signal_receiver(self.network_change, 'StateChange', 'org.freedesktop.NetworkManager', 'org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') | bus.add_signal_receiver(self.network_change, 'StateChange', 'org.freedesktop.NetworkManager', 'org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') |
Clone # 17
Distance between two fragments = 2
Clone size = 10
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 128 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 122 | |
|
def allow_go_backward(self, allowed): try: self._wizard.allow_go_backward(allowed) except AttributeError: pass |
def allow_go_forward(self, allowed): try: self._wizard.allow_go_forward(allowed) except AttributeError: pass |
|
|
def allow_change_step(self, allowed): try: self._wizard.allow_change_step(allowed) except AttributeError: pass |
def allow_go_backward(self, allowed): try: self._wizard.allow_go_backward(allowed) except AttributeError: pass |
Clone # 18
Distance between two fragments = 3
Clone size = 10
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 119 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 953 | |
|
for action in self.ctrlr.dbfilter.get_actions(devpart, partition): if action == 'new_label': self.partition_button_new_label.setEnabled(True) elif action == 'new': self.partition_button_new.setEnabled(True) elif action == 'edit': self.partition_button_edit.setEnabled(True) elif action == 'delete': self.partition_button_delete.setEnabled(True) |
for action in self.controller.dbfilter.get_actions(devpart, partition): if action == 'new_label': self.partition_button_new_label.set_sensitive(True) elif action == 'new': self.partition_button_new.set_sensitive(True) elif action == 'edit': self.partition_button_edit.set_sensitive(True) elif action == 'delete': self.partition_button_delete.set_sensitive(True) |
|
| self.undo_everything.setEnabled(True) | self.partition_button_undo.set_sensitive(True) |
Clone # 19
Distance between two fragments = 4
Clone size = 9
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 519 | Source file "./ubiquity/plugins/ubi-language.py" The first line is 501 | |
| self.wget_retcode_release_notes = self.wget_proc_release_notes.poll() | self.wget_retcode = self.wget_proc.poll() | |
|
if self.wget_retcode_release_notes is None: return True else: if self.wget_retcode_release_notes == 0: self.release_notes_found = True else: self.release_notes_found = False self.update_release_notes_label() self.timer.disconnect(self.timer, SIGNAL('timeout()'), self.check_returncode_release_notes) |
if self.wget_retcode is None: return True else: if self.wget_retcode == 0: self.update_installer = True else: self.update_installer = False self.update_release_notes_label() self.timer.disconnect(self.timer, SIGNAL('timeout()'), self.check_returncode) |
Clone # 20
Distance between two fragments = 2
Clone size = 10
| Source file "./scripts/plugininstall.py" The first line is 1270 | Source file "./scripts/plugininstall.py" The first line is 1327 | |
| uid = subprocess.Popen(['chroot', self.target, 'sudo', '-u', target_user, '--', 'id', '-u'], stdout=subprocess.PIPE).communicate()[0].strip('\n') | uid = subprocess.Popen(['chroot', self.target, 'sudo', '-u', target_user, '--', 'id', '-u'], stdout=subprocess.PIPE).communicate()[0].strip('\n') | |
| gid = subprocess.Popen(['chroot', self.target, 'sudo', '-u', target_user, '--', 'id', '-g'], stdout=subprocess.PIPE).communicate()[0].strip('\n') | gid = subprocess.Popen(['chroot', self.target, 'sudo', '-u', target_user, '--', 'id', '-g'], stdout=subprocess.PIPE).communicate()[0].strip('\n') | |
| uid = int(uid) | uid = int(uid) | |
| gid = int(gid) | gid = int(gid) | |
| self.copy_tree(source_keyrings, target_keyrings, uid, gid) | self.copy_tree(casper_user_wallpaper_cache_dir, target_user_wallpaper_cache_dir, uid, gid) |
Clone # 21
Distance between two fragments = 4
Clone size = 9
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 347 | Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 213 | |
|
if not hasattr(self, 'edit_use_method_names'): return None |
if not hasattr(self, 'create_use_method_names'): return None |
|
| known_filesystems = ('ext4', 'ext3', 'ext2', 'btrfs', 'reiserfs', 'jfs', 'xfs', 'fat16', 'fat32', 'ntfs', 'uboot') | known_filesystems = ('ext4', 'ext3', 'ext2', 'btrfs', 'reiserfs', 'jfs', 'xfs', 'fat16', 'fat32', 'ntfs', 'uboot') | |
| text = unicode(self.edit_dialog.partition_edit_use_combo.currentText()) | text = unicode(self.create_dialog.partition_create_use_combo.currentText()) | |
|
if text not in self.edit_use_method_names: return None |
if text not in self.create_use_method_names: return None |
|
| method = self.edit_use_method_names[text] | method = self.create_use_method_names[text] |
Clone # 22
Distance between two fragments = 2
Clone size = 9
| Source file "./ubiquity/segmented_bar.py" The first line is 642 | Source file "./ubiquity/segmented_bar.py" The first line is 629 | |
|
if self.max_size != -1: a = ((self.max_size) + (resize_part_start)) / (float(self.disk_size)) if b > a: self.segments[self.resize].set_size(self.max_size) self.segments[(self.resize) + (1)].set_size((total) - (self.max_size)) self.queue_draw() return None else: return None |
if self.min_size != -1: a = ((self.min_size) + (resize_part_start)) / (float(self.disk_size)) if b < a: self.segments[self.resize].set_size(self.min_size) self.segments[(self.resize) + (1)].set_size((total) - (self.min_size)) self.queue_draw() return None else: return None |
Clone # 23
Distance between two fragments = 3
Clone size = 9
| Source file "./ubiquity/debconffilter.py" The first line is 351 | Source file "./ubiquity/debconffilter.py" The first line is 341 | |
| progress_inc = int(params[1]) | progress_val = int(params[1]) | |
|
for widget in self.find_widgets([self.progress_bars[0], 'PROGRESS'], 'progress_step'): self.debug('filter', 'widget found for', self.progress_bars[0]) if not widget.progress_step(self.progress_bars[0], progress_inc): cancelled = True |
for widget in self.find_widgets([self.progress_bars[0], 'PROGRESS'], 'progress_set'): self.debug('filter', 'widget found for', self.progress_bars[0]) if not widget.progress_set(self.progress_bars[0], progress_val): cancelled = True |
Clone # 24
Distance between two fragments = 2
Clone size = 9
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 244 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 175 | |
| iterator = model.iter_children(None) | iterator = model.iter_children(None) | |
|
while iterator is not None: if unicode(model.get_value(iterator, 0)) == language: path = model.get_path(iterator) self.treeview.get_selection().select_path(path) self.treeview.scroll_to_cell(path, use_align=True, row_align=0.5) break iterator = model.iter_next(iterator) |
while iterator is not None: if unicode(model.get_value(iterator, 0)) == variant: path = model.get_path(iterator) self.keyboardvariantview.get_selection().select_path(path) self.keyboardvariantview.scroll_to_cell(path, use_align=True, row_align=0.5) break iterator = model.iter_next(iterator) |
Clone # 25
Distance between two fragments = 2
Clone size = 9
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 244 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 138 | |
| iterator = model.iter_children(None) | iterator = model.iter_children(None) | |
|
while iterator is not None: if unicode(model.get_value(iterator, 0)) == language: path = model.get_path(iterator) self.treeview.get_selection().select_path(path) self.treeview.scroll_to_cell(path, use_align=True, row_align=0.5) break iterator = model.iter_next(iterator) |
while iterator is not None: if unicode(model.get_value(iterator, 0)) == layout: path = model.get_path(iterator) self.keyboardlayoutview.get_selection().select_path(path) self.keyboardlayoutview.scroll_to_cell(path, use_align=True, row_align=0.5) break iterator = model.iter_next(iterator) |
Clone # 26
Distance between two fragments = 0
Clone size = 8
| Source file "./ubiquity/components/partman_commit.py" The first line is 54 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2343 | |
|
if (priority == 'critical') or (priority == 'high'): response = self.frontend.question_dialog(self.description(question), self.extended_description(question), self.choices(question), use_templates=False) self.preseed(question, response, seen=False) else: self.preseed(question, 'unhandled', seen=False) |
if (priority == 'critical') or (priority == 'high'): response = self.frontend.question_dialog(self.description(question), self.extended_description(question), self.choices(question), use_templates=False) self.preseed(question, response, seen=False) else: self.preseed(question, 'unhandled', seen=False) |
|
| return True | return True |
Clone # 27
Distance between two fragments = 1
Clone size = 8
| Source file "./ubiquity/components/plugininstall.py" The first line is 49 | Source file "./ubiquity/components/install.py" The first line is 35 | |
| questions = ['^.*/apt-install-failed$', 'migration-assistant/failed-unmount', 'ubiquity/install/copying_error/md5', 'ubiquity/install/new-bootdev', 'CAPB', 'ERROR', 'PROGRESS'] | questions = ['^.*/apt-install-failed$', 'migration-assistant/failed-unmount', 'ubiquity/install/copying_error/md5', 'ubiquity/install/new-bootdev', 'CAPB', 'ERROR', 'PROGRESS'] | |
| return (['/usr/share/ubiquity/plugininstall.py'], questions) | return (['/usr/share/ubiquity/install.py'], questions) |
Clone # 28
Distance between two fragments = 3
Clone size = 8
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 187 | Source file "./ubiquity/plugins/ubi-language.py" The first line is 171 | |
| self.wget_retcode_release_notes = self.wget_proc_release_notes.poll() | self.wget_retcode = self.wget_proc.poll() | |
|
if self.wget_retcode_release_notes is None: return True else: if self.wget_retcode_release_notes == 0: self.release_notes_found = True else: self.release_notes_found = False self.update_release_notes_label() return False |
if self.wget_retcode is None: return True else: if self.wget_retcode == 0: self.update_installer = True else: self.update_installer = False self.update_release_notes_label() return False |
Clone # 29
Distance between two fragments = 3
Clone size = 8
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 1070 | Source file "./ubiquity/frontend/kde_ui.py" The first line is 1059 | |
|
def debconf_progress_step(self, progress_inc): self.progress_cancelled = self.progressDialog.wasCanceled() if self.progress_cancelled: return False self.progress_position.step(progress_inc) fraction = self.progress_position.fraction() self.ui.progressBar.setValue(int((fraction) * (self.ui.progressBar.maximum()))) return True |
def debconf_progress_set(self, progress_val): self.progress_cancelled = self.progressDialog.wasCanceled() if self.progress_cancelled: return False self.progress_position.set(progress_val) fraction = self.progress_position.fraction() self.ui.progressBar.setValue(int((fraction) * (self.ui.progressBar.maximum()))) return True |
Clone # 30
Distance between two fragments = 3
Clone size = 8
| Source file "./ubiquity/components/kbootinstaller.py" The first line is 22 | Source file "./ubiquity/components/yabootinstaller.py" The first line is 22 | |
|
class KbootInstaller(FilteredCommand): def prepare(self): return (['/usr/lib/ubiquity/kboot-installer/kboot-installer'], ['ERROR']) def error(self, priority, question): self.frontend.error_dialog(self.description(question), self.extended_description(question)) return FilteredCommand.error(self, priority, question) |
class YabootInstaller(FilteredCommand): def prepare(self): return (['/usr/lib/ubiquity/yaboot-installer/yaboot-installer', '/target'], ['ERROR']) def error(self, priority, question): self.frontend.error_dialog(self.description(question), self.extended_description(question)) return FilteredCommand.error(self, priority, question) |
Clone # 31
Distance between two fragments = 3
Clone size = 8
| Source file "./ubiquity/components/plugininstall.py" The first line is 82 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 416 | |
| response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/imported/yes', 'ubiquity/imported/no')) | |
|
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true') else: self.preseed(question, 'false') |
if (response is None) or (response == 'ubiquity/imported/yes'): self.preseed(question, 'true') else: self.preseed(question, 'false') |
|
| return True | return True |
Clone # 32
Distance between two fragments = 0
Clone size = 8
| Source file "./ubiquity/components/plugininstall.py" The first line is 82 | Source file "./ubiquity/plugins/ubi-migrationassistant.py" The first line is 218 | |
| response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | |
|
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true') else: self.preseed(question, 'false') |
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true') else: self.preseed(question, 'false') |
|
| return True | return True |
Clone # 33
Distance between two fragments = 3
Clone size = 8
| Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 416 | Source file "./ubiquity/plugins/ubi-migrationassistant.py" The first line is 218 | |
| response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/imported/yes', 'ubiquity/imported/no')) | response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | |
|
if (response is None) or (response == 'ubiquity/imported/yes'): self.preseed(question, 'true') else: self.preseed(question, 'false') |
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true') else: self.preseed(question, 'false') |
|
| return True | return True |
Clone # 34
Distance between two fragments = 0
Clone size = 9
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2238 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2220 | |
| response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | |
|
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true', seen=False) else: self.preseed(question, 'false', seen=False) |
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true', seen=False) else: self.preseed(question, 'false', seen=False) |
|
| return True | return True |
Clone # 35
Distance between two fragments = 0
Clone size = 8
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2238 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2037 | |
| response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | |
|
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true', seen=False) else: self.preseed(question, 'false', seen=False) |
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true', seen=False) else: self.preseed(question, 'false', seen=False) |
|
| return True | return True |
Clone # 36
Distance between two fragments = 0
Clone size = 9
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2220 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2037 | |
| response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | response = self.frontend.question_dialog(self.description(question), self.extended_description(question), ('ubiquity/text/go_back', 'ubiquity/text/continue')) | |
|
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true', seen=False) else: self.preseed(question, 'false', seen=False) |
if (response is None) or (response == 'ubiquity/text/continue'): self.preseed(question, 'true', seen=False) else: self.preseed(question, 'false', seen=False) |
|
| return True | return True |
Clone # 37
Distance between two fragments = 4
Clone size = 8
| Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 300 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 245 | |
|
if self.keyboardDisplay: var = None l = self.controller.dbfilter.get_locale() layout = keyboard_names.lang[l]['layouts'][self.get_keyboard()] if (variant) and (keyboard_names.lang[l]['variants'].has_key(layout)): variantMap = keyboard_names.lang[l]['variants'][layout] var = variantMap[utf8(variant)] self.keyboardDisplay.setVariant(var) |
if self.keyboardDisplay: var = None l = self.controller.dbfilter.get_locale() ly = keyboard_names.lang[l]['layouts'][layout] if (variant) and (keyboard_names.lang[l]['variants'].has_key(ly)): variantMap = keyboard_names.lang[l]['variants'][ly] var = variantMap[utf8(variant)] self.keyboardDisplay.setVariant(var) |
Clone # 38
Distance between two fragments = 3
Clone size = 8
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 186 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 708 | |
|
if partition['parted']['type'] == 'primary': prilog = PARTITION_TYPE_PRIMARY elif partition['parted']['type'] == 'logical': prilog = PARTITION_TYPE_LOGICAL elif partition['parted']['type'] == 'pri/log': if self.create_dialog.partition_create_type_primary.isChecked(): prilog = PARTITION_TYPE_PRIMARY else: prilog = PARTITION_TYPE_LOGICAL |
if partition['parted']['type'] == 'primary': prilog = PARTITION_TYPE_PRIMARY elif partition['parted']['type'] == 'logical': prilog = PARTITION_TYPE_LOGICAL elif partition['parted']['type'] == 'pri/log': if self.partition_create_type_primary.get_active(): prilog = PARTITION_TYPE_PRIMARY else: prilog = PARTITION_TYPE_LOGICAL |
Clone # 39
Distance between two fragments = 3
Clone size = 8
| Source file "./ubiquity/debconffilter.py" The first line is 362 | Source file "./ubiquity/debconffilter.py" The first line is 352 | |
|
for widget in self.find_widgets([self.progress_bars[0], 'PROGRESS'], 'progress_info'): self.debug('filter', 'widget found for', self.progress_bars[0]) if not widget.progress_info(self.progress_bars[0], progress_info): cancelled = True |
for widget in self.find_widgets([self.progress_bars[0], 'PROGRESS'], 'progress_step'): self.debug('filter', 'widget found for', self.progress_bars[0]) if not widget.progress_step(self.progress_bars[0], progress_inc): cancelled = True |
Clone # 40
Distance between two fragments = 3
Clone size = 8
| Source file "./ubiquity/debconffilter.py" The first line is 362 | Source file "./ubiquity/debconffilter.py" The first line is 342 | |
|
for widget in self.find_widgets([self.progress_bars[0], 'PROGRESS'], 'progress_info'): self.debug('filter', 'widget found for', self.progress_bars[0]) if not widget.progress_info(self.progress_bars[0], progress_info): cancelled = True |
for widget in self.find_widgets([self.progress_bars[0], 'PROGRESS'], 'progress_set'): self.debug('filter', 'widget found for', self.progress_bars[0]) if not widget.progress_set(self.progress_bars[0], progress_val): cancelled = True |
Clone # 41
Distance between two fragments = 2
Clone size = 8
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 433 | Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 412 | |
|
def on_delete_clicked(self): if not self.ctrlr.allowed_change_step(): return None devpart, partition = self.get_treeview_data() if (not devpart) or (not partition): return None self.ctrlr.allow_change_step(False) self.ctrlr.dbfilter.delete_partition(devpart) |
def on_new_table_clicked(self): if not self.ctrlr.allowed_change_step(): return None devpart, partition = self.get_treeview_data() if (not devpart) or (not partition): return None self.ctrlr.allow_change_step(False) self.ctrlr.dbfilter.create_label(devpart) |
Clone # 42
Distance between two fragments = 1
Clone size = 8
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 354 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 378 | |
| tbtext = ''.join(traceback.format_exception(exctype, excvalue, exctb)) | tbtext = ''.join(traceback.format_exception(exctype, excvalue, exctb)) | |
| syslog.syslog(syslog.LOG_ERR, 'Exception in KDE frontend (invoking crash handler):') | syslog.syslog(syslog.LOG_ERR, 'Exception in GTK frontend (invoking crash handler):') | |
|
for line in tbtext.split('\n'): syslog.syslog(syslog.LOG_ERR, line) |
for line in tbtext.split('\n'): syslog.syslog(syslog.LOG_ERR, line) |
|
| print >> sys.stderr, 'Exception in KDE frontend (invoking crash handler):' | print >> sys.stderr, 'Exception in GTK frontend (invoking crash handler):' | |
| print >> sys.stderr, tbtext | print >> sys.stderr, tbtext | |
| self.post_mortem(exctype, excvalue, exctb) | self.post_mortem(exctype, excvalue, exctb) |
Clone # 43
Distance between two fragments = 1
Clone size = 8
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 568 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 335 | |
| widgets = [] | widgets = [] | |
|
for p in pages: if (not_current) and (p == current_page): continue prefix = p.ui.get('plugin_prefix') for w in p.widgets: for c in self.all_children(w): widgets.append((c, prefix)) |
for p in pages: if (not_current) and (p == current_page): continue prefix = p.ui.get('plugin_prefix') for w in p.all_widgets: for c in self.all_children(w): widgets.append((c, prefix)) |
Clone # 44
Distance between two fragments = 4
Clone size = 8
| Source file "./ubiquity/gtkwidgets.py" The first line is 326 | Source file "./ubiquity/gtkwidgets.py" The first line is 312 | |
| align.add(self.extra) | align.add(self.logo) | |
| vbox.pack_start(align, expand=False) | vbox.pack_start(align, expand=False) | |
| self.size = gtk.Label() | self.ostitle = gtk.Label() | |
| self.size.set_ellipsize(pango.ELLIPSIZE_END) | self.ostitle.set_ellipsize(pango.ELLIPSIZE_END) | |
| align = gtk.Alignment(0.5, 0.5, 0.5, 0.5) | align = gtk.Alignment(0.5, 0.5, 0.5, 0.5) | |
| align.set_padding(5, 12, 0, 0) | align.set_padding(6, 0, 0, 0) | |
| align.add(self.size) | align.add(self.ostitle) | |
| vbox.pack_start(align, expand=False) | vbox.pack_start(align, expand=False) |
Clone # 45
Distance between two fragments = 4
Clone size = 8
| Source file "./scripts/plugininstall.py" The first line is 940 | Source file "./scripts/plugininstall.py" The first line is 240 | |
|
try: extra_pool = self.db.get('oem-config/repository') except debconf.DebconfError: extra_pool = '' |
try: hostname = self.db.get('netcfg/get_hostname') except debconf.DebconfError: hostname = '' |
|
|
try: extra_key = self.db.get('oem-config/key') except debconf.DebconfError: extra_key = '' |
try: domain = self.db.get('netcfg/get_domain') except debconf.DebconfError: domain = '' |
Clone # 46
Distance between two fragments = 3
Clone size = 7
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 251 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 348 | |
|
if partition_count == 0: self.part_auto_hidden_label.set_text('') elif partition_count == 1: hidden = self.controller.get_string('part_auto_hidden_label_one') self.part_auto_hidden_label.set_markup(hidden) else: hidden = self.controller.get_string('part_auto_hidden_label') self.part_auto_hidden_label.set_markup((hidden) % (partition_count)) |
if partition_count == 0: self.part_auto_hidden_label.set_text('') elif partition_count == 1: deleted = self.controller.get_string('part_auto_deleted_label_one') self.part_auto_hidden_label.set_markup(deleted) else: deleted = self.controller.get_string('part_auto_deleted_label') self.part_auto_hidden_label.set_markup((deleted) % (partition_count)) |
Clone # 47
Distance between two fragments = 3
Clone size = 7
| Source file "./scripts/plugininstall.py" The first line is 847 | Source file "./ubiquity/install_misc.py" The first line is 707 | |
|
if cache._depcache.broken_count > 0: syslog.syslog(('not processing removals, since there are broken packages: %s') % (', '.join(install_misc.broken_packages(cache)))) self.db.progress('STOP') self.nested_progress_end() return None |
if cache._depcache.broken_count > 0: syslog.syslog(('not installing additional packages, since there are broken packages: %s') % (', '.join(broken_packages(cache)))) self.db.progress('STOP') self.nested_progress_end() return None |
Clone # 48
Distance between two fragments = 2
Clone size = 7
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 963 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1235 | |
|
if not self.allowed_change_step: return None |
if not self.allowed_change_step: return None |
|
| self.allow_change_step(False) | self.allow_change_step(False) | |
| self.backup = True | self.backup = True | |
| self.stay_on_page = False | self.stay_on_page = False | |
| self.allow_go_forward(True) | self.allow_go_forward(True) | |
| step = self.step_name(self.get_current_page()) | step = self.step_name(self.steps.get_current_page()) |
Clone # 49
Distance between two fragments = 0
Clone size = 7
| Source file "./ubiquity/frontend/kde_components/PartAuto.py" The first line is 134 | Source file "./ubiquity/frontend/kde_components/PartAuto.py" The first line is 99 | |
| bar_frame = QFrame() | bar_frame = QFrame() | |
| bar_frame.setLayout(QVBoxLayout()) | bar_frame.setLayout(QVBoxLayout()) | |
| bar_frame.setVisible(False) | bar_frame.setVisible(False) | |
| bar_frame.layout().setSpacing(0) | bar_frame.layout().setSpacing(0) | |
| self.barsFrame.layout().addWidget(bar_frame) | self.barsFrame.layout().addWidget(bar_frame) | |
| self.bar_frames.append(bar_frame) | self.bar_frames.append(bar_frame) | |
| disks.append((text, bar_frame)) | disks.append((text, bar_frame)) |
Clone # 50
Distance between two fragments = 2
Clone size = 7
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 1042 | Source file "./ubiquity/frontend/kde_ui.py" The first line is 1024 | |
|
def watch_debconf_fd_helper_exception(self, source): debconf_condition = 0 debconf_condition |= filteredcommand.DEBCONF_IO_ERR callback = self.debconf_callbacks[source] if not callback(source, debconf_condition): if callback == self.debconf_callbacks[source]: self.watch_debconf_fd_helper_disconnect(source) |
def watch_debconf_fd_helper_read(self, source): debconf_condition = 0 debconf_condition |= filteredcommand.DEBCONF_IO_IN callback = self.debconf_callbacks[source] if not callback(source, debconf_condition): if callback == self.debconf_callbacks[source]: self.watch_debconf_fd_helper_disconnect(source) |
Clone # 51
Distance between two fragments = 2
Clone size = 7
| Source file "./ubiquity/filteredcommand.py" The first line is 389 | Source file "./ubiquity/filteredcommand.py" The first line is 375 | |
|
def cancel_handler(self): self.succeeded = False self.done = True self.exit_ui_loops() if self.dbfilter is None: self.frontend.debconffilter_done(self) self.cleanup() |
def ok_handler(self): self.succeeded = True self.done = True self.exit_ui_loops() if self.dbfilter is None: self.frontend.debconffilter_done(self) self.cleanup() |
Clone # 52
Distance between two fragments = 0
Clone size = 7
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 485 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 461 | |
| gvm_root = '/desktop/gnome/volume_manager' | gvm_root = '/desktop/gnome/volume_manager' | |
| gvm_automount_drives = ('%s/automount_drives') % (gvm_root) | gvm_automount_drives = ('%s/automount_drives') % (gvm_root) | |
| gvm_automount_media = ('%s/automount_media') % (gvm_root) | gvm_automount_media = ('%s/automount_media') % (gvm_root) | |
| volumes_visible = '/apps/nautilus/desktop/volumes_visible' | volumes_visible = '/apps/nautilus/desktop/volumes_visible' | |
| media_automount = '/apps/nautilus/preferences/media_automount' | media_automount = '/apps/nautilus/preferences/media_automount' | |
| media_automount_open = '/apps/nautilus/preferences/media_automount_open' | media_automount_open = '/apps/nautilus/preferences/media_automount_open' | |
| media_autorun_never = '/apps/nautilus/preferences/media_autorun_never' | media_autorun_never = '/apps/nautilus/preferences/media_autorun_never' |
Clone # 53
Distance between two fragments = 4
Clone size = 7
| Source file "./ubiquity/plugins/ubi-tasks.py" The first line is 22 | Source file "./ubiquity/plugins/ubi-network.py" The first line is 22 | |
| NAME = 'tasks' | NAME = 'network' | |
| AFTER = 'network' | AFTER = 'usersetup' | |
| WEIGHT = 12 | WEIGHT = 12 | |
|
class TasksUnfilteredOnly(Exception): pass |
class NetworkUnfilteredOnly(Exception): pass |
|
|
class PageDebconf(PluginUI): plugin_title = 'ubiquity/text/tasks_heading_label' |
class PageDebconf(PluginUI): plugin_title = 'ubiquity/text/network_heading_label' |
Clone # 54
Distance between two fragments = 1
Clone size = 8
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 350 | Source file "./ubiquity/install_misc.py" The first line is 426 | |
|
if (issubclass(exctype, KeyboardInterrupt)) or (issubclass(exctype, SystemExit)): return None |
if (issubclass(exctype, KeyboardInterrupt)) or (issubclass(exctype, SystemExit)): return None |
|
| tbtext = ''.join(traceback.format_exception(exctype, excvalue, exctb)) | tbtext = ''.join(traceback.format_exception(exctype, excvalue, exctb)) | |
| syslog.syslog(syslog.LOG_ERR, 'Exception in KDE frontend (invoking crash handler):') | syslog.syslog(syslog.LOG_ERR, 'Exception during installation:') | |
|
for line in tbtext.split('\n'): syslog.syslog(syslog.LOG_ERR, line) |
for line in tbtext.split('\n'): syslog.syslog(syslog.LOG_ERR, line) |
Clone # 55
Distance between two fragments = 4
Clone size = 7
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 221 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 122 | |
|
if len(self.treeview.get_columns()) < 1: column = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=0) column.set_sizing(gtk.TREE_VIEW_COLUMN_GROW_ONLY) self.treeview.append_column(column) selection = self.treeview.get_selection() selection.connect('changed', self.on_language_selection_changed) |
if len(self.keyboardlayoutview.get_columns()) < 1: column = gtk.TreeViewColumn('Layout', gtk.CellRendererText(), text=0) column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) self.keyboardlayoutview.append_column(column) selection = self.keyboardlayoutview.get_selection() selection.connect('changed', self.on_keyboard_layout_selected) |
Clone # 56
Distance between two fragments = 4
Clone size = 7
| Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 163 | Source file "./ubiquity/plugins/ubi-language.py" The first line is 221 | |
|
if len(self.keyboardvariantview.get_columns()) < 1: column = gtk.TreeViewColumn('Variant', gtk.CellRendererText(), text=0) column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) self.keyboardvariantview.append_column(column) selection = self.keyboardvariantview.get_selection() selection.connect('changed', self.on_keyboard_variant_selected) |
if len(self.treeview.get_columns()) < 1: column = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=0) column.set_sizing(gtk.TREE_VIEW_COLUMN_GROW_ONLY) self.treeview.append_column(column) selection = self.treeview.get_selection() selection.connect('changed', self.on_language_selection_changed) |
Clone # 57
Distance between two fragments = 3
Clone size = 7
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1299 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1291 | |
|
def debconf_progress_step(self, progress_inc): if self.progress_cancelled: return False self.progress_position.step(progress_inc) fraction = self.progress_position.fraction() self.install_progress.set_fraction(fraction) return True |
def debconf_progress_set(self, progress_val): if self.progress_cancelled: return False self.progress_position.set(progress_val) fraction = self.progress_position.fraction() self.install_progress.set_fraction(fraction) return True |
Clone # 58
Distance between two fragments = 1
Clone size = 7
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1957 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1949 | |
| devpart = self.editing_partition['devpart'] | devpart = self.creating_partition['devpart'] | |
|
if devpart in self.partition_cache: self.ui.show_page_advanced() self.maybe_update_grub() self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) |
if devpart in self.partition_cache: self.ui.show_page_advanced() self.maybe_update_grub() self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) |
Clone # 59
Distance between two fragments = 4
Clone size = 7
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 893 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 749 | |
| mount_model = self.partition_edit_mount_combo.get_model() | mount_model = self.partition_create_mount_combo.get_model() | |
|
if mount_model is not None: fs = model[iterator][0] mount_model.clear() for mp, choice_c, choice in self.controller.dbfilter.default_mountpoint_choices(fs): mount_model.append([mp, choice]) |
if mount_model is not None: fs = model[iterator][1] mount_model.clear() for mp, choice_c, choice in self.controller.dbfilter.default_mountpoint_choices(fs): mount_model.append([mp]) |
Clone # 60
Distance between two fragments = 4
Clone size = 7
| Source file "./scripts/plugininstall.py" The first line is 1124 | Source file "./scripts/install.py" The first line is 378 | |
| os.lchown(targetpath, uid, gid) | os.lchown(targetpath, st.st_uid, st.st_gid) | |
|
if not stat.S_ISLNK(st.st_mode): os.chmod(targetpath, mode) |
if not stat.S_ISLNK(st.st_mode): os.chmod(targetpath, mode) |
|
|
if stat.S_ISDIR(st.st_mode): directory_times.append((targetpath, st.st_atime, st.st_mtime)) elif not stat.S_ISLNK(st.st_mode): os.utime(targetpath, (st.st_atime, st.st_mtime)) |
if stat.S_ISDIR(st.st_mode): directory_times.append((targetpath, st.st_atime, st.st_mtime)) elif not stat.S_ISLNK(st.st_mode): os.utime(targetpath, (st.st_atime, st.st_mtime)) |
Clone # 61
Distance between two fragments = 4
Clone size = 7
| Source file "./ubiquity/plugins/ubi-usersetup.py" The first line is 633 | Source file "./ubiquity/plugins/ubi-usersetup.py" The first line is 626 | |
|
if self.ui.get_username() == '': try: username = self.db.get('passwd/username') if username != '': self.ui.set_username(username) except debconf.DebconfError: pass |
if self.ui.get_fullname() == '': try: fullname = self.db.get('passwd/user-fullname') if fullname != '': self.ui.set_fullname(fullname) except debconf.DebconfError: pass |
Clone # 62
Distance between two fragments = 1
Clone size = 7
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2277 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2058 | |
|
if 'bad_size' in self.editing_partition: return False |
if 'bad_size' in self.creating_partition: return False |
|
| size = self.editing_partition['size'] | size = self.creating_partition['size'] | |
|
if re.search('^[0-9.]+$', size): size += 'M' |
if re.search('^[0-9.]+$', size): size += 'M' |
|
| self.preseed(question, size, seen=False) | self.preseed(question, size, seen=False) | |
| return True | return True |
Clone # 63
Distance between two fragments = 0
Clone size = 7
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 1148 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1366 | |
|
if self.parallel_db is not None: self.parallel_db.shutdown() |
if self.parallel_db is not None: self.parallel_db.shutdown() |
|
| self.parallel_db = DebconfCommunicator('ubiquity', cloexec=True, env={'DEBCONF_DB_REPLACE': 'configdb', 'DEBCONF_DB_OVERRIDE': 'Pipe{infd:none outfd:none}'}) | self.parallel_db = DebconfCommunicator('ubiquity', cloexec=True, env={'DEBCONF_DB_REPLACE': 'configdb', 'DEBCONF_DB_OVERRIDE': 'Pipe{infd:none outfd:none}'}) | |
| dbfilter = partman_commit.PartmanCommit(self, db=self.parallel_db) | dbfilter = partman_commit.PartmanCommit(self, db=self.parallel_db) | |
| dbfilter.start(auto_process=True) | dbfilter.start(auto_process=True) |
Clone # 64
Distance between two fragments = 0
Clone size = 6
| Source file "./scripts/plugininstall.py" The first line is 1135 | Source file "./scripts/install.py" The first line is 411 | |
|
for dirtime in directory_times: directory, atime, mtime = dirtime try: os.utime(directory, (atime, mtime)) except OSError: pass |
for dirtime in directory_times: directory, atime, mtime = dirtime try: os.utime(directory, (atime, mtime)) except OSError: pass |
Clone # 65
Distance between two fragments = 3
Clone size = 6
| Source file "./ubiquity/frontend/base.py" The first line is 217 | Source file "./ubiquity/frontend/base.py" The first line is 50 | |
|
def refresh(self): pass |
def allowed_change_step(self): pass |
|
|
def run_main_loop(self): pass |
def go_forward(self): pass |
|
|
def quit_main_loop(self): pass |
def go_backward(self): pass |
Clone # 66
Distance between two fragments = 3
Clone size = 6
| Source file "./ubiquity/frontend/base.py" The first line is 52 | Source file "./ubiquity/frontend/base.py" The first line is 217 | |
|
def go_forward(self): pass |
def refresh(self): pass |
|
|
def go_backward(self): pass |
def run_main_loop(self): pass |
|
|
def toggle_top_level(self): pass |
def quit_main_loop(self): pass |
Clone # 67
Distance between two fragments = 3
Clone size = 6
| Source file "./ubiquity/frontend/base.py" The first line is 52 | Source file "./ubiquity/frontend/base.py" The first line is 50 | |
|
def go_forward(self): pass |
def allowed_change_step(self): pass |
|
|
def go_backward(self): pass |
def go_forward(self): pass |
|
|
def toggle_top_level(self): pass |
def go_backward(self): pass |
Clone # 68
Distance between two fragments = 2
Clone size = 6
| Source file "./ubiquity/segmented_bar.py" The first line is 430 | Source file "./ubiquity/segmented_bar.py" The first line is 420 | |
| cr.move_to(x, lh) | cr.move_to(x, 0) | |
| text_color.a = 0.75 | text_color.a = 0.90000000000000002 | |
| cr.set_source_rgba(text_color.r, text_color.g, text_color.b, text_color.a) | cr.set_source_rgba(text_color.r, text_color.g, text_color.b, text_color.a) | |
| pc = pangocairo.CairoContext(cr) | pc = pangocairo.CairoContext(cr) | |
| pc.show_layout(layout) | pc.show_layout(layout) | |
| cr.fill() | cr.fill() |
Clone # 69
Distance between two fragments = 1
Clone size = 6
| Source file "./ubiquity/gtkwidgets.py" The first line is 831 | Source file "./ubiquity/gtkwidgets.py" The first line is 821 | |
| window.draw_pixbuf(None, self._installed, 0, 0, dest_x, dest_y, -1, -1, 0, 0, 0) | window.draw_pixbuf(None, self.pixbuf, 0, 0, dest_x, dest_y, -1, -1, 0, 0, 0) |
Clone # 70
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/install_misc.py" The first line is 120 | Source file "./ubiquity/install_misc.py" The first line is 110 | |
| f = open(start_stop_daemon, 'w') | f = open(policy_rc_d, 'w') | |
| print >> f, "#!/bin/sh\necho 1>&2\necho 'Warning: Fake start-stop-daemon called, doing nothing.' 1>&2\nexit 0" | print >> f, '#!/bin/sh\nexit 101' | |
| f.close() | f.close() | |
| os.chmod(start_stop_daemon, 493) | os.chmod(policy_rc_d, 493) | |
| initctl = os.path.join(target, 'sbin/initctl') | start_stop_daemon = os.path.join(target, 'sbin/start-stop-daemon') |
Clone # 71
Distance between two fragments = 2
Clone size = 6
| Source file "./scripts/plugininstall.py" The first line is 205 | Source file "./scripts/plugininstall.py" The first line is 198 | |
|
try: self.copy_wallpaper_cache() except: syslog.syslog(syslog.LOG_WARNING, 'Could not copy wallpaper cache:') for line in traceback.format_exc().split('\n'): syslog.syslog(syslog.LOG_WARNING, line) |
try: self.recache_apparmor() except: syslog.syslog(syslog.LOG_WARNING, 'Could not create an Apparmor cache:') for line in traceback.format_exc().split('\n'): syslog.syslog(syslog.LOG_WARNING, line) |
Clone # 72
Distance between two fragments = 0
Clone size = 6
| Source file "./scripts/plugininstall.py" The first line is 1191 | Source file "./scripts/plugininstall.py" The first line is 103 | |
| use_restricted = True | use_restricted = True | |
|
try: if self.db.get('apt-setup/restricted') == 'false': use_restricted = False except debconf.DebconfError: pass |
try: if self.db.get('apt-setup/restricted') == 'false': use_restricted = False except debconf.DebconfError: pass |
Clone # 73
Distance between two fragments = 0
Clone size = 6
| Source file "./scripts/plugininstall.py" The first line is 1191 | Source file "./scripts/install.py" The first line is 203 | |
| use_restricted = True | use_restricted = True | |
|
try: if self.db.get('apt-setup/restricted') == 'false': use_restricted = False except debconf.DebconfError: pass |
try: if self.db.get('apt-setup/restricted') == 'false': use_restricted = False except debconf.DebconfError: pass |
Clone # 74
Distance between two fragments = 0
Clone size = 6
| Source file "./scripts/plugininstall.py" The first line is 103 | Source file "./scripts/install.py" The first line is 203 | |
| use_restricted = True | use_restricted = True | |
|
try: if self.db.get('apt-setup/restricted') == 'false': use_restricted = False except debconf.DebconfError: pass |
try: if self.db.get('apt-setup/restricted') == 'false': use_restricted = False except debconf.DebconfError: pass |
Clone # 75
Distance between two fragments = 0
Clone size = 6
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 710 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 954 | |
|
if (not self.dbfilter_status) or (self.current_page is None): return True |
if (not self.dbfilter_status) or (self.current_page is None): return True |
|
| syslog.syslog(('dbfilter_handle_status: %s') % (str(self.dbfilter_status))) | syslog.syslog(('dbfilter_handle_status: %s') % (str(self.dbfilter_status))) | |
| text = ('%s failed with exit code %s. Further information may be found in /var/log/syslog. Do you want to try running this step again before continuing? If you do not, your installation may fail entirely or may be broken.') % ((self.dbfilter_status[0], self.dbfilter_status[1])) | text = ('%s failed with exit code %s. Further information may be found in /var/log/syslog. Do you want to try running this step again before continuing? If you do not, your installation may fail entirely or may be broken.') % ((self.dbfilter_status[0], self.dbfilter_status[1])) |
Clone # 76
Distance between two fragments = 0
Clone size = 6
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 478 | Source file "./ubiquity/plugins/ubi-language.py" The first line is 150 | |
| self.timeout_id = None | self.timeout_id = None | |
| self.wget_retcode = None | self.wget_retcode = None | |
| self.wget_proc = None | self.wget_proc = None | |
| self.wget_retcode_release_notes = None | self.wget_retcode_release_notes = None | |
| self.wget_proc_release_notes = None | self.wget_proc_release_notes = None | |
| self.network_change() | self.network_change() |
Clone # 77
Distance between two fragments = 1
Clone size = 6
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 271 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 212 | |
| self.current_page = None | self.current_page = None | |
| self.first_seen_page = None | self.backup = None | |
| self.allowed_change_step = True | self.allowed_change_step = True | |
| self.allowed_go_backward = True | self.allowed_go_backward = True | |
| self.allowed_go_forward = True | self.allowed_go_forward = True | |
| self.stay_on_page = False | self.stay_on_page = False |
Clone # 78
Distance between two fragments = 0
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1262 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1981 | |
| self.creating_label = None | self.creating_label = None | |
| self.creating_partition = None | self.creating_partition = None | |
| self.editing_partition = None | self.editing_partition = None | |
| self.deleting_partition = None | self.deleting_partition = None | |
| self.undoing = False | self.undoing = False | |
| self.finish_partitioning = False | self.finish_partitioning = False |
Clone # 79
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 234 | Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 132 | |
|
if not self.ctrlr.allowed_change_step(): return None |
if not self.ctrlr.allowed_change_step(): return None |
|
|
if not self.edit_dialog: self.edit_dialog = QDialog(self) uic.loadUi(('%s/partition_edit_dialog.ui') % (_uidir), self.edit_dialog) self.edit_dialog.partition_edit_use_combo.currentIndexChanged[int].connect(self.on_partition_edit_use_combo_changed) |
if not self.create_dialog: self.create_dialog = QDialog(self) uic.loadUi(('%s/partition_create_dialog.ui') % (_uidir), self.create_dialog) self.create_dialog.partition_create_use_combo.currentIndexChanged[int].connect(self.on_partition_create_use_combo_changed) |
Clone # 80
Distance between two fragments = 2
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 993 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 596 | |
| model, iterator = self.partition_list_treeview.get_selection().get_selected() | model, iterator = widget.get_selection().get_selected() | |
|
if iterator is None: devpart = None partition = None else: devpart = model[iterator][0] partition = model[iterator][1] |
if iterator is None: devpart = None partition = None else: devpart = model[iterator][0] partition = model[iterator][1] |
Clone # 81
Distance between two fragments = 1
Clone size = 6
| Source file "./ubiquity/debconffilter.py" The first line is 197 | Source file "./ubiquity/filteredcommand.py" The first line is 216 | |
| os.environ['HOME'] = '/root' | os.environ['HOME'] = '/root' | |
| os.environ['LC_COLLATE'] = 'C' | os.environ['LC_COLLATE'] = 'C' | |
|
for key, value in extra_env.iteritems(): os.environ[key] = value |
for key, value in env.iteritems(): os.environ[key] = value |
|
| signal.signal(signal.SIGPIPE, signal.SIG_DFL) | signal.signal(signal.SIGPIPE, signal.SIG_DFL) | |
| misc.regain_privileges() | misc.regain_privileges() |
Clone # 82
Distance between two fragments = 3
Clone size = 6
| Source file "./ubiquity/plugins/ubi-prepare.py" The first line is 212 | Source file "./ubiquity/plugins/ubi-prepare.py" The first line is 205 | |
|
try: self.prepare_network_connection = StateBox(self.page) self.page.vbox1.addWidget(self.prepare_network_connection) self.setup_network_watch() except Exception, e: print 'unable to set up network connection watch:', e |
try: self.prepare_power_source = StateBox(self.page) self.page.vbox1.addWidget(self.prepare_power_source) self.setup_power_watch() except Exception, e: print 'unable to set up power source watch:', e |
Clone # 83
Distance between two fragments = 2
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 831 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 797 | |
| iterator = list_store.get_iter_first() | iterator = list_store.get_iter_first() | |
|
while iterator: if list_store[iterator][0] == current_mountpoint: self.partition_edit_mount_combo.set_active_iter(iterator) break iterator = list_store.iter_next(iterator) |
while iterator: if list_store[iterator][0] == current_method: self.partition_edit_use_combo.set_active_iter(iterator) break iterator = list_store.iter_next(iterator) |
Clone # 84
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1053 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1046 | |
| cell_type = gtk.CellRendererText() | cell_name = gtk.CellRendererText() | |
| column_type = gtk.TreeViewColumn(self.controller.get_string('partition_column_type'), cell_type) | column_name = gtk.TreeViewColumn(self.controller.get_string('partition_column_device'), cell_name) | |
| column_type.set_cell_data_func(cell_type, self.partman_column_type) | column_name.set_cell_data_func(cell_name, self.partman_column_name) | |
| column_type.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_name.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_type) | self.partition_list_treeview.append_column(column_name) |
Clone # 85
Distance between two fragments = 4
Clone size = 8
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1060 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1053 | |
| cell_mountpoint = gtk.CellRendererText() | cell_type = gtk.CellRendererText() | |
| column_mountpoint = gtk.TreeViewColumn(self.controller.get_string('partition_column_mountpoint'), cell_mountpoint) | column_type = gtk.TreeViewColumn(self.controller.get_string('partition_column_type'), cell_type) | |
| column_mountpoint.set_cell_data_func(cell_mountpoint, self.partman_column_mountpoint) | column_type.set_cell_data_func(cell_type, self.partman_column_type) | |
| column_mountpoint.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_type.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_mountpoint) | self.partition_list_treeview.append_column(column_type) |
Clone # 86
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1079 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1046 | |
| cell_size = gtk.CellRendererText() | cell_name = gtk.CellRendererText() | |
| column_size = gtk.TreeViewColumn(self.controller.get_string('partition_column_size'), cell_size) | column_name = gtk.TreeViewColumn(self.controller.get_string('partition_column_device'), cell_name) | |
| column_size.set_cell_data_func(cell_size, self.partman_column_size) | column_name.set_cell_data_func(cell_name, self.partman_column_name) | |
| column_size.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_name.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_size) | self.partition_list_treeview.append_column(column_name) |
Clone # 87
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1086 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1053 | |
| cell_used = gtk.CellRendererText() | cell_type = gtk.CellRendererText() | |
| column_used = gtk.TreeViewColumn(self.controller.get_string('partition_column_used'), cell_used) | column_type = gtk.TreeViewColumn(self.controller.get_string('partition_column_type'), cell_type) | |
| column_used.set_cell_data_func(cell_used, self.partman_column_used) | column_type.set_cell_data_func(cell_type, self.partman_column_type) | |
| column_used.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_type.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_used) | self.partition_list_treeview.append_column(column_type) |
Clone # 88
Distance between two fragments = 4
Clone size = 8
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1060 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1046 | |
| cell_mountpoint = gtk.CellRendererText() | cell_name = gtk.CellRendererText() | |
| column_mountpoint = gtk.TreeViewColumn(self.controller.get_string('partition_column_mountpoint'), cell_mountpoint) | column_name = gtk.TreeViewColumn(self.controller.get_string('partition_column_device'), cell_name) | |
| column_mountpoint.set_cell_data_func(cell_mountpoint, self.partman_column_mountpoint) | column_name.set_cell_data_func(cell_name, self.partman_column_name) | |
| column_mountpoint.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_name.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_mountpoint) | self.partition_list_treeview.append_column(column_name) |
Clone # 89
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1086 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1046 | |
| cell_used = gtk.CellRendererText() | cell_name = gtk.CellRendererText() | |
| column_used = gtk.TreeViewColumn(self.controller.get_string('partition_column_used'), cell_used) | column_name = gtk.TreeViewColumn(self.controller.get_string('partition_column_device'), cell_name) | |
| column_used.set_cell_data_func(cell_used, self.partman_column_used) | column_name.set_cell_data_func(cell_name, self.partman_column_name) | |
| column_used.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_name.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_used) | self.partition_list_treeview.append_column(column_name) |
Clone # 90
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-prepare.py" The first line is 124 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 41 | |
| builder = gtk.Builder() | builder = gtk.Builder() | |
| self.controller.add_builder(builder) | self.controller.add_builder(builder) | |
| builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepPrepare.ui')) | builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepKeyboardConf.ui')) | |
| builder.connect_signals(self) | builder.connect_signals(self) | |
| self.page = builder.get_object('stepPrepare') | self.page = builder.get_object('stepKeyboardConf') | |
| self.prepare_download_updates = builder.get_object('prepare_download_updates') | self.keyboardlayoutview = builder.get_object('keyboardlayoutview') |
Clone # 91
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-prepare.py" The first line is 124 | Source file "./ubiquity/plugins/ubi-timezone.py" The first line is 46 | |
| builder = gtk.Builder() | builder = gtk.Builder() | |
| self.controller.add_builder(builder) | self.controller.add_builder(builder) | |
| builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepPrepare.ui')) | builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepLocation.ui')) | |
| builder.connect_signals(self) | builder.connect_signals(self) | |
| self.page = builder.get_object('stepPrepare') | self.page = builder.get_object('stepLocation') | |
| self.prepare_download_updates = builder.get_object('prepare_download_updates') | self.city_entry = builder.get_object('timezone_city_entry') |
Clone # 92
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 41 | Source file "./ubiquity/plugins/ubi-timezone.py" The first line is 46 | |
| builder = gtk.Builder() | builder = gtk.Builder() | |
| self.controller.add_builder(builder) | self.controller.add_builder(builder) | |
| builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepKeyboardConf.ui')) | builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepLocation.ui')) | |
| builder.connect_signals(self) | builder.connect_signals(self) | |
| self.page = builder.get_object('stepKeyboardConf') | self.page = builder.get_object('stepLocation') | |
| self.keyboardlayoutview = builder.get_object('keyboardlayoutview') | self.city_entry = builder.get_object('timezone_city_entry') |
Clone # 93
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-migrationassistant.py" The first line is 55 | Source file "./ubiquity/plugins/ubi-prepare.py" The first line is 124 | |
| builder = gtk.Builder() | builder = gtk.Builder() | |
| self.controller.add_builder(builder) | self.controller.add_builder(builder) | |
| builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepMigrationAssistant.ui')) | builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepPrepare.ui')) | |
| builder.connect_signals(self) | builder.connect_signals(self) | |
| self.page = builder.get_object('stepMigrationAssistant') | self.page = builder.get_object('stepPrepare') | |
| self.matreeview = builder.get_object('matreeview') | self.prepare_download_updates = builder.get_object('prepare_download_updates') |
Clone # 94
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-migrationassistant.py" The first line is 55 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 41 | |
| builder = gtk.Builder() | builder = gtk.Builder() | |
| self.controller.add_builder(builder) | self.controller.add_builder(builder) | |
| builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepMigrationAssistant.ui')) | builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepKeyboardConf.ui')) | |
| builder.connect_signals(self) | builder.connect_signals(self) | |
| self.page = builder.get_object('stepMigrationAssistant') | self.page = builder.get_object('stepKeyboardConf') | |
| self.matreeview = builder.get_object('matreeview') | self.keyboardlayoutview = builder.get_object('keyboardlayoutview') |
Clone # 95
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-migrationassistant.py" The first line is 55 | Source file "./ubiquity/plugins/ubi-timezone.py" The first line is 46 | |
| builder = gtk.Builder() | builder = gtk.Builder() | |
| self.controller.add_builder(builder) | self.controller.add_builder(builder) | |
| builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepMigrationAssistant.ui')) | builder.add_from_file(os.path.join(os.environ['UBIQUITY_GLADE'], 'stepLocation.ui')) | |
| builder.connect_signals(self) | builder.connect_signals(self) | |
| self.page = builder.get_object('stepMigrationAssistant') | self.page = builder.get_object('stepLocation') | |
| self.matreeview = builder.get_object('matreeview') | self.city_entry = builder.get_object('timezone_city_entry') |
Clone # 96
Distance between two fragments = 3
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 361 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 232 | |
| i = self.part_auto_select_drive.get_active_iter() | i = self.part_auto_select_drive.get_active_iter() | |
|
if not i: return None |
if not i: return None |
|
| m = self.part_auto_select_drive.get_model() | m = self.part_auto_select_drive.get_model() | |
| val = m.get_value(i, 0) | val = m.get_value(i, 0) | |
| size = self.extra_options[self.use_device_choice][val][1] | partman_id = self.extra_options[self.use_device_choice][val][0] |
Clone # 97
Distance between two fragments = 3
Clone size = 6
| Source file "./scripts/plugininstall.py" The first line is 561 | Source file "./ubiquity/install_misc.py" The first line is 208 | |
| remove_kernels = set() | apt_installed = set() | |
|
if os.path.exists('/var/lib/ubiquity/remove-kernels'): remove_kernels_file = open('/var/lib/ubiquity/remove-kernels') for line in remove_kernels_file: remove_kernels.add(line.strip()) remove_kernels_file.close() |
if os.path.exists('/var/lib/ubiquity/apt-installed'): record_file = open('/var/lib/ubiquity/apt-installed') for line in record_file: apt_installed.add(line.strip()) record_file.close() |
Clone # 98
Distance between two fragments = 2
Clone size = 6
| Source file "./scripts/plugininstall.py" The first line is 1163 | Source file "./scripts/plugininstall.py" The first line is 1157 | |
| live_packages = set() | desktop_packages = set() | |
| manifest_file = open(manifest) | manifest_file = open(manifest_desktop) | |
|
for line in manifest_file: if (line.strip() != '') and (not line.startswith('#')): live_packages.add(line.split()[0]) |
for line in manifest_file: if (line.strip() != '') and (not line.startswith('#')): desktop_packages.add(line.split()[0]) |
|
| manifest_file.close() | manifest_file.close() |
Clone # 99
Distance between two fragments = 2
Clone size = 6
| Source file "./scripts/install.py" The first line is 191 | Source file "./scripts/install.py" The first line is 185 | |
| live_packages = set() | desktop_packages = set() | |
| manifest_file = open(manifest) | manifest_file = open(manifest_desktop) | |
|
for line in manifest_file: if (line.strip() != '') and (not line.startswith('#')): live_packages.add(line.split()[0]) |
for line in manifest_file: if (line.strip() != '') and (not line.startswith('#')): desktop_packages.add(line.split()[0]) |
|
| manifest_file.close() | manifest_file.close() |
Clone # 100
Distance between two fragments = 0
Clone size = 6
| Source file "./ubiquity/plugins/ubi-timezone.py" The first line is 465 | Source file "./ubiquity/plugins/ubi-timezone.py" The first line is 407 | |
| shortcopy = shortlist[:] | shortcopy = shortlist[:] | |
|
for short_item in shortcopy: for long_item in longlist: if short_item[1] == long_item[1]: shortlist.remove(short_item) break |
for short_item in shortcopy: for long_item in longlist: if short_item[1] == long_item[1]: shortlist.remove(short_item) break |
Clone # 101
Distance between two fragments = 2
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1019 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1003 | |
|
def on_partition_list_delete_activate(self, unused_widget): if not self.controller.allowed_change_step(): return None self.controller.allow_change_step(False) devpart, partition = self.partition_list_get_selection() self.controller.dbfilter.delete_partition(devpart) |
def on_partition_list_new_label_activate(self, unused_widget): if not self.controller.allowed_change_step(): return None self.controller.allow_change_step(False) devpart, partition = self.partition_list_get_selection() self.controller.dbfilter.create_label(devpart) |
Clone # 102
Distance between two fragments = 3
Clone size = 6
| Source file "./ubiquity/plugins/ubi-tasks.py" The first line is 33 | Source file "./ubiquity/plugins/ubi-network.py" The first line is 33 | |
|
class Page(Plugin): def prepare(self, unfiltered=False): if not unfiltered: raise TasksUnfilteredOnly, 'tasks component only usable with debconf frontend' return ['tasksel'] |
class Page(Plugin): def prepare(self, unfiltered=False): if not unfiltered: raise NetworkUnfilteredOnly, 'network component only usable with debconf frontend' return ['/usr/lib/ubiquity/netcfg-wrapper'] |
Clone # 103
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-usersetup.py" The first line is 552 | Source file "./ubiquity/plugins/ubi-usersetup.py" The first line is 542 | |
|
def set_username(self, value): self.username = value |
def set_fullname(self, value): self.fullname = value |
|
|
def get_username(self): if self.controller.oem_config: return 'oem' return self.username |
def get_fullname(self): if self.controller.oem_config: return 'OEM Configuration (temporary user)' return self.fullname |
Clone # 104
Distance between two fragments = 2
Clone size = 6
| Source file "./ubiquity/plugins/ubi-prepare.py" The first line is 246 | Source file "./ubiquity/plugins/ubi-prepare.py" The first line is 166 | |
|
def set_use_nonfree(self, val): if osextras.find_on_path('jockey-text'): self.prepare_nonfree_software.setChecked(val) else: self.debug('Could not find jockey-text on the executable path.') self.prepare_nonfree_software.setChecked(False) self.prepare_nonfree_software.setEnabled(False) |
def set_use_nonfree(self, val): if osextras.find_on_path('jockey-text'): self.prepare_nonfree_software.set_active(val) else: self.debug('Could not find jockey-text on the executable path.') self.prepare_nonfree_software.set_active(False) self.prepare_nonfree_software.set_sensitive(False) |
Clone # 105
Distance between two fragments = 0
Clone size = 6
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 427 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 555 | |
| old_dbfilter = self.dbfilter | old_dbfilter = self.dbfilter | |
|
if issubclass(self.pages[self.pagesindex].filter_class, Plugin): ui = self.pages[self.pagesindex].ui else: ui = None |
if issubclass(self.pages[self.pagesindex].filter_class, Plugin): ui = self.pages[self.pagesindex].ui else: ui = None |
|
| self.start_debconf() | self.start_debconf() | |
| self.dbfilter = self.pages[self.pagesindex].filter_class(self, ui=ui) | self.dbfilter = self.pages[self.pagesindex].filter_class(self, ui=ui) |
Clone # 106
Distance between two fragments = 4
Clone size = 7
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2080 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2070 | |
|
if self.creating_partition: if self.creating_partition['place'] == PARTITION_PLACE_BEGINNING: self.preseed(question, 'Beginning', seen=False) else: self.preseed(question, 'End', seen=False) return True else: raise AssertionError, ('Arrived at %s unexpectedly') % (question) |
if self.creating_partition: if self.creating_partition['type'] == PARTITION_TYPE_PRIMARY: self.preseed(question, 'Primary', seen=False) else: self.preseed(question, 'Logical', seen=False) return True else: raise AssertionError, ('Arrived at %s unexpectedly') % (question) |
Clone # 107
Distance between two fragments = 0
Clone size = 7
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 513 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 632 | |
| slides = ('file://') + (slideshow_main) | slides = ('file://') + (slideshow_main) | |
|
if slideshow_locale != 'c': slides += ('#?locale=') + (slideshow_locale) ltr = i18n.get_string('default-ltr', slideshow_locale, 'ubiquity/imported') if ltr == 'default:RTL': slides += '?rtl' |
if slideshow_locale != 'c': slides += ('#?locale=') + (slideshow_locale) ltr = i18n.get_string('default-ltr', slideshow_locale, 'ubiquity/imported') if ltr == 'default:RTL': slides += '?rtl' |
Clone # 108
Distance between two fragments = 2
Clone size = 6
| Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 185 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 148 | |
|
def get_keyboard_variant(self): selection = self.keyboardvariantview.get_selection() model, iterator = selection.get_selected() if iterator is None: return None else: return unicode(model.get_value(iterator, 0)) |
def get_keyboard(self): selection = self.keyboardlayoutview.get_selection() model, iterator = selection.get_selected() if iterator is None: return None else: return unicode(model.get_value(iterator, 0)) |
Clone # 109
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/misc.py" The first line is 124 | Source file "./ubiquity/misc.py" The first line is 121 | |
| fp = open(p.device_entry('device')) | fp = open(p.device_entry('model')) | |
| dev = fp.readline() | mod = fp.readline() | |
| fp.close() | fp.close() | |
| fp = open(p.device_entry('size')) | fp = open(p.device_entry('device')) | |
| size = fp.readline() | dev = fp.readline() | |
| fp.close() | fp.close() |
Clone # 110
Distance between two fragments = 1
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2012 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2004 | |
| devpart = self.editing_partition['devpart'] | devpart = self.creating_partition['devpart'] | |
|
if devpart in self.partition_cache: partition = self.partition_cache[devpart] self.__state.append([question, devpart, None]) self.preseed(question, partition['display'], seen=False) |
if devpart in self.partition_cache: partition = self.partition_cache[devpart] self.__state.append([question, devpart, None]) self.preseed(question, partition['display'], seen=False) |
|
| return True | return True |
Clone # 111
Distance between two fragments = 2
Clone size = 6
| Source file "./ubiquity/misc.py" The first line is 279 | Source file "./ubiquity/misc.py" The first line is 108 | |
| subp = subprocess.Popen(['os-prober'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | subp = subprocess.Popen(['os-prober'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
| result = subp.communicate()[0].splitlines() | result = subp.communicate()[0].splitlines() | |
|
for res in result: res = res.split(':') find_in_os_prober.oslist[res[0]] = res[1] |
for res in result: res = res.split(':') oslist[res[0]] = res[1] |
Clone # 112
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1079 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1053 | |
| cell_size = gtk.CellRendererText() | cell_type = gtk.CellRendererText() | |
| column_size = gtk.TreeViewColumn(self.controller.get_string('partition_column_size'), cell_size) | column_type = gtk.TreeViewColumn(self.controller.get_string('partition_column_type'), cell_type) | |
| column_size.set_cell_data_func(cell_size, self.partman_column_size) | column_type.set_cell_data_func(cell_type, self.partman_column_type) | |
| column_size.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_type.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_size) | self.partition_list_treeview.append_column(column_type) |
Clone # 113
Distance between two fragments = 4
Clone size = 8
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1086 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1060 | |
| cell_used = gtk.CellRendererText() | cell_mountpoint = gtk.CellRendererText() | |
| column_used = gtk.TreeViewColumn(self.controller.get_string('partition_column_used'), cell_used) | column_mountpoint = gtk.TreeViewColumn(self.controller.get_string('partition_column_mountpoint'), cell_mountpoint) | |
| column_used.set_cell_data_func(cell_used, self.partman_column_used) | column_mountpoint.set_cell_data_func(cell_mountpoint, self.partman_column_mountpoint) | |
| column_used.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_mountpoint.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_used) | self.partition_list_treeview.append_column(column_mountpoint) |
Clone # 114
Distance between two fragments = 4
Clone size = 8
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1060 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1079 | |
| cell_mountpoint = gtk.CellRendererText() | cell_size = gtk.CellRendererText() | |
| column_mountpoint = gtk.TreeViewColumn(self.controller.get_string('partition_column_mountpoint'), cell_mountpoint) | column_size = gtk.TreeViewColumn(self.controller.get_string('partition_column_size'), cell_size) | |
| column_mountpoint.set_cell_data_func(cell_mountpoint, self.partman_column_mountpoint) | column_size.set_cell_data_func(cell_size, self.partman_column_size) | |
| column_mountpoint.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_size.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_mountpoint) | self.partition_list_treeview.append_column(column_size) |
Clone # 115
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1086 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1079 | |
| cell_used = gtk.CellRendererText() | cell_size = gtk.CellRendererText() | |
| column_used = gtk.TreeViewColumn(self.controller.get_string('partition_column_used'), cell_used) | column_size = gtk.TreeViewColumn(self.controller.get_string('partition_column_size'), cell_size) | |
| column_used.set_cell_data_func(cell_used, self.partman_column_used) | column_size.set_cell_data_func(cell_size, self.partman_column_size) | |
| column_used.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_size.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | |
| self.partition_list_treeview.append_column(column_used) | self.partition_list_treeview.append_column(column_size) |
Clone # 116
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/debconffilter.py" The first line is 296 | Source file "./ubiquity/debconffilter.py" The first line is 281 | |
|
if not widget.error(priority, question): self.debug('filter', 'widget requested backup') self.next_go_backup = True else: self.next_go_backup = False |
if not input_widgets[0].run(priority, question): self.debug('filter', 'widget requested backup') self.next_go_backup = True else: self.next_go_backup = False |
|
| self.reply(0, 'question will be asked', log=True) | self.reply(0, 'question will be asked', log=True) | |
| return True | return True |
Clone # 117
Distance between two fragments = 1
Clone size = 6
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 598 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 824 | |
| core_names = [('ubiquity/text/%s') % (q) for q in self.language_questions ] | core_names = [('ubiquity/text/%s') % (q) for q in self.language_questions ] | |
| core_names.append('ubiquity/text/oem_config_title') | core_names.append('ubiquity/text/oem_config_title') | |
| core_names.append('ubiquity/text/oem_user_config_title') | core_names.append('ubiquity/text/oem_user_config_title') | |
| core_names.append('ubiquity/text/breadcrumb_install') | core_names.append('ubiquity/imported/default-ltr') | |
| core_names.append('ubiquity/text/release_notes_only') | core_names.append('ubiquity/text/release_notes_only') | |
| core_names.append('ubiquity/text/update_installer_only') | core_names.append('ubiquity/text/update_installer_only') |
Clone # 118
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/validation.py" The first line is 99 | Source file "./ubiquity/validation.py" The first line is 97 | |
|
if digit > 3: digit = 3 |
if length > 5: length = 5 |
|
|
if upper > 3: upper = 3 |
if digit > 3: digit = 3 |
|
|
if symbol > 3: symbol = 3 |
if upper > 3: upper = 3 |
Clone # 119
Distance between two fragments = 0
Clone size = 6
| Source file "./scripts/plugininstall.py" The first line is 869 | Source file "./ubiquity/install_misc.py" The first line is 739 | |
|
if not cache.commit(fetchprogress, installprogress): fetchprogress.stop() installprogress.finishUpdate() self.db.progress('STOP') self.nested_progress_end() return None |
if not cache.commit(fetchprogress, installprogress): fetchprogress.stop() installprogress.finishUpdate() self.db.progress('STOP') self.nested_progress_end() return None |
Clone # 120
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 501 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 495 | |
|
if self.gconf_previous[gconf_key] == '': gconftool.unset(gconf_key) elif self.gconf_previous[gconf_key] != 'true': gconftool.set(gconf_key, 'bool', self.gconf_previous[gconf_key]) |
if self.gconf_previous[gconf_key] == '': gconftool.unset(gconf_key) elif self.gconf_previous[gconf_key] != 'false': gconftool.set(gconf_key, 'bool', self.gconf_previous[gconf_key]) |
Clone # 121
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 501 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 452 | |
|
if self.gconf_previous[gconf_key] == '': gconftool.unset(gconf_key) elif self.gconf_previous[gconf_key] != 'true': gconftool.set(gconf_key, 'bool', self.gconf_previous[gconf_key]) |
if self.gconf_previous[logout_key] == '': gconftool.unset(logout_key) elif self.gconf_previous[logout_key] != 'true': gconftool.set(logout_key, 'bool', self.gconf_previous[logout_key]) |
Clone # 122
Distance between two fragments = 2
Clone size = 5
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 495 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 452 | |
|
if self.gconf_previous[gconf_key] == '': gconftool.unset(gconf_key) elif self.gconf_previous[gconf_key] != 'false': gconftool.set(gconf_key, 'bool', self.gconf_previous[gconf_key]) |
if self.gconf_previous[logout_key] == '': gconftool.unset(logout_key) elif self.gconf_previous[logout_key] != 'true': gconftool.set(logout_key, 'bool', self.gconf_previous[logout_key]) |
Clone # 123
Distance between two fragments = 2
Clone size = 5
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 159 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 152 | |
|
def toggle_progress_section(self): if self._wizard.progress_section.get_property('visible'): self._wizard.progress_section.hide() else: self._wizard.progress_section.show() self._wizard.refresh() |
def toggle_top_level(self): if self._wizard.live_installer.get_property('visible'): self._wizard.live_installer.hide() else: self._wizard.live_installer.show() self._wizard.refresh() |
Clone # 124
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2196 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2106 | |
|
try: partition['active_partition_edit'] except KeyError: pass |
try: partition['active_partition_build'] except KeyError: pass |
|
| self.__state.pop() | self.__state.pop() |
Clone # 125
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 502 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 495 | |
|
if variant == 'yz': real_variant = ('latinyz,%s') % (variant) elif variant == 'alternatequotes': real_variant = ('latinalternatequotes,%s') % (variant) else: real_variant = ('latin,%s') % (variant) |
if variant == 'cyrillicyz': real_variant = ('latinyz,%s') % (variant) elif variant == 'cyrillicalternatequotes': real_variant = ('latinalternatequotes,%s') % (variant) else: real_variant = ('basic,%s') % (variant) |
Clone # 126
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugin_manager.py" The first line is 57 | Source file "./ubiquity/plugin_manager.py" The first line is 50 | |
|
def get_mod_int(mod, name): if hasattr(mod, name): mod_int = getattr(mod, name) return mod_int else: return 0 |
def get_mod_string(mod, name): if hasattr(mod, name): mod_string = getattr(mod, name) return mod_string else: return '' |
Clone # 127
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugin_manager.py" The first line is 64 | Source file "./ubiquity/plugin_manager.py" The first line is 57 | |
|
def get_mod_bool(mod, name): if hasattr(mod, name): mod_bool = getattr(mod, name) return mod_bool else: return True |
def get_mod_int(mod, name): if hasattr(mod, name): mod_int = getattr(mod, name) return mod_int else: return 0 |
Clone # 128
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugin_manager.py" The first line is 64 | Source file "./ubiquity/plugin_manager.py" The first line is 50 | |
|
def get_mod_bool(mod, name): if hasattr(mod, name): mod_bool = getattr(mod, name) return mod_bool else: return True |
def get_mod_string(mod, name): if hasattr(mod, name): mod_string = getattr(mod, name) return mod_string else: return '' |
Clone # 129
Distance between two fragments = 2
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2448 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2416 | |
|
def delete_partition(self, devpart): assert self.current_question == 'partman/choose_partition' self.deleting_partition = {'devpart': devpart} self.exit_ui_loops() |
def create_label(self, devpart): assert self.current_question == 'partman/choose_partition' self.creating_label = {'devpart': devpart} self.exit_ui_loops() |
Clone # 130
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 1230 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1489 | |
|
if use_templates: text = self.get_string(option) else: text = option |
if use_templates: text = self.get_string(option) else: text = option |
|
|
if text is None: text = option |
if text is None: text = option |
Clone # 131
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/frontend/kde_components/testing/partauto.py" The first line is 14 | Source file "./ubiquity/frontend/kde_components/testing/partman.py" The first line is 16 | |
| PartAuto._uidir = '../../../../gui/qt' | PartMan._uidir = '../../../../gui/qt' | |
| styleFile = os.path.join(PartAuto._uidir, 'style.qss') | styleFile = os.path.join(PartMan._uidir, 'style.qss') | |
| sf = open(styleFile, 'r') | sf = open(styleFile, 'r') | |
| app.setStyleSheet(sf.read()) | app.setStyleSheet(sf.read()) | |
| sf.close() | sf.close() |
Clone # 132
Distance between two fragments = 2
Clone size = 5
| Source file "./scripts/plugininstall.py" The first line is 841 | Source file "./ubiquity/install_misc.py" The first line is 701 | |
| fetchprogress = install_misc.DebconfAcquireProgress(self.db, 'ubiquity/install/title', 'ubiquity/install/apt_indices_starting', 'ubiquity/install/apt_indices') | fetchprogress = DebconfAcquireProgress(self.db, 'ubiquity/install/title', 'ubiquity/install/apt_indices_starting', 'ubiquity/install/apt_indices') | |
| cache = Cache() | cache = Cache() |
Clone # 133
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 153 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 662 | |
|
if (otherpart['dev'] == partition['dev']) and ('id' in otherpart) and (otherpart['parted']['type'] == 'primary'): self.create_dialog.partition_create_type_logical.setChecked(True) break |
if (otherpart['dev'] == partition['dev']) and ('id' in otherpart) and (otherpart['parted']['type'] == 'primary'): self.partition_create_type_logical.set_active(True) break |
Clone # 134
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/filteredcommand.py" The first line is 207 | Source file "./ubiquity/filteredcommand.py" The first line is 100 | |
|
if len(prep) > 2: env = prep[2] else: env = {} |
if len(prep) > 2: env = prep[2] else: env = {} |
|
| self.debug("Starting up '%s' unfiltered for %s.%s", self.command, self.__class__.__module__, self.__class__.__name__) | self.debug("Starting up '%s' for %s.%s", self.command, self.__class__.__module__, self.__class__.__name__) |
Clone # 135
Distance between two fragments = 2
Clone size = 5
| Source file "./ubiquity/install_misc.py" The first line is 132 | Source file "./ubiquity/install_misc.py" The first line is 120 | |
| f = open(initctl, 'w') | f = open(start_stop_daemon, 'w') | |
| print >> f, "#!/bin/sh\necho 1>&2\necho 'Warning: Fake initctl called, doing nothing.' 1>&2\nexit 0" | print >> f, "#!/bin/sh\necho 1>&2\necho 'Warning: Fake start-stop-daemon called, doing nothing.' 1>&2\nexit 0" | |
| f.close() | f.close() | |
| os.chmod(initctl, 493) | os.chmod(start_stop_daemon, 493) |
Clone # 136
Distance between two fragments = 2
Clone size = 5
| Source file "./ubiquity/install_misc.py" The first line is 132 | Source file "./ubiquity/install_misc.py" The first line is 110 | |
| f = open(initctl, 'w') | f = open(policy_rc_d, 'w') | |
| print >> f, "#!/bin/sh\necho 1>&2\necho 'Warning: Fake initctl called, doing nothing.' 1>&2\nexit 0" | print >> f, '#!/bin/sh\nexit 101' | |
| f.close() | f.close() | |
| os.chmod(initctl, 493) | os.chmod(policy_rc_d, 493) |
Clone # 137
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/i18n.py" The first line is 148 | Source file "./ubiquity/i18n.py" The first line is 136 | |
| namebits = name.split('-', 1) | namebits = name.split('-', 1) | |
|
if len(namebits) == 1: lang = 'c' else: lang = namebits[1].lower() lang = lang.split('.')[0] |
if len(namebits) == 1: lang = 'c' else: lang = namebits[1].lower() lang = lang.split('.')[0] |
Clone # 138
Distance between two fragments = 3
Clone size = 5
| Source file "./scripts/plugininstall.py" The first line is 821 | Source file "./scripts/plugininstall.py" The first line is 814 | |
| dbfilter = yabootinstaller.YabootInstaller(None, self.db) | dbfilter = kbootinstaller.KbootInstaller(None, self.db) | |
| ret = dbfilter.run_command(auto_process=True) | ret = dbfilter.run_command(auto_process=True) | |
|
if ret != 0: raise install_misc.InstallStepError(('YabootInstaller failed with code %d') % (ret)) |
if ret != 0: raise install_misc.InstallStepError(('KbootInstaller failed with code %d') % (ret)) |
Clone # 139
Distance between two fragments = 3
Clone size = 5
| Source file "./scripts/plugininstall.py" The first line is 821 | Source file "./scripts/plugininstall.py" The first line is 807 | |
| dbfilter = yabootinstaller.YabootInstaller(None, self.db) | dbfilter = flash_kernel.FlashKernel(None, self.db) | |
| ret = dbfilter.run_command(auto_process=True) | ret = dbfilter.run_command(auto_process=True) | |
|
if ret != 0: raise install_misc.InstallStepError(('YabootInstaller failed with code %d') % (ret)) |
if ret != 0: raise install_misc.InstallStepError(('FlashKernel failed with code %d') % (ret)) |
Clone # 140
Distance between two fragments = 3
Clone size = 5
| Source file "./scripts/plugininstall.py" The first line is 814 | Source file "./scripts/plugininstall.py" The first line is 807 | |
| dbfilter = kbootinstaller.KbootInstaller(None, self.db) | dbfilter = flash_kernel.FlashKernel(None, self.db) | |
| ret = dbfilter.run_command(auto_process=True) | ret = dbfilter.run_command(auto_process=True) | |
|
if ret != 0: raise install_misc.InstallStepError(('KbootInstaller failed with code %d') % (ret)) |
if ret != 0: raise install_misc.InstallStepError(('FlashKernel failed with code %d') % (ret)) |
Clone # 141
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/keyboard_detector.py" The first line is 10 | Source file "./ubiquity/keyboard_detector.py" The first line is 28 | |
| self.keycodes = {} | self.keycodes = {} | |
| self.symbols = [] | self.symbols = [] | |
| self.present = -1 | self.present = -1 | |
| self.not_present = -1 | self.not_present = -1 | |
| self.result = '' | self.result = '' |
Clone # 142
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 487 | Source file "./ubiquity/plugins/ubi-prepare.py" The first line is 226 | |
|
if (state) and ((state != 4) and (state != 3)): return None |
if (state) and ((state != 4) and (state != 3)): return None |
|
| QTimer.singleShot(300, self.check_returncode) | QTimer.singleShot(300, self.check_returncode) | |
| self.timer = QTimer(self.page) | self.timer = QTimer(self.page) | |
| self.timer.connect(self.timer, SIGNAL('timeout()'), self.check_returncode) | self.timer.connect(self.timer, SIGNAL('timeout()'), self.check_returncode) |
Clone # 143
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/plugins/ubi-prepare.py" The first line is 154 | Source file "./ubiquity/plugins/ubi-language.py" The first line is 159 | |
|
if (state) and ((state != 4) and (state != 3)): return None |
if (state) and ((state != 4) and (state != 3)): return None |
|
|
if self.timeout_id: gobject.source_remove(self.timeout_id) |
if self.timeout_id: gobject.source_remove(self.timeout_id) |
|
| self.timeout_id = gobject.timeout_add(300, self.check_returncode) | self.timeout_id = gobject.timeout_add(300, self.check_returncode) |
Clone # 144
Distance between two fragments = 4
Clone size = 5
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 275 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 215 | |
| self.allowed_go_forward = True | self.allowed_go_backward = True | |
| self.stay_on_page = False | self.allowed_go_forward = True | |
| self.mainLoopRunning = False | self.stay_on_page = False | |
| self.progress_position = ubiquity.progressposition.ProgressPosition() | self.progress_position = ubiquity.progressposition.ProgressPosition() | |
| self.progress_cancelled = False | self.progress_cancelled = False |
Clone # 145
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 1138 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1355 | |
| self.finished_pages = True | self.finished_pages = True | |
|
if (self.finished_installing) or (self.oem_user_config): self.ui.progressBar.show() dbfilter = plugininstall.Install(self) dbfilter.start(auto_process=True) |
if (self.finished_installing) or (self.oem_user_config): self.progress_section.show() dbfilter = plugininstall.Install(self) dbfilter.start(auto_process=True) |
Clone # 146
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2323 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2305 | |
|
if self.creating_partition: request = self.creating_partition else: request = self.editing_partition |
if self.creating_partition: request = self.creating_partition else: request = self.editing_partition |
|
|
if 'bad_mountpoint' in request: return False |
if 'bad_mountpoint' in request: return False |
Clone # 147
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/gtkwidgets.py" The first line is 696 | Source file "./ubiquity/gtkwidgets.py" The first line is 705 | |
|
if (self.flags()) & (gtk.REALIZED): self.window.move_resize((allocation.x) + (border_width), (allocation.y) + (border_width), w, h) |
if (self.flags()) & (gtk.REALIZED): self.offscreen_window.move_resize((allocation.x) + (border_width), (allocation.y) + (border_width), w, h) |
Clone # 148
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/install_misc.py" The first line is 44 | Source file "./ubiquity/install_misc.py" The first line is 372 | |
| os.environ['DEBIAN_FRONTEND'] = 'noninteractive' | os.environ['DEBIAN_FRONTEND'] = 'noninteractive' | |
|
if 'DEBIAN_HAS_FRONTEND' in os.environ: os.environ['DEBIAN_HAS_FRONTEND'] |
if 'DEBIAN_HAS_FRONTEND' in os.environ: os.environ['DEBIAN_HAS_FRONTEND'] |
|
|
if 'DEBCONF_USE_CDEBCONF' in os.environ: os.environ['DEBCONF_USE_CDEBCONF'] |
if 'DEBCONF_USE_CDEBCONF' in os.environ: os.environ['DEBCONF_USE_CDEBCONF'] |
Clone # 149
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1070 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1061 | |
| column_format = gtk.TreeViewColumn(self.controller.get_string('partition_column_format'), cell_format) | column_mountpoint = gtk.TreeViewColumn(self.controller.get_string('partition_column_mountpoint'), cell_mountpoint) | |
| column_format.set_cell_data_func(cell_format, self.partman_column_format) | column_mountpoint.set_cell_data_func(cell_mountpoint, self.partman_column_mountpoint) | |
| column_format.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) | column_mountpoint.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) |
Clone # 150
Distance between two fragments = 2
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 846 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 723 | |
| method_iter = self.partition_edit_use_combo.get_active_iter() | method_iter = self.partition_create_use_combo.get_active_iter() | |
|
if method_iter is None: method = None else: model = self.partition_edit_use_combo.get_model() method = model.get_value(method_iter, 0) |
if method_iter is None: method = None else: model = self.partition_create_use_combo.get_model() method = model.get_value(method_iter, 1) |
Clone # 151
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/gtkwidgets.py" The first line is 909 | Source file "./ubiquity/gtkwidgets.py" The first line is 900 | |
| iterator = self.model.get_iter_first() | iterator = self.model.get_iter_first() | |
|
while iterator is not None: if self.model.get_value(iterator, 0) == ap: break iterator = self.model.iter_next(iterator) |
while iterator is not None: if self.model.get_value(iterator, 0) == ap: break iterator = self.model.iter_next(iterator) |
Clone # 152
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 255 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 774 | |
| min_size_mb = (int(partition['resize_min_size'])) / (1000000) | min_size_mb = (int(partition['resize_min_size'])) / (1000000) | |
| cur_size_mb = (int(partition['parted']['size'])) / (1000000) | cur_size_mb = (int(partition['parted']['size'])) / (1000000) | |
| max_size_mb = (int(partition['resize_max_size'])) / (1000000) | max_size_mb = (int(partition['resize_max_size'])) / (1000000) | |
| min_size_mb = min(min_size_mb, cur_size_mb) | min_size_mb = min(min_size_mb, cur_size_mb) | |
| max_size_mb = max(cur_size_mb, max_size_mb) | max_size_mb = max(cur_size_mb, max_size_mb) |
Clone # 153
Distance between two fragments = 4
Clone size = 5
| Source file "./scripts/install.py" The first line is 334 | Source file "./scripts/install.py" The first line is 329 | |
|
if os.path.exists('/proc/sys/vm/dirty_expire_centisecs'): with (open('/proc/sys/vm/dirty_expire_centisecs')) as (dec): dirty_expire_centisecs = int(dec.readline()) with (open('/proc/sys/vm/dirty_expire_centisecs', 'w')) as (dec): print >> dec, '6000\n' |
if os.path.exists('/proc/sys/vm/dirty_writeback_centisecs'): with (open('/proc/sys/vm/dirty_writeback_centisecs')) as (dwc): dirty_writeback_centisecs = int(dwc.readline()) with (open('/proc/sys/vm/dirty_writeback_centisecs', 'w')) as (dwc): print >> dwc, '3000\n' |
Clone # 154
Distance between two fragments = 4
Clone size = 5
| Source file "./scripts/plugininstall.py" The first line is 740 | Source file "./scripts/plugininstall.py" The first line is 731 | |
|
for entry in os.listdir(self.target): if re_symlink.match(entry) is not None: filename = os.path.join(self.target, entry) if os.path.islink(filename): os.unlink(filename) |
for entry in os.listdir(linkdir): if re_symlink.match(entry) is not None: filename = os.path.join(linkdir, entry) if os.path.islink(filename): os.unlink(filename) |
Clone # 155
Distance between two fragments = 2
Clone size = 5
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 427 | Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 421 | |
|
def on_edit_clicked(self): devpart, partition = self.get_treeview_data() if (not devpart) or (not partition): return None self.partman_edit_dialog(devpart, partition) |
def on_new_clicked(self): devpart, partition = self.get_treeview_data() if (not devpart) or (not partition): return None self.partman_create_dialog(devpart, partition) |
Clone # 156
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/segmented_bar.py" The first line is 692 | Source file "./ubiquity/segmented_bar.py" The first line is 619 | |
| i = 0 | i = 0 | |
| size = 0.0 | resize_part_start = 0 | |
|
while i <= self.resize: size += self.segments[i].size i += 1 |
while i < self.resize: resize_part_start += self.segments[i].size i += 1 |
Clone # 157
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 122 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 134 | |
|
def allow_go_forward(self, allowed): try: self._wizard.allow_go_forward(allowed) except AttributeError: pass |
def allow_change_step(self, allowed): try: self._wizard.allow_change_step(allowed) except AttributeError: pass |
Clone # 158
Distance between two fragments = 2
Clone size = 5
| Source file "./ubiquity/frontend/gtk_components/keyboard_query.py" The first line is 89 | Source file "./ubiquity/frontend/gtk_components/keyboard_query.py" The first line is 96 | |
|
def have_key(self, *args): try: r = self.keyboard_detect.read_step(self.keyboard_detect.present) self.process(r) except: self.hide() |
def no_have_key(self, *args): try: r = self.keyboard_detect.read_step(self.keyboard_detect.not_present) self.process(r) except: self.hide() |
Clone # 159
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 475 | Source file "./ubiquity/plugins/ubi-console-setup.py" The first line is 468 | |
|
if (variant == 'basic') or (variant.startswith('latin')): latin = True real_layout = layout else: latin = False real_layout = 'rs,rs' |
if (variant == 'basic') or (variant.startswith('latin')): latin = True real_layout = layout else: latin = False real_layout = 'me,me' |
Clone # 160
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/components/partman_commit.py" The first line is 65 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2354 | |
|
if (priority == 'critical') or (priority == 'high'): self.frontend.error_dialog(self.description(question), self.extended_description(question)) return FilteredCommand.error(self, priority, question) else: return True |
if (priority == 'critical') or (priority == 'high'): self.frontend.error_dialog(self.description(question), self.extended_description(question)) return Plugin.error(self, priority, question) else: return True |
Clone # 161
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-language.py" The first line is 532 | Source file "./ubiquity/plugins/ubi-language.py" The first line is 199 | |
|
def on_try_ubuntu_clicked(self, *args): self.controller.allow_change_step(False) self.page.install_ubuntu.setEnabled(False) self.controller._wizard.current_page = None self.controller.dbfilter.ok_handler() |
def on_try_ubuntu_clicked(self, *args): self.controller.allow_change_step(False) self.install_ubuntu.set_sensitive(False) self.controller._wizard.current_page = None self.controller.dbfilter.ok_handler() |
Clone # 162
Distance between two fragments = 2
Clone size = 5
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 870 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1144 | |
|
try: session = dbus.Bus.get_session() ksmserver = session.name_has_owner('org.kde.ksmserver') except dbus.exceptions.DBusException: ksmserver = False |
try: session = dbus.Bus.get_session() gnome_session = session.name_has_owner('org.gnome.SessionManager') except dbus.exceptions.DBusException: gnome_session = False |
Clone # 163
Distance between two fragments = 4
Clone size = 5
| Source file "./ubiquity/segmented_bar.py" The first line is 703 | Source file "./ubiquity/segmented_bar.py" The first line is 701 | |
| c = CairoExtensions.rgb_to_color('f2efec') | c = CairoExtensions.rgb_to_color('f4f1ef') | |
| grad.add_color_stop_rgb(0.5, c.r, c.g, c.b) | grad.add_color_stop_rgb(0, c.r, c.g, c.b) | |
| c = CairoExtensions.rgb_to_color('ece7e2') | c = CairoExtensions.rgb_to_color('f2efec') | |
| grad.add_color_stop_rgb(0.5, c.r, c.g, c.b) | grad.add_color_stop_rgb(0.5, c.r, c.g, c.b) | |
| c = CairoExtensions.rgb_to_color('e8e2dc') | c = CairoExtensions.rgb_to_color('ece7e2') |
Clone # 164
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 625 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 619 | |
| delete_item = gtk.MenuItem(self.controller.get_string('partition_button_delete')) | edit_item = gtk.MenuItem(self.controller.get_string('partition_button_edit')) | |
| delete_item.connect('activate', self.on_partition_list_delete_activate) | edit_item.connect('activate', self.on_partition_list_edit_activate) | |
| partition_list_menu.append(delete_item) | partition_list_menu.append(edit_item) |
Clone # 165
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 625 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 613 | |
| delete_item = gtk.MenuItem(self.controller.get_string('partition_button_delete')) | new_item = gtk.MenuItem(self.controller.get_string('partition_button_new')) | |
| delete_item.connect('activate', self.on_partition_list_delete_activate) | new_item.connect('activate', self.on_partition_list_new_activate) | |
| partition_list_menu.append(delete_item) | partition_list_menu.append(new_item) |
Clone # 166
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 625 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 607 | |
| delete_item = gtk.MenuItem(self.controller.get_string('partition_button_delete')) | new_label_item = gtk.MenuItem(self.controller.get_string('partition_button_new_label')) | |
| delete_item.connect('activate', self.on_partition_list_delete_activate) | new_label_item.connect('activate', self.on_partition_list_new_label_activate) | |
| partition_list_menu.append(delete_item) | partition_list_menu.append(new_label_item) |
Clone # 167
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 619 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 613 | |
| edit_item = gtk.MenuItem(self.controller.get_string('partition_button_edit')) | new_item = gtk.MenuItem(self.controller.get_string('partition_button_new')) | |
| edit_item.connect('activate', self.on_partition_list_edit_activate) | new_item.connect('activate', self.on_partition_list_new_activate) | |
| partition_list_menu.append(edit_item) | partition_list_menu.append(new_item) |
Clone # 168
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 619 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 607 | |
| edit_item = gtk.MenuItem(self.controller.get_string('partition_button_edit')) | new_label_item = gtk.MenuItem(self.controller.get_string('partition_button_new_label')) | |
| edit_item.connect('activate', self.on_partition_list_edit_activate) | new_label_item.connect('activate', self.on_partition_list_new_label_activate) | |
| partition_list_menu.append(edit_item) | partition_list_menu.append(new_label_item) |
Clone # 169
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 613 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 607 | |
| new_item = gtk.MenuItem(self.controller.get_string('partition_button_new')) | new_label_item = gtk.MenuItem(self.controller.get_string('partition_button_new_label')) | |
| new_item.connect('activate', self.on_partition_list_new_activate) | new_label_item.connect('activate', self.on_partition_list_new_label_activate) | |
| partition_list_menu.append(new_item) | partition_list_menu.append(new_label_item) |
Clone # 170
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/frontend/debconf_ui.py" The first line is 140 | Source file "./ubiquity/frontend/noninteractive.py" The first line is 122 | |
| tbfile = open('/var/lib/ubiquity/install.trace') | tbfile = open('/var/lib/ubiquity/install.trace') | |
| realtb = tbfile.read() | realtb = tbfile.read() | |
| tbfile.close() | tbfile.close() | |
| raise RuntimeError, ('Install failed with exit code %s\n%s') % ((ret, realtb)) | raise RuntimeError, ('Install failed with exit code %s\n%s') % ((ret, realtb)) |
Clone # 171
Distance between two fragments = 4
Clone size = 5
| Source file "./ubiquity/filteredcommand.py" The first line is 328 | Source file "./ubiquity/filteredcommand.py" The first line is 320 | |
| choices_c = self.choices_untranslated(question) | choices_c = self.choices_untranslated(question) | |
|
for i in range(len(choices_c)): if choices_c[i] == value: return i |
for i in range(len(choices)): if choices[i] == value: return choices_c[i] |
|
| raise ValueError, value | raise ValueError, value |
Clone # 172
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 2020 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1996 | |
| devpart = self.deleting_partition['devpart'] | devpart = self.creating_label['devpart'] | |
|
if devpart in self.partition_cache: partition = self.partition_cache[devpart] self.preseed(question, partition['display'], seen=False) |
if devpart in self.disk_cache: disk = self.disk_cache[devpart] self.preseed(question, disk['display'], seen=False) |
|
| return True | return True |
Clone # 173
Distance between two fragments = 4
Clone size = 5
| Source file "./ubiquity/frontend/kde_components/PartitionModel.py" The first line is 236 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 561 | |
| partition = self.itemData[1] | partition = model[path][1] | |
|
if ('id' not in partition) or ('method' not in partition): return None |
if ('id' not in partition) or ('method' not in partition): return None |
|
| self.controller.allow_change_step(False) | self.controller.allow_change_step(False) | |
| self.controller.dbfilter.edit_partition(devpart, fmt='dummy') | self.controller.dbfilter.edit_partition(devpart, fmt='dummy') |
Clone # 174
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1479 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1429 | |
| self.run_automation_error_cmd() | self.run_automation_error_cmd() | |
| saved_allowed_change_step = self.allowed_change_step | saved_allowed_change_step = self.allowed_change_step | |
| self.allow_change_step(True) | self.allow_change_step(True) | |
|
if not msg: msg = title |
if not msg: msg = title |
Clone # 175
Distance between two fragments = 0
Clone size = 5
| Source file "./scripts/plugininstall.py" The first line is 870 | Source file "./ubiquity/install_misc.py" The first line is 748 | |
| fetchprogress.stop() | fetchprogress.stop() | |
| installprogress.finishUpdate() | installprogress.finishUpdate() | |
| self.db.progress('STOP') | self.db.progress('STOP') | |
| self.nested_progress_end() | self.nested_progress_end() | |
| return None | return None |
Clone # 176
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/install_misc.py" The first line is 748 | Source file "./ubiquity/install_misc.py" The first line is 740 | |
| fetchprogress.stop() | fetchprogress.stop() | |
| installprogress.finishUpdate() | installprogress.finishUpdate() | |
| self.db.progress('STOP') | self.db.progress('STOP') | |
| self.nested_progress_end() | self.nested_progress_end() | |
| return None | return None |
Clone # 177
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1959 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1943 | |
| self.ui.show_page_advanced() | self.progress_stop() | |
| self.maybe_update_grub() | self.maybe_update_grub() | |
| self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) | self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) |
Clone # 178
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1959 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1814 | |
| self.ui.show_page_advanced() | self.ui.show_page_advanced() | |
| self.maybe_update_grub() | self.maybe_update_grub() | |
| self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) | self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) |
Clone # 179
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1951 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1943 | |
| self.ui.show_page_advanced() | self.progress_stop() | |
| self.maybe_update_grub() | self.maybe_update_grub() | |
| self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) | self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) |
Clone # 180
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1951 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1814 | |
| self.ui.show_page_advanced() | self.ui.show_page_advanced() | |
| self.maybe_update_grub() | self.maybe_update_grub() | |
| self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) | self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) |
Clone # 181
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1943 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1814 | |
| self.progress_stop() | self.ui.show_page_advanced() | |
| self.maybe_update_grub() | self.maybe_update_grub() | |
| self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) | self.ui.update_partman(self.disk_cache, self.partition_cache, self.cache_order) |
Clone # 182
Distance between two fragments = 3
Clone size = 5
| Source file "./scripts/plugininstall.py" The first line is 166 | Source file "./scripts/plugininstall.py" The first line is 130 | |
| self.next_region() | self.next_region() | |
| self.db.progress('INFO', 'ubiquity/install/bootloader') | self.db.progress('INFO', 'ubiquity/install/network') | |
| self.configure_bootloader() | self.configure_network() | |
| self.next_region() | self.next_region() | |
| self.db.progress('INFO', 'ubiquity/install/installing') | self.db.progress('INFO', 'ubiquity/install/apt') |
Clone # 183
Distance between two fragments = 4
Clone size = 5
| Source file "./ubiquity/install_misc.py" The first line is 299 | Source file "./ubiquity/install_misc.py" The first line is 246 | |
| InstallProgress.__init__(self) | AcquireProgress.__init__(self) | |
| self.db = db | self.db = db | |
| self.title = title | self.title = title | |
| self.info = info | self.info_starting = info_starting | |
| self.error_template = error | self.info = info |
Clone # 184
Distance between two fragments = 4
Clone size = 5
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 206 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 732 | |
| self.ctrlr.allow_change_step(False) | self.controller.allow_change_step(False) | |
| self.ctrlr.dbfilter.create_partition(devpart, str(self.create_dialog.partition_create_size_spinbutton.value()), prilog, place, method, mountpoint) | self.controller.dbfilter.create_partition(devpart, str(self.partition_create_size_spinbutton.get_value()), prilog, place, method, mountpoint) |
Clone # 185
Distance between two fragments = 1
Clone size = 5
| Source file "./ubiquity/frontend/kde_components/PartAuto.py" The first line is 155 | Source file "./ubiquity/frontend/kde_components/PartAuto.py" The first line is 120 | |
| self.disks.append(disks) | self.disks.append(disks) | |
| button = QRadioButton(manual_choice, self.autopart_selection_frame) | button = QRadioButton(use_device_choice, self.autopart_selection_frame) | |
| self.autopartitionTexts.append(manual_choice) | self.autopartitionTexts.append(use_device_choice) | |
| self.autopart_selection_frame.layout().addWidget(button) | self.autopart_selection_frame.layout().addWidget(button) | |
| self.autopartition_buttongroup.addButton(button, bId) | self.autopartition_buttongroup.addButton(button, bId) |
Clone # 186
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 366 | Source file "./ubiquity/frontend/kde_components/PartMan.py" The first line is 227 | |
| self.edit_dialog.partition_edit_format_checkbutton.setEnabled(True) | self.create_dialog.partition_create_mount_combo.setEnabled(True) | |
| self.edit_dialog.partition_edit_mount_combo.clear() | self.create_dialog.partition_create_mount_combo.clear() | |
|
for mp, choice_c, choice in self.ctrlr.dbfilter.default_mountpoint_choices(method): self.edit_dialog.partition_edit_mount_combo.addItem(mp) |
for mp, choice_c, choice in self.ctrlr.dbfilter.default_mountpoint_choices(method): self.create_dialog.partition_create_mount_combo.addItem(mp) |
Clone # 187
Distance between two fragments = 3
Clone size = 5
| Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1974 | Source file "./ubiquity/plugins/ubi-partman.py" The first line is 1969 | |
| self.debug('partition_cache:') | self.debug('disk_cache:') | |
| printer = pprint.PrettyPrinter() | printer = pprint.PrettyPrinter() | |
|
for line in printer.pformat(self.partition_cache).split('\n'): self.debug('%s', line) |
for line in printer.pformat(self.disk_cache).split('\n'): self.debug('%s', line) |
|
| self.debug('partition_cache end') | self.debug('disk_cache end') |
Clone # 188
Distance between two fragments = 4
Clone size = 5
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 891 | Source file "./ubiquity/frontend/kde_ui.py" The first line is 883 | |
|
def quit_installer(self): self.current_page = None if self.dbfilter is not None: self.dbfilter.cancel_handler() self.quit_main_loop() |
def quit(self): self.current_page = None if self.dbfilter is not None: self.dbfilter.cancel_handler() self.app.exit() |
Clone # 189
Distance between two fragments = 4
Clone size = 6
| Source file "./ubiquity/plugins/ubi-usersetup.py" The first line is 741 | Source file "./ubiquity/plugins/ubi-usersetup.py" The first line is 669 | |
|
if 'UBIQUITY_OEM_USER_CONFIG' in os.environ: environ = {'OVERRIDE_SYSTEM_USER': '1'} return (['/usr/lib/ubiquity/user-setup/user-setup-apply'], [], environ) else: return (['/usr/lib/ubiquity/user-setup/user-setup-apply', '/target'], []) |
if 'UBIQUITY_OEM_USER_CONFIG' in os.environ: environ = {'OVERRIDE_SYSTEM_USER': '1'} return (['/usr/lib/ubiquity/user-setup/user-setup-ask-oem'], questions, environ) else: return (['/usr/lib/ubiquity/user-setup/user-setup-ask', '/target'], questions) |
Clone # 190
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/frontend/gtk_ui.py" The first line is 817 | Source file "./ubiquity/frontend/kde_ui.py" The first line is 588 | |
|
if lang is None: lang = self.locale |
if lang is None: lang = self.locale |
|
|
if lang is None: languages = [] else: languages = [lang] |
if lang is None: languages = [] else: languages = [lang] |
Clone # 191
Distance between two fragments = 0
Clone size = 5
| Source file "./ubiquity/frontend/kde_ui.py" The first line is 1090 | Source file "./ubiquity/frontend/gtk_ui.py" The first line is 1313 | |
|
def debconf_progress_stop(self): self.progress_cancelled = False self.progress_position.stop() |
def debconf_progress_stop(self): self.progress_cancelled = False self.progress_position.stop() |
|
|
def debconf_progress_region(self, region_start, region_end): self.progress_position.set_region(region_start, region_end) |
def debconf_progress_region(self, region_start, region_end): self.progress_position.set_region(region_start, region_end) |