summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-09-15 14:38:39 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-09-15 14:38:39 +0200
commitadc195c45f67bb3da1b1e37fe6284a72c74f5c9d (patch)
tree8f5ea524fd4a498defd4f24c7811b955fa2b895c /portato/gui
parentde62ee741abca9655e8556eb1cebb9dd5d6d2d38 (diff)
downloadportato-adc195c45f67bb3da1b1e37fe6284a72c74f5c9d.tar.gz
portato-adc195c45f67bb3da1b1e37fe6284a72c74f5c9d.tar.bz2
portato-adc195c45f67bb3da1b1e37fe6284a72c74f5c9d.zip
Some small readability changes
Diffstat (limited to '')
-rw-r--r--portato/gui/queue.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/portato/gui/queue.py b/portato/gui/queue.py
index 3aaeb5b..610bc49 100644
--- a/portato/gui/queue.py
+++ b/portato/gui/queue.py
@@ -302,7 +302,7 @@ class EmergeQueue:
else: # unmerge
self.unmergequeue.append(cpv)
if self.tree: # update tree
- self.iters["uninstall"].update({cpv: self.tree.append(self.tree.get_unmerge_it(), self.tree.build_append_value(cpv))})
+ self.iters["uninstall"][cpv] = self.tree.append(self.tree.get_unmerge_it(), self.tree.build_append_value(cpv))
def _queue_append (self, cpv, oneshot = False):
"""Convenience function appending a cpv either to self.mergequeue or to self.oneshotmerge.
@@ -362,7 +362,7 @@ class EmergeQueue:
os.dup2(self.pty[1], 2)
# get all categories that are being touched during the emerge process
- cats = set(map(lambda x: x.split("/")[0], it.iterkeys()))
+ cats = set(x.split("/")[0] for x in it.iterkeys())
# start emerge
self.process = Popen(command+options+packages, shell = False, env = system.get_environment(), preexec_fn = pre)
@@ -377,14 +377,14 @@ class EmergeQueue:
if self.console:
old_title = self.console.get_window_title()
while self.process and self.process.poll() is None:
- if self.title_update :
+ if self.title_update:
title = self.console.get_window_title()
if title != old_title:
self.title_update(title)
old_title = title
time.sleep(0.5)
- if self.up:
+ if self.up:
self.up.stop()
if it:
self.tree.set_in_progress(top, False)
@@ -472,7 +472,7 @@ class EmergeQueue:
@param options: Additional options to send to the emerge command
@type options: string[]"""
- if len(self.unmergequeue) == 0: return # nothing in queue
+ if not self.unmergequeue: return # nothing in queue
list = self.unmergequeue[:] # copy the unmerge-queue
.cLars Hjemli5-70/+90 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-11Move common output-functions into ui-shared.cLars Hjemli4-82/+99 While at it, replace the cgit_[lib_]error constants with a proper function Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-11Rename config.c to parsing.c + move cgit_parse_query from cgit.c to parsing.cLars Hjemli4-28/+29 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-11Avoid infinite loops in caching layerLars Hjemli3-14/+31 Add a global variable, cgit_max_lock_attemps, to avoid the possibility of infinite loops when failing to acquire a lockfile. This could happen on broken setups or under crazy server load. Incidentally, this also fixes a lurking bug in cache_lock() where an uninitialized returnvalue was used. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-11Let 'make install' clear all cachefilesLars Hjemli1-0/+2 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-11Fix cache algorithm loopholeLars Hjemli3-11/+16 This closes the door for unneccessary calls to cgit_fill_cache(). Noticed by Linus. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-10Add version identifier in generated filesLars Hjemli2-9/+14 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-10Add license file and copyright noticesLars Hjemli5-0/+372 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-10Add caching infrastructureLars Hjemli9-28/+353 This enables internal caching of page output. Page requests are split into four groups: 1) repo listing (front page) 2) repo summary 3) repo pages w/symbolic references in query string 4) repo pages w/constant sha1's in query string Each group has a TTL specified in minutes. When a page is requested, a cached filename is stat(2)'ed and st_mtime is compared to time(2). If TTL has expired (or the file didn't exist), the cached file is regenerated. When generating a cached file, locking is used to avoid parallell processing of the request. If multiple processes tries to aquire the same lock, the ones who fail to get the lock serves the (expired) cached file. If the cached file don't exist, the process instead calls sched_yield(2) before restarting the request processing. Signed-off-by: Lars Hjemli <hjemli@gmail.com>