Use xrange instead of range. No functional changes; just means we create fewer lists.
This commit is contained in:
parent
1a6fd441a5
commit
b200044391
|
@ -64,7 +64,7 @@ def get_process_cwd(pid):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
kifs = cast(buf, POINTER(kinfo_file))
|
kifs = cast(buf, POINTER(kinfo_file))
|
||||||
for i in range(0, len.value / sizeof(kinfo_file)):
|
for i in xrange(0, len.value / sizeof(kinfo_file)):
|
||||||
kif = kifs[i]
|
kif = kifs[i]
|
||||||
if kif.kf_fd == -1: # KF_FD_TYPE_CWD
|
if kif.kf_fd == -1: # KF_FD_TYPE_CWD
|
||||||
return kif.kf_path
|
return kif.kf_path
|
||||||
|
|
|
@ -62,7 +62,7 @@ class TerminatorNotebookTabLabel(gtk.HBox):
|
||||||
def on_close(self, widget):
|
def on_close(self, widget):
|
||||||
nbpages = self._notebook.get_n_pages()
|
nbpages = self._notebook.get_n_pages()
|
||||||
print self._button.allocation.width, self._button.allocation.height
|
print self._button.allocation.width, self._button.allocation.height
|
||||||
for i in range(0,nbpages):
|
for i in xrange(0,nbpages):
|
||||||
if self._notebook.get_tab_label(self._notebook.get_nth_page(i)) == self:
|
if self._notebook.get_tab_label(self._notebook.get_nth_page(i)) == self:
|
||||||
#dbg("[Close from tab] Found tab at position [%d]" % i)
|
#dbg("[Close from tab] Found tab at position [%d]" % i)
|
||||||
term = self.terminator._notebook_first_term(self._notebook.get_nth_page(i))
|
term = self.terminator._notebook_first_term(self._notebook.get_nth_page(i))
|
||||||
|
@ -116,7 +116,7 @@ class Terminator:
|
||||||
if self.conf.f11_modifier:
|
if self.conf.f11_modifier:
|
||||||
self._f11_modifier = True
|
self._f11_modifier = True
|
||||||
|
|
||||||
if self.conf.handle_size in range (0,6):
|
if self.conf.handle_size in xrange (0,6):
|
||||||
gtk.rc_parse_string("""
|
gtk.rc_parse_string("""
|
||||||
style "terminator-paned-style" {
|
style "terminator-paned-style" {
|
||||||
GtkPaned::handle_size = %s
|
GtkPaned::handle_size = %s
|
||||||
|
@ -295,7 +295,7 @@ class Terminator:
|
||||||
dbg ('SEGBUG: Parent is a notebook')
|
dbg ('SEGBUG: Parent is a notebook')
|
||||||
page = -1
|
page = -1
|
||||||
|
|
||||||
for i in range(0, parent.get_n_pages()):
|
for i in xrange(0, parent.get_n_pages()):
|
||||||
if parent.get_nth_page(i) == widget:
|
if parent.get_nth_page(i) == widget:
|
||||||
page = i
|
page = i
|
||||||
break
|
break
|
||||||
|
@ -565,7 +565,7 @@ class Terminator:
|
||||||
parent.remove(widget)
|
parent.remove(widget)
|
||||||
if isinstance(grandparent, gtk.Notebook):
|
if isinstance(grandparent, gtk.Notebook):
|
||||||
page = -1
|
page = -1
|
||||||
for i in range(0, grandparent.get_n_pages()):
|
for i in xrange(0, grandparent.get_n_pages()):
|
||||||
if grandparent.get_nth_page(i) == parent:
|
if grandparent.get_nth_page(i) == parent:
|
||||||
page = i
|
page = i
|
||||||
break
|
break
|
||||||
|
@ -779,7 +779,7 @@ class Terminator:
|
||||||
parent = widget.get_parent()
|
parent = widget.get_parent()
|
||||||
if isinstance (parent, gtk.Notebook):
|
if isinstance (parent, gtk.Notebook):
|
||||||
page = -1
|
page = -1
|
||||||
for i in range(0, parent.get_n_pages()):
|
for i in xrange(0, parent.get_n_pages()):
|
||||||
if parent.get_nth_page(i) == widget:
|
if parent.get_nth_page(i) == widget:
|
||||||
return (parent, widget)
|
return (parent, widget)
|
||||||
return self.get_first_notebook_page(parent)
|
return self.get_first_notebook_page(parent)
|
||||||
|
|
Loading…
Reference in New Issue