diff options
author | pav <pav@FreeBSD.org> | 2004-03-27 22:17:38 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2004-03-27 22:17:38 +0800 |
commit | 824e196dde3ad78e6c32447399cd405ea65aebcb (patch) | |
tree | d9f028885cd24e2ead27e0aca5cec42e127232f2 | |
parent | d9b5bcd30b80118cc980cc3af51a45a3d9f43433 (diff) | |
download | freebsd-ports-gnome-824e196dde3ad78e6c32447399cd405ea65aebcb.tar.gz freebsd-ports-gnome-824e196dde3ad78e6c32447399cd405ea65aebcb.tar.zst freebsd-ports-gnome-824e196dde3ad78e6c32447399cd405ea65aebcb.zip |
- Replace Linuxism with FreeBSDism in uptime sensor (clock display).
- Raise PORTREVISION.
PR: ports/64787
Submitted by: Tim Bishop <tim@bishnet.net> (maintainer)
-rw-r--r-- | deskutils/gdesklets-ltvariations/Makefile | 2 | ||||
-rw-r--r-- | deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/deskutils/gdesklets-ltvariations/Makefile b/deskutils/gdesklets-ltvariations/Makefile index 18a0c30d4f84..5a5dc56737df 100644 --- a/deskutils/gdesklets-ltvariations/Makefile +++ b/deskutils/gdesklets-ltvariations/Makefile @@ -7,7 +7,7 @@ PORTNAME= ltvariations PORTVERSION= 0.26 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= deskutils gnome MASTER_SITES= http://gdesklets.gnomedesktop.org/files/ PKGNAMEPREFIX= gdesklets- diff --git a/deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py b/deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py index b1e1ae1f030d..4b415071cd56 100644 --- a/deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py +++ b/deskutils/gdesklets-ltvariations/files/LTVUptime::__init__.py @@ -1,5 +1,5 @@ ---- __init__.py.bak Sun Mar 21 17:40:07 2004 -+++ __init__.py Sun Mar 21 17:41:40 2004 +--- __init__.py.bak Fri Mar 26 22:08:26 2004 ++++ __init__.py Fri Mar 26 22:08:49 2004 @@ -21,7 +21,7 @@ self._set_config_type("update", TYPE_INT, int(interval)) self._set_config_type("format", TYPE_STRING, format) @@ -9,3 +9,12 @@ self._set_config_type("kernel", TYPE_STRING, commands.getoutput("uname -s")) self._set_config_type("version", TYPE_STRING, commands.getoutput("uname -r")) self._set_config_type("processor", TYPE_STRING, commands.getoutput("uname -p")) +@@ -63,7 +63,7 @@ + + def draw_uptime(self, data): + if self.__enable[ 0 ] != "0" : +- uptime = float( commands.getoutput("cat /proc/uptime").split()[0] ) ++ uptime = time.time() - float(commands.getoutput("sysctl kern.boottime").split()[4][:-1]) + d = int( uptime / 60 / 60 / 24 ) + uptime = uptime - d * 60 * 60 * 24 + h = int( uptime / 60 / 60 ) |