Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv32568/src/plugins

Modified Files:
        df.py 
Log Message:
moved freespace and totalspace from df.py to util.py

Index: df.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/df.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** df.py       28 May 2003 17:51:28 -0000      1.1
--- df.py       28 May 2003 17:58:48 -0000      1.2
***************
*** 11,14 ****
--- 11,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.2  2003/05/28 17:58:48  dischi
+ # moved freespace and totalspace from df.py to util.py
+ #
  # Revision 1.1  2003/05/28 17:51:28  dischi
  # added df item plugin for directories from den_RDC
***************
*** 38,46 ****
  
  
- import os
- import sys
- import config
- import statvfs
  import plugin
  
  class PluginInterface(plugin.ItemPlugin):
--- 41,46 ----
  
  
  import plugin
+ import util
  
  class PluginInterface(plugin.ItemPlugin):
***************
*** 52,57 ****
          if item.type == 'dir':
              diskfree = '%i of %i Mb free'  % \
!                        ( (( self.freespace(item.dir) / 1024) / 1024),
!                          ((self.totalspace(item.dir) /1024) /1024))
              return  [ ( self.dud, diskfree) ]
          else:
--- 52,57 ----
          if item.type == 'dir':
              diskfree = '%i of %i Mb free'  % \
!                        ( (( util.freespace(item.dir) / 1024) / 1024),
!                          ((util.totalspace(item.dir) /1024) /1024))
              return  [ ( self.dud, diskfree) ]
          else:
***************
*** 59,77 ****
              return []
  
!     def freespace(self, path):
!         """ freespace(path) -> integer
!         Return the number of bytes available to the user on the file system
!         pointed to by path."""
!         s = os.statvfs(path)
!         return s[statvfs.F_BAVAIL] * long(s[statvfs.F_BSIZE])
!         
!         
!     def totalspace(self, path):
!         """ totalspace(path) -> integer
!         Return the number of total bytes available on the file system
!         pointed to by path."""
!         s = os.statvfs(path)
!         return s[statvfs.F_BLOCKS] * long(s[statvfs.F_BSIZE])
!         
      def dud(self, arg=None, menuw=None):
          pass
--- 59,63 ----
              return []
  
! 
      def dud(self, arg=None, menuw=None):
          pass




-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to