Package libxyz :: Package vfs :: Module vfsobj
[hide private]
[frames] | no frames]

Source Code for Module libxyz.vfs.vfsobj

  1  #-*- coding: utf8 -* 
  2  # 
  3  # Max E. Kuznecov ~syhpoon <syhpoon@syhpoon.name> 2008 
  4  # 
  5  # This file is part of XYZCommander. 
  6  # XYZCommander is free software: you can redistribute it and/or modify 
  7  # it under the terms of the GNU Lesser Public License as published by 
  8  # the Free Software Foundation, either version 3 of the License, or 
  9  # (at your option) any later version. 
 10  # XYZCommander is distributed in the hope that it will be useful, 
 11  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
 13  # GNU Lesser Public License for more details. 
 14  # You should have received a copy of the GNU Lesser Public License 
 15  # along with XYZCommander. If not, see <http://www.gnu.org/licenses/>. 
 16   
 17  from libxyz.core import utils 
 18   
 19  import os.path 
 20   
21 -class VFSObject(object):
22 """ 23 Abstract interface for VFS objects 24 """ 25
26 - def __init__(self, path, enc=None):
27 self.enc = enc 28 self.path = utils.bstring(path, enc)
29 30 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31
32 - def walk(self):
33 """ 34 Directory tree generator 35 """ 36 37 return None
38 39 #++++++++++++++++++++++++++++++++++++++++++++++++ 40
41 -class VFSFile(object):
42 """ 43 A VFS file information interface 44 """ 45
46 - def __init__(self, path, enc=None):
47 self.enc = enc or xyzenc 48 self.path = os.path.abspath(path) 49 # File name 50 self.name = os.path.basename(utils.ustring(self.path, self.enc)) 51 52 # File type 53 self.ftype = None 54 55 # Access time 56 self.atime = None 57 58 # Modified time 59 self.mtime = None 60 61 # Changed time 62 self.ctime = None 63 64 # Size in bytes 65 self.size = None 66 67 # Owner UID 68 self.uid = None 69 70 # Group 71 self.gid = None 72 73 # Mode 74 self.mode = None 75 76 # Inode 77 self.inode = None 78 79 # Visual file type 80 self.vtype = None 81 82 # Visual file representation 83 self.visual = None 84 85 # File info 86 self.info = None 87 88 # Any type-specific data 89 self.data = None 90 91 # List of significant attributes 92 self.attributes = ()
93 94 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 95
96 - def open(self):
97 return None
98 99 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 100
101 - def close(self):
102 return None
103 104 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 105
106 - def read(self):
107 return None
108 109 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 110
111 - def write(self):
112 return None
113 114 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 115
116 - def flush(self):
117 return None
118