-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathsftp_statvfs.pyx
More file actions
78 lines (61 loc) · 2.34 KB
/
sftp_statvfs.pyx
File metadata and controls
78 lines (61 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This file is part of ssh-python.
# Copyright (C) 2018 Panos Kittenis
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, version 2.1.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130
from .sftp cimport SFTP
from . cimport c_sftp
cdef class SFTPStatVFS:
def __dealloc__(self):
if self._stats is not NULL:
c_sftp.sftp_statvfs_free(self._stats)
self._stats = NULL
@staticmethod
cdef SFTPStatVFS from_ptr(c_sftp.sftp_statvfs_t stats, SFTP sftp):
cdef SFTPStatVFS _vfs = SFTPStatVFS.__new__(SFTPStatVFS)
_vfs._stats = stats
_vfs.sftp = sftp
return _vfs
@property
def f_bsize(self):
return self._stats.f_bsize if self._stats is not NULL else None
@property
def f_frsize(self):
return self._stats.f_frsize if self._stats is not NULL else None
@property
def f_blocks(self):
return self._stats.f_blocks if self._stats is not NULL else None
@property
def f_bfree(self):
return self._stats.f_bfree if self._stats is not NULL else None
@property
def f_bavail(self):
return self._stats.f_bavail if self._stats is not NULL else None
@property
def f_files(self):
return self._stats.f_files if self._stats is not NULL else None
@property
def f_ffree(self):
return self._stats.f_ffree if self._stats is not NULL else None
@property
def f_favail(self):
return self._stats.f_favail if self._stats is not NULL else None
@property
def f_fsid(self):
return self._stats.f_fsid if self._stats is not NULL else None
@property
def f_flag(self):
return self._stats.f_flag if self._stats is not NULL else None
@property
def f_namemax(self):
return self._stats.f_namemax if self._stats is not NULL else None