mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-23 09:10:43 +00:00
Update to 0.22.
This update is a collaboration between the maintainer and myself, the libdesklets part isn't finished and needs a little more debugging (RAM and boottime display). Unfortunately we also have a problem with threads (they get created, but they don't run/start) which we can't track down, so it's not easy to debug the remaining libdesklets bugs. We decided to commit the port in the current incarnation as at least the desklets which I will commit shortly after this update will work without problems. Submitted by: maintainer
This commit is contained in:
parent
1ba93c844a
commit
670e7bef15
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=89434
@ -6,8 +6,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= gdesklets
|
||||
PORTVERSION= 0.20
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 0.22
|
||||
CATEGORIES= deskutils gnome
|
||||
MASTER_SITES= http://www.pycage.de/download/${PORTNAME}/
|
||||
DISTNAME= gDesklets-${PORTVERSION}
|
||||
@ -27,8 +26,9 @@ USE_PYTHON= yes
|
||||
USE_X_PREFIX= yes
|
||||
USE_GNOME= gnomehack gnomeprefix gnometarget
|
||||
|
||||
MAN1= gdesklets.1
|
||||
|
||||
post-install:
|
||||
@${MKDIR} ${PREFIX}/share/gnome/gdesklets/Sensors
|
||||
@${MKDIR} ${PREFIX}/share/gnome/gdesklets/Displays
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
MD5 (gDesklets-0.20.tar.bz2) = cd43447ef66744665d8bdf11f181d3d0
|
||||
MD5 (gDesklets-0.22.tar.bz2) = 8fa67e7e33ce33a8aa5994246e81ddee
|
||||
|
11
deskutils/gdesklets/files/patch-data::Makefile.in
Normal file
11
deskutils/gdesklets/files/patch-data::Makefile.in
Normal file
@ -0,0 +1,11 @@
|
||||
--- data/Makefile.in.orig Wed Sep 17 18:19:06 2003
|
||||
+++ data/Makefile.in Wed Sep 17 18:20:02 2003
|
||||
@@ -190,7 +190,7 @@
|
||||
@USERINST_TRUE@mimedir = ~/.gnome/mime-info
|
||||
mime_in_files = gdesklets.keys.in
|
||||
mime_DATA = $(mime_in_files:.keys.in=.keys) gdesklets.mime
|
||||
-@USERINST_FALSE@mimeicondir = $(datadir)/icons/gnome/48x48/mimetypes
|
||||
+@USERINST_FALSE@mimeicondir = $(prefix)/share/icons/gnome/48x48/mimetypes
|
||||
|
||||
@USERINST_TRUE@mimeicondir = ~/.icons/gnome/48x48/mimetypes
|
||||
mimeicon_DATA = x-gdesklets-display.png
|
104
deskutils/gdesklets/files/patch-libdesklets::CPU.py
Normal file
104
deskutils/gdesklets/files/patch-libdesklets::CPU.py
Normal file
@ -0,0 +1,104 @@
|
||||
# Many thanks to Alexander Leidinger <netchild@FreeBSD.org> for
|
||||
# help and create those patches.
|
||||
|
||||
--- libdesklets/CPU.py.orig Mon Sep 22 12:16:08 2003
|
||||
+++ libdesklets/CPU.py Mon Sep 22 12:22:32 2003
|
||||
@@ -1,5 +1,7 @@
|
||||
import polling
|
||||
|
||||
+import os
|
||||
+import libdesklets as lib
|
||||
|
||||
#
|
||||
# TODO: support SMP
|
||||
@@ -21,8 +23,16 @@
|
||||
|
||||
self.get_load = polling.wrap(self.__poll_load, 0.2)
|
||||
|
||||
+ platform = lib.sys.get_os()
|
||||
+
|
||||
try:
|
||||
- fd = open("/proc/cpuinfo", "r")
|
||||
+ if platform == "FreeBSD":
|
||||
+ fd = os.popen("grep -3 CPU /var/run/dmesg.boot | head -7 | tail -4", "r")
|
||||
+ elif platform == "Linux":
|
||||
+ fd = open("/proc/cpuinfo", "r")
|
||||
+ else:
|
||||
+ print "Unknown OS, strange things may happen."
|
||||
+ return
|
||||
except IOError, e:
|
||||
import traceback; traceback.print_exc()
|
||||
print e
|
||||
@@ -40,15 +51,24 @@
|
||||
|
||||
def __poll_cpu(self):
|
||||
|
||||
- import libdesklets as lib
|
||||
+ import re
|
||||
arch = lib.sys.get_arch()
|
||||
+ platform = lib.sys.get_os()
|
||||
if (arch in ["i386", "i486", "i586", "i686"]):
|
||||
- fields = self.__lines[4].split()
|
||||
- model_name = " ".join(fields[3:])
|
||||
- fields = self.__lines[6].split()
|
||||
- cpu_mhz = fields[3]
|
||||
- fields = self.__lines[7].split()
|
||||
- cpu_cache = " ".join(fields[3:5])
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ m = re.search('^CPU: (.*) \(([0-9]+.*)-MHz [0-9]+-class CPU\)', self.__lines[0])
|
||||
+ model_name = m.group(1) # or sysctl hw.model
|
||||
+ cpu_mhz = m.group(2) # or sysctl hw.clockrate
|
||||
+ cpu_cache = " " # not available by default
|
||||
+ elif ("Linux" == platform):
|
||||
+ fields = self.__lines[4].split()
|
||||
+ model_name = " ".join(fields[3:])
|
||||
+ fields = self.__lines[6].split()
|
||||
+ cpu_mhz = fields[3]
|
||||
+ fields = self.__lines[7].split()
|
||||
+ cpu_cache = " ".join(fields[3:5])
|
||||
+ else:
|
||||
+ pass
|
||||
|
||||
elif (arch == "ppc"):
|
||||
fields = self.__lines[0].split()
|
||||
@@ -68,17 +88,34 @@
|
||||
|
||||
def __poll_load(self):
|
||||
|
||||
- fd = open("/proc/stat", "r")
|
||||
+ platform = lib.sys.get_os()
|
||||
+
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ fd = os.popen("iostat -n 0", "r")
|
||||
+ line = 2
|
||||
+ elif ("Linux" == platform):
|
||||
+ fd = open("/proc/stat", "r")
|
||||
+ line = 0
|
||||
+ else:
|
||||
+ return
|
||||
data = fd.read()
|
||||
fd.close()
|
||||
|
||||
data = data.splitlines()
|
||||
- fields = data[0].split()
|
||||
+ fields = data[line].split()
|
||||
|
||||
- u = float(fields[1])
|
||||
- s = float(fields[2])
|
||||
- n = float(fields[3])
|
||||
- i = float(fields[4])
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ u = float(fields[2]) + float(fields[3])
|
||||
+ s = float(fields[4])
|
||||
+ n = float(fields[5])
|
||||
+ i = float(fields[6])
|
||||
+ elif ("Linux" == platform):
|
||||
+ u = float(fields[1])
|
||||
+ s = float(fields[2])
|
||||
+ n = float(fields[3])
|
||||
+ i = float(fields[4])
|
||||
+ else:
|
||||
+ pass
|
||||
|
||||
total = ((u - self.__uT) + (s - self.__sT) + (n - self.__nT) +
|
||||
(i - self.__iT))
|
51
deskutils/gdesklets/files/patch-libdesklets::Disk.py
Normal file
51
deskutils/gdesklets/files/patch-libdesklets::Disk.py
Normal file
@ -0,0 +1,51 @@
|
||||
# Many thanks to Alexander Leidinger <netchild@FreeBSD.org> for
|
||||
# help and create those patches.
|
||||
|
||||
--- libdesklets/Disk.py.orig Mon Sep 22 12:25:18 2003
|
||||
+++ libdesklets/Disk.py Mon Sep 22 12:28:28 2003
|
||||
@@ -3,7 +3,7 @@
|
||||
import time
|
||||
import os
|
||||
import statvfs
|
||||
-
|
||||
+import libdesklets as lib
|
||||
|
||||
class Disk:
|
||||
|
||||
@@ -19,21 +19,33 @@
|
||||
|
||||
def __poll_partitions(self):
|
||||
|
||||
+ platform = lib.sys.get_os()
|
||||
+
|
||||
# we don't have to reread the file if it hasn't changed
|
||||
- if (self.__partitions_last_read >= os.path.getmtime("/etc/mtab")):
|
||||
+ if (platform == "Linux" and self.__partitions_last_read >= os.path.getmtime("/etc/mtab")):
|
||||
return self.__partitions
|
||||
else:
|
||||
self.__partitions_last_read = time.time()
|
||||
|
||||
# /etc/mtab is more portable than /proc/mount, so we use it
|
||||
- fd = open("/etc/mtab", "r")
|
||||
+ if (platform == "Linux"):
|
||||
+ fd = open("/etc/mtab", "r")
|
||||
+ else:
|
||||
+ fd = os.popen("mount", "r")
|
||||
lines = fd.readlines()
|
||||
fd.close()
|
||||
|
||||
partitions = []
|
||||
for l in lines:
|
||||
parts = l.split()
|
||||
- device, mpoint, fstype = parts[:3]
|
||||
+ if (platform == "Linux"):
|
||||
+ device, mpoint, fstype = parts[:3]
|
||||
+ elif (platform == "FreeBSD"):
|
||||
+ device = parts[0]
|
||||
+ mpoint = parts[2]
|
||||
+ import re
|
||||
+ m = re.search('\(([a-zA-Z]+)[,)]', parts[3])
|
||||
+ fstype = m.group(0)
|
||||
# FIXME: is this OK? it might be better to check if the device
|
||||
# actually is a file in /dev
|
||||
if (fstype in ("ext2", "ext3", "msdos", "vfat", "ntfs", "hpfs"
|
122
deskutils/gdesklets/files/patch-libdesklets::Memory.py
Normal file
122
deskutils/gdesklets/files/patch-libdesklets::Memory.py
Normal file
@ -0,0 +1,122 @@
|
||||
# Many thanks to Alexander Leidinger <netchild@FreeBSD.org> for
|
||||
# help and create those patches.
|
||||
|
||||
--- libdesklets/Memory.py.orig Sun Sep 21 14:08:18 2003
|
||||
+++ libdesklets/Memory.py Thu Sep 25 12:08:35 2003
|
||||
@@ -1,7 +1,7 @@
|
||||
import polling
|
||||
|
||||
import os, stat
|
||||
-
|
||||
+import libdesklets as lib
|
||||
|
||||
class Memory:
|
||||
|
||||
@@ -17,39 +17,83 @@
|
||||
|
||||
def __poll_total_ram(self):
|
||||
|
||||
- memtotal = os.stat("/proc/kcore")[stat.ST_SIZE]
|
||||
+ platform = lib.sys.get_os()
|
||||
+
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ fd = os.popen("sysctl hw.physmem")
|
||||
+ physmem = fd.readline()
|
||||
+ fd.close()
|
||||
+ lines = physmem.splitlines()
|
||||
+ memtotal = int(lines[0].split()[1])
|
||||
+ elif ("Linux" == platform):
|
||||
+ memtotal = os.stat("/proc/kcore")[stat.ST_SIZE]
|
||||
+ else:
|
||||
+ memtotal = 0
|
||||
+
|
||||
return memtotal
|
||||
|
||||
def __poll_mem(self, mode):
|
||||
|
||||
- fd = open("/proc/meminfo", "r")
|
||||
- mem = fd.read()
|
||||
- fd.close()
|
||||
- lines = mem.splitlines()
|
||||
+ platform = lib.sys.get_os()
|
||||
|
||||
# RAM
|
||||
if (mode == 0):
|
||||
- total = int(self.__get_total_ram()/1024)
|
||||
- for l in lines:
|
||||
- if (l.startswith("MemFree:")):
|
||||
- value = l.split()
|
||||
- free = int(value[1])
|
||||
- elif (l.startswith("Cached:")):
|
||||
- value = l.split()
|
||||
- free = free + int(value[1])
|
||||
- break
|
||||
- used = total - free
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ fd = os.popen("vmstat -n 0", "r")
|
||||
+ elif ("Linux" == platform):
|
||||
+ fd = open("/proc/meminfo", "r")
|
||||
+ else:
|
||||
+ return (0, 0)
|
||||
+ mem = fd.read()
|
||||
+ fd.close()
|
||||
+ lines = mem.splitlines()
|
||||
+
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ # this may be larger than total, as this is the active virtual
|
||||
+ # memory, not the active physical memory
|
||||
+ used = int(lines[2].split()[3])/1024
|
||||
+ total = int(self.__get_total_ram()/1024)
|
||||
+ elif ("Linux" == platform):
|
||||
+ total = int(self.__get_total_ram()/1024)
|
||||
+ for l in lines:
|
||||
+ if (l.startswith("MemFree:")):
|
||||
+ value = l.split()
|
||||
+ free = int(value[1])
|
||||
+ elif (l.startswith("Cached:")):
|
||||
+ value = l.split()
|
||||
+ free = free + int(value[1])
|
||||
+ break
|
||||
+ used = total - free
|
||||
+ else:
|
||||
+ pass
|
||||
|
||||
# Swap
|
||||
elif (mode == 1):
|
||||
- for l in lines:
|
||||
- if (l.startswith("SwapTotal:")):
|
||||
- value = l.split()
|
||||
- total = int(value[1])
|
||||
- elif (l.startswith("SwapFree:")):
|
||||
- value = l.split()
|
||||
- free = int(value[1])
|
||||
- break
|
||||
- used = total - free
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ fd = os.popen("pstat -T", "r")
|
||||
+ elif ("Linux" == platform):
|
||||
+ fd = open("/proc/meminfo", "r")
|
||||
+ else:
|
||||
+ return (0, 0)
|
||||
+ mem = fd.read()
|
||||
+ fd.close()
|
||||
+ lines = mem.splitlines()
|
||||
+
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ used, total = lines[1].split()[0].split("/")
|
||||
+ used = int(used[0:-2]) * 1024 * 1024
|
||||
+ total = int(total[0:-2]) * 1024 * 1024
|
||||
+ elif ("Linux" == platform):
|
||||
+ for l in lines:
|
||||
+ if (l.startswith("SwapTotal:")):
|
||||
+ value = l.split()
|
||||
+ total = int(value[1])
|
||||
+ elif (l.startswith("SwapFree:")):
|
||||
+ value = l.split()
|
||||
+ free = int(value[1])
|
||||
+ break
|
||||
+ used = total - free
|
||||
+ else:
|
||||
+ pass
|
||||
|
||||
return (total, used)
|
149
deskutils/gdesklets/files/patch-libdesklets::Network.py
Normal file
149
deskutils/gdesklets/files/patch-libdesklets::Network.py
Normal file
@ -0,0 +1,149 @@
|
||||
# Many thanks to Alexander Leidinger <netchild@FreeBSD.org> for
|
||||
# help and create those patches.
|
||||
|
||||
--- libdesklets/Network.py.orig Mon Sep 22 12:51:42 2003
|
||||
+++ libdesklets/Network.py Mon Sep 22 13:04:06 2003
|
||||
@@ -1,7 +1,9 @@
|
||||
import polling
|
||||
|
||||
import commands
|
||||
+import os
|
||||
import time
|
||||
+import libdesklets as lib
|
||||
|
||||
class Network:
|
||||
|
||||
@@ -25,22 +27,42 @@
|
||||
|
||||
def __poll_devices(self):
|
||||
|
||||
- fd = open("/proc/net/dev", "r")
|
||||
+ platform = lib.sys.get_os()
|
||||
+
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ fd = os.popen("ifconfig -a | grep mtu", "r")
|
||||
+ elif ("Linux" == platform):
|
||||
+ fd = open("/proc/net/dev", "r")
|
||||
+ else:
|
||||
+ return []
|
||||
data = fd.readlines()
|
||||
fd.close()
|
||||
|
||||
devices = []
|
||||
- for lines in data[2:]:
|
||||
- l = lines.strip()
|
||||
- l = l.replace(":", " ")
|
||||
- fields = l.split()
|
||||
|
||||
- if (fields[0] == "lo"):
|
||||
- continue
|
||||
- else: # (fields[0].startswith("eth")):
|
||||
- device = fields[0]
|
||||
- devices.append(device)
|
||||
- #end for
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ for lines in data:
|
||||
+ fields = lines.strip().strip(":")
|
||||
+
|
||||
+ if (fields[0] == "lo"):
|
||||
+ continue
|
||||
+ else:
|
||||
+ device = fields[0]
|
||||
+ devices.append(device)
|
||||
+ elif ("Linux" == platform):
|
||||
+ for lines in data[2:]:
|
||||
+ l = lines.strip()
|
||||
+ l = l.replace(":", " ")
|
||||
+ fields = l.split()
|
||||
+
|
||||
+ if (fields[0] == "lo"):
|
||||
+ continue
|
||||
+ else: # (fields[0].startswith("eth")):
|
||||
+ device = fields[0]
|
||||
+ devices.append(device)
|
||||
+ #end for
|
||||
+ else:
|
||||
+ pass
|
||||
|
||||
return devices
|
||||
|
||||
@@ -48,13 +70,15 @@
|
||||
|
||||
def __poll_ipaddr(self, dev):
|
||||
|
||||
- data = commands.getoutput("/sbin/ifconfig " + dev)
|
||||
- lines = data.splitlines()
|
||||
- for l in lines:
|
||||
+ fd = os.popen("/sbin/ifconfig " + dev, "r")
|
||||
+ data = fd.readlines()
|
||||
+ fd.close()
|
||||
+ for l in data:
|
||||
l = l.strip()
|
||||
fields = l.split()
|
||||
|
||||
- if (fields[0] == "inet"): return fields[1].split(":")[1]
|
||||
+ if (fields[0] == "inet"):
|
||||
+ return fields[1]
|
||||
#end for
|
||||
|
||||
#fd = open("/proc/net/rt_cache", "r")
|
||||
@@ -78,6 +102,8 @@
|
||||
|
||||
def __poll_in_out(self, dev):
|
||||
|
||||
+ platform = lib.sys.get_os()
|
||||
+
|
||||
t = time.time()
|
||||
interval = t - self.__time
|
||||
self.__time = t
|
||||
@@ -88,24 +114,40 @@
|
||||
speed_in = 0
|
||||
speed_out = 0
|
||||
|
||||
- fd = open("/proc/net/dev", "r")
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ fd = os.popen("netstat -b -I " + dev + " | grep Link", "r")
|
||||
+ elif ("Linux" == platform):
|
||||
+ fd = open("/proc/net/dev", "r")
|
||||
+ else:
|
||||
+ return (bytes_in, bytes_out, pack_in, pack_out, speed_in, speed_out)
|
||||
data = fd.read()
|
||||
fd.close()
|
||||
lines = data.splitlines()
|
||||
|
||||
# look for the device
|
||||
found = 0
|
||||
- for l in lines:
|
||||
- l.strip()
|
||||
- l = l.replace(":", " ")
|
||||
- fields = l.split()
|
||||
- if (fields[0] == dev):
|
||||
- bytes_in, pack_in, bytes_out, pack_out = \
|
||||
- long(fields[1]), long(fields[2]), \
|
||||
- long(fields[9]), long(fields[10])
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ for l in lines:
|
||||
found = 1
|
||||
+ fields = l.strip().split()
|
||||
+ bytes_in, pack_in, bytes_out, pack_out = \
|
||||
+ long(fields[6]), long(fields[4]), \
|
||||
+ long(fields[9]), long(fields[7])
|
||||
break
|
||||
- #end for
|
||||
+ elif ("Linux" == platform):
|
||||
+ for l in lines:
|
||||
+ l.strip()
|
||||
+ l = l.replace(":", " ")
|
||||
+ fields = l.split()
|
||||
+ if (fields[0] == dev):
|
||||
+ bytes_in, pack_in, bytes_out, pack_out = \
|
||||
+ long(fields[1]), long(fields[2]), \
|
||||
+ long(fields[9]), long(fields[10])
|
||||
+ found = 1
|
||||
+ break
|
||||
+ #end for
|
||||
+ else:
|
||||
+ pass
|
||||
|
||||
# warn if we didn't find the device
|
||||
if (not found): print ("WARNING:: Device %(dev)s not found!") % vars()
|
114
deskutils/gdesklets/files/patch-libdesklets::Sys.py
Normal file
114
deskutils/gdesklets/files/patch-libdesklets::Sys.py
Normal file
@ -0,0 +1,114 @@
|
||||
# Many thanks to Alexander Leidinger <netchild@FreeBSD.org> for
|
||||
# help and create those patches.
|
||||
|
||||
--- libdesklets/Sys.py.orig Mon Sep 22 13:06:41 2003
|
||||
+++ libdesklets/Sys.py Mon Sep 22 13:13:11 2003
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
import commands
|
||||
import time
|
||||
-
|
||||
+import os
|
||||
+import libdesklets as lib
|
||||
|
||||
class Sys:
|
||||
|
||||
@@ -31,17 +32,25 @@
|
||||
|
||||
def __poll_os(self):
|
||||
|
||||
- os = commands.getoutput("uname -o")
|
||||
- return os
|
||||
+ platform = commands.getoutput("uname -s")
|
||||
+ return platform
|
||||
|
||||
|
||||
def __poll_uptime(self, mode):
|
||||
|
||||
- fd = open("/proc/uptime", "r")
|
||||
- data = fd.readlines()
|
||||
- fd.close()
|
||||
-
|
||||
- uptime, idletime = data[0].split()
|
||||
+ platform = lib.sys.get_os()
|
||||
+
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ bt = commands.getoutput("sysctl kern.boottime")
|
||||
+ boottime = int(bt.strip().split()[4].strip(","))
|
||||
+ uptime = int(time.time() - float(boottime))
|
||||
+ idletime = 0
|
||||
+ elif ("Linux" == platform):
|
||||
+ fd = open("/proc/uptime", "r")
|
||||
+ data = fd.readlines()
|
||||
+ fd.close()
|
||||
+ uptime, idletime = data[0].split()
|
||||
+ boottime = int(time.time() - float(uptime))
|
||||
|
||||
# uptime
|
||||
if (mode == 0):
|
||||
@@ -51,16 +60,32 @@
|
||||
return int(float(idletime))
|
||||
# sys start
|
||||
elif (mode == 2):
|
||||
- now = time.time()
|
||||
- return int(now - float(uptime))
|
||||
+ return boottime
|
||||
|
||||
|
||||
def __poll_load_avg(self, mode):
|
||||
|
||||
- fd = open("/proc/loadavg", "r")
|
||||
+ import re
|
||||
+ platform = lib.sys.get_os()
|
||||
+
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ fd = os.popen("uptime")
|
||||
+ elif ("Linux" == platform):
|
||||
+ fd = open("/proc/loadavg", "r")
|
||||
+ else:
|
||||
+ return float(0.0)
|
||||
data = fd.readlines()
|
||||
fd.close()
|
||||
- load1, load5, load15, t, d = data[0].split()
|
||||
+
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ m = re.search('load averages: ([0-9]\.[0-9]+), ([0-9]\.[0-9]+), ([0-9]\.[0-9]+)', data[0])
|
||||
+ load1 = m.group(1)
|
||||
+ load5 = m.group(2)
|
||||
+ load15 = m.group(3)
|
||||
+ elif ("Linux" == platform):
|
||||
+ load1, load5, load15, t, d = data[0].split()
|
||||
+ else:
|
||||
+ pass
|
||||
|
||||
# avg over 1 minute
|
||||
if (mode == 0):
|
||||
@@ -76,11 +101,25 @@
|
||||
|
||||
def __poll_tasks(self):
|
||||
|
||||
- fd = open("/proc/loadavg", "r")
|
||||
+ platform = lib.sys.get_os()
|
||||
+
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ fd = os.popen("vmstat -n 0")
|
||||
+ elif ("Linux" == platform):
|
||||
+ fd = open("/proc/loadavg", "r")
|
||||
+ else:
|
||||
+ return (int(0), int(0))
|
||||
data = fd.readlines()
|
||||
fd.close()
|
||||
|
||||
- parts = data[0].split()
|
||||
- running, tasks = parts[3].split("/")
|
||||
+ if ("FreeBSD" == platform):
|
||||
+ parts = data[2].split()
|
||||
+ running = parts[0]
|
||||
+ tasks = parts[0] + parts[1] + parts[2]
|
||||
+ elif ("Linux" == platform):
|
||||
+ parts = data[0].split()
|
||||
+ running, tasks = parts[3].split("/")
|
||||
+ else:
|
||||
+ pass
|
||||
|
||||
return (int(tasks), int(running))
|
17
deskutils/gdesklets/files/patch-libdesklets::__init__.py
Normal file
17
deskutils/gdesklets/files/patch-libdesklets::__init__.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Many thanks to Alexander Leidinger <netchild@FreeBSD.org> for
|
||||
# help and create those patches.
|
||||
|
||||
--- libdesklets/__init__.py.orig Mon Sep 22 13:15:25 2003
|
||||
+++ libdesklets/__init__.py Mon Sep 22 13:15:30 2003
|
||||
@@ -52,10 +52,10 @@
|
||||
from Sys import Sys
|
||||
|
||||
|
||||
+sys = Sys()
|
||||
convert = Convert()
|
||||
cpu = CPU()
|
||||
disk = Disk()
|
||||
memory = Memory()
|
||||
net = Network()
|
||||
-sys = Sys()
|
||||
print "INIT libdesklets (should happen only once)"
|
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$2" = "POST-INSTALL" ]; then
|
||||
mkdir -p ${PKG_PREFIX}/share/gnome/gdesklets/Sensors
|
||||
mkdir -p ${PKG_PREFIX}/share/gnome/gdesklets/Displays
|
||||
fi
|
||||
|
@ -1,7 +1,12 @@
|
||||
##
|
||||
At the moment, there are no gDesklets applets in the ports tree but I (and
|
||||
others) will add them in future. Then, I will add the nice menu select in
|
||||
here to allow you choose which applets want. So, for now please visit to
|
||||
http://gdesklets.gnomedesktop.org/ and collect the applets. Install them by
|
||||
yourself, the manual should be come in the tarballs.
|
||||
In the future there will be a meta port of desklets to allow to choose
|
||||
which desklets to install. It will probably be named
|
||||
"gdesklets-desklets".
|
||||
|
||||
There are only few desklets in the ports tree at the moment. To help porting
|
||||
more desklets please visit http://gdesklets.gnomedesktop.org/ and port
|
||||
some desklets. Those ports should have a PKGNAMEPREFIX of "gdesklets-".
|
||||
If the port only provides a sensor or a display the name should have a
|
||||
-sensor or -display appended, so it would be e.g.
|
||||
"gdesklets-<name>-sensor".
|
||||
##
|
||||
|
@ -2,6 +2,8 @@ bin/gdesklets
|
||||
libdata/pkgconfig/gdesklets-core.pc
|
||||
share/gnome/application-registry/gdesklets.applications
|
||||
share/gnome/applications/gdesklets.desktop
|
||||
share/gnome/gdesklets/Sensors/External/__init__.py
|
||||
share/gnome/gdesklets/Sensors/FontSelector/__init__.py
|
||||
share/gnome/gdesklets/config/ConfigManager.py
|
||||
share/gnome/gdesklets/config/GConfBackend.py
|
||||
share/gnome/gdesklets/config/__init__.py
|
||||
@ -18,10 +20,13 @@ share/gnome/gdesklets/display/TargetAlignment.py
|
||||
share/gnome/gdesklets/display/TargetArray.py
|
||||
share/gnome/gdesklets/display/TargetBonoboControl.py
|
||||
share/gnome/gdesklets/display/TargetCanvas.py
|
||||
share/gnome/gdesklets/display/TargetFrame.py
|
||||
share/gnome/gdesklets/display/TargetGauge.py
|
||||
share/gnome/gdesklets/display/TargetGroup.py
|
||||
share/gnome/gdesklets/display/TargetHTML.py
|
||||
share/gnome/gdesklets/display/TargetImage.py
|
||||
share/gnome/gdesklets/display/TargetLabel.py
|
||||
share/gnome/gdesklets/display/TargetPlotter.py
|
||||
share/gnome/gdesklets/display/TargetPopup.py
|
||||
share/gnome/gdesklets/display/__init__.py
|
||||
share/gnome/gdesklets/display/layouters.py
|
||||
@ -30,6 +35,14 @@ share/gnome/gdesklets/factory/DisplayFactory.py
|
||||
share/gnome/gdesklets/factory/SensorFactory.py
|
||||
share/gnome/gdesklets/factory/__init__.py
|
||||
share/gnome/gdesklets/gdesklets
|
||||
share/gnome/gdesklets/libdesklets/CPU.py
|
||||
share/gnome/gdesklets/libdesklets/Convert.py
|
||||
share/gnome/gdesklets/libdesklets/Disk.py
|
||||
share/gnome/gdesklets/libdesklets/Memory.py
|
||||
share/gnome/gdesklets/libdesklets/Network.py
|
||||
share/gnome/gdesklets/libdesklets/Sys.py
|
||||
share/gnome/gdesklets/libdesklets/__init__.py
|
||||
share/gnome/gdesklets/libdesklets/polling.py
|
||||
share/gnome/gdesklets/locale/ar/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/de/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/es/LC_MESSAGES/gdesklets.mo
|
||||
@ -37,32 +50,53 @@ share/gnome/gdesklets/locale/fr/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/he/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/nl/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/pl/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/pt/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/sq/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/sr/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/sr@Latn/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/sv/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/locale/tr/LC_MESSAGES/gdesklets.mo
|
||||
share/gnome/gdesklets/main/CmdLineParser.py
|
||||
share/gnome/gdesklets/main/Starter.py
|
||||
share/gnome/gdesklets/main/__init__.py
|
||||
share/gnome/gdesklets/main/add_display.py
|
||||
share/gnome/gdesklets/main/admin.py
|
||||
share/gnome/gdesklets/sensor/DefaultSensor.py
|
||||
share/gnome/gdesklets/sensor/Menu.py
|
||||
share/gnome/gdesklets/sensor/Sensor.py
|
||||
share/gnome/gdesklets/sensor/SensorConfigurator.py
|
||||
share/gnome/gdesklets/sensor/__init__.py
|
||||
share/gnome/gdesklets/utils/FileWatcher.py
|
||||
share/gnome/gdesklets/utils/GConfWatcher.py
|
||||
share/gnome/gdesklets/utils/Hash2D.py
|
||||
share/gnome/gdesklets/utils/Observable.py
|
||||
share/gnome/gdesklets/utils/TargetSettings.py
|
||||
share/gnome/gdesklets/utils/TypeConverter.py
|
||||
share/gnome/gdesklets/utils/__init__.py
|
||||
share/gnome/gdesklets/utils/_ewmhmodule.so
|
||||
share/gnome/gdesklets/utils/datatypes.py
|
||||
share/gnome/gdesklets/utils/dialog.py
|
||||
share/gnome/gdesklets/utils/i18n.py
|
||||
share/gnome/gdesklets/utils/pwstore.py
|
||||
share/gnome/gdesklets/utils/singleton.py
|
||||
share/gnome/icons/gnome/48x48/mimetypes/x-gdesklets-display.png
|
||||
share/gnome/mime-info/gdesklets.keys
|
||||
share/gnome/mime-info/gdesklets.mime
|
||||
share/gnome/pixmaps/gdesklets.png
|
||||
share/icons/gnome/48x48/mimetypes/x-gdesklets-display.png
|
||||
@dirrm share/gnome/gdesklets/utils
|
||||
@dirrm share/gnome/gdesklets/sensor
|
||||
@dirrm share/gnome/gdesklets/main
|
||||
@dirrm share/gnome/gdesklets/locale/tr/LC_MESSAGES
|
||||
@dirrm share/gnome/gdesklets/locale/tr
|
||||
@dirrm share/gnome/gdesklets/locale/sv/LC_MESSAGES
|
||||
@dirrm share/gnome/gdesklets/locale/sv
|
||||
@dirrm share/gnome/gdesklets/locale/sr@Latn/LC_MESSAGES
|
||||
@dirrm share/gnome/gdesklets/locale/sr@Latn
|
||||
@dirrm share/gnome/gdesklets/locale/sr/LC_MESSAGES
|
||||
@dirrm share/gnome/gdesklets/locale/sr
|
||||
@dirrm share/gnome/gdesklets/locale/sq/LC_MESSAGES
|
||||
@dirrm share/gnome/gdesklets/locale/sq
|
||||
@dirrm share/gnome/gdesklets/locale/pt/LC_MESSAGES
|
||||
@dirrm share/gnome/gdesklets/locale/pt
|
||||
@dirrm share/gnome/gdesklets/locale/pl/LC_MESSAGES
|
||||
@dirrm share/gnome/gdesklets/locale/pl
|
||||
@dirrm share/gnome/gdesklets/locale/nl/LC_MESSAGES
|
||||
@ -78,11 +112,14 @@ share/gnome/pixmaps/gdesklets.png
|
||||
@dirrm share/gnome/gdesklets/locale/ar/LC_MESSAGES
|
||||
@dirrm share/gnome/gdesklets/locale/ar
|
||||
@dirrm share/gnome/gdesklets/locale
|
||||
@dirrm share/gnome/gdesklets/libdesklets
|
||||
@dirrm share/gnome/gdesklets/factory
|
||||
@dirrm share/gnome/gdesklets/display
|
||||
@dirrm share/gnome/gdesklets/desktop
|
||||
@dirrm share/gnome/gdesklets/data
|
||||
@dirrm share/gnome/gdesklets/config
|
||||
@dirrm share/gnome/gdesklets/Sensors/FontSelector
|
||||
@dirrm share/gnome/gdesklets/Sensors/External
|
||||
@dirrm share/gnome/gdesklets/Sensors
|
||||
@dirrm share/gnome/gdesklets/Displays
|
||||
@dirrm share/gnome/gdesklets
|
||||
|
Loading…
Reference in New Issue
Block a user