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

Source Code for Module libxyz.vfs.types

  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.utils import ustring 
 18   
19 -class VFSTypeBase(object):
20 """ 21 VFS type parent class 22 """ 23
24 - def __unicode__(self):
25 return ustring(str(self))
26 27 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28
29 - def __repr__(self):
30 return self.__str__()
31 32 #++++++++++++++++++++++++++++++++++++++++++++++++ 33
34 -class VFSTypeFile(VFSTypeBase):
35 """ 36 Regular file type 37 """ 38 39 str_type = "-" 40 vtype = " " 41
42 - def __str__(self):
43 return "<Regular file type>"
44 45 #++++++++++++++++++++++++++++++++++++++++++++++++ 46
47 -class VFSTypeBlock(VFSTypeBase):
48 """ 49 Block device type 50 """ 51 52 str_type = "b" 53 vtype = "+" 54 55 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56
57 - def __str__(self):
58 return "<Block device type>"
59 60 #++++++++++++++++++++++++++++++++++++++++++++++++ 61
62 -class VFSTypeChar(VFSTypeBase):
63 """ 64 Character device type 65 """ 66 67 str_type = "c" 68 vtype = "-" 69 70 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71
72 - def __str__(self):
73 return "<Char device type>"
74 75 #++++++++++++++++++++++++++++++++++++++++++++++++ 76
77 -class VFSTypeDir(VFSTypeBase):
78 """ 79 Directory type 80 """ 81 82 str_type = "d" 83 vtype = "/" 84 85 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86
87 - def __str__(self):
88 return "<Directory type>"
89 90 #++++++++++++++++++++++++++++++++++++++++++++++++ 91 104 105 #++++++++++++++++++++++++++++++++++++++++++++++++ 106
107 -class VFSTypeFifo(VFSTypeBase):
108 """ 109 FIFO type 110 """ 111 112 str_type = "p" 113 vtype = "|" 114 115 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 116
117 - def __str__(self):
118 return "<FIFO type>"
119 120 #++++++++++++++++++++++++++++++++++++++++++++++++ 121
122 -class VFSTypeSocket(VFSTypeBase):
123 """ 124 Socket type 125 """ 126 127 str_type = "s" 128 vtype = "=" 129 130 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 131
132 - def __str__(self):
133 return "<Socket type>"
134 135 #++++++++++++++++++++++++++++++++++++++++++++++++ 136
137 -class VFSTypeUnknown(VFSTypeBase):
138 """ 139 Unknown type 140 """ 141 142 str_type = "?" 143 144 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145
146 - def __str__(self):
147 return "<Unknown file type>"
148