Simplified pacman
and cower
backends.
Fixed bug in `aptget` backend.
This commit is contained in:
parent
3496a7bae5
commit
96ef3656c8
@ -63,7 +63,6 @@ class Updates(IntervalModule):
|
||||
def init(self):
|
||||
if not isinstance(self.backends, list):
|
||||
self.backends = [self.backends]
|
||||
return
|
||||
|
||||
def run(self):
|
||||
if not internet():
|
||||
@ -88,4 +87,3 @@ class Updates(IntervalModule):
|
||||
"full_text": formatp(self.format, **fdict).strip(),
|
||||
"color": self.color,
|
||||
}
|
||||
return
|
||||
|
@ -19,9 +19,9 @@ class AptGet(Backend):
|
||||
os.mkdir(cache_dir)
|
||||
|
||||
command = "apt-get update -o Dir::State::Lists=" + cache_dir
|
||||
run_through_shell(command)
|
||||
run_through_shell(command.split())
|
||||
command = "apt-get upgrade -s -o Dir::State::Lists=" + cache_dir
|
||||
apt = run_through_shell(command)
|
||||
apt = run_through_shell(command.split())
|
||||
|
||||
update_count = 0
|
||||
for line in apt.out.split("\n"):
|
||||
|
@ -13,8 +13,6 @@ class Cower(Backend):
|
||||
def updates(self):
|
||||
command = ["cower", "-u"]
|
||||
cower = run_through_shell(command)
|
||||
out = cower.out.strip()
|
||||
|
||||
return len(out.split("\n")) if len(out) > 0 else 0
|
||||
return cower.out.count('\n')
|
||||
|
||||
Backend = Cower
|
||||
|
@ -12,8 +12,6 @@ class Pacman(Backend):
|
||||
def updates(self):
|
||||
command = ["checkupdates"]
|
||||
checkupdates = run_through_shell(command)
|
||||
out = checkupdates.out.strip()
|
||||
|
||||
return len(out.split("\n")) if len(out) > 0 else 0
|
||||
return checkupdates.out.count('\n')
|
||||
|
||||
Backend = Pacman
|
||||
|
Loading…
Reference in New Issue
Block a user