все целые должны быть явно 64-битные
This commit is contained in:
1 parent
a3b36b9794
commit
a5da028344
6 files changed
+324
-321
No files matched your search
+16
-16
@@ -147,22 +147,6 @@ mod.add_function('Slice_Ptr_gorrent_FileInfo_elem', retval('int64_t'), [param('i
|
||||
mod.add_function('Slice_Ptr_gorrent_FileInfo_subslice', retval('int64_t'), [param('int64_t', 'handle'), param('int', 'st'), param('int', 'ed')])
|
||||
mod.add_function('Slice_Ptr_gorrent_FileInfo_set', None, [param('int64_t', 'handle'), param('int', 'idx'), param('int64_t', 'value')])
|
||||
mod.add_function('Slice_Ptr_gorrent_FileInfo_append', None, [param('int64_t', 'handle'), param('int64_t', 'value')])
|
||||
mod.add_function('gorrent_FileInfo_CTor', retval('int64_t'), [])
|
||||
mod.add_function('gorrent_FileInfo_Length_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileInfo_Length_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
mod.add_function('gorrent_FileInfo_Path_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileInfo_Path_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
mod.add_function('gorrent_FileInfo_PathUTF8_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileInfo_PathUTF8_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
mod.add_function('gorrent_FileStatus_CTor', retval('int64_t'), [])
|
||||
mod.add_function('gorrent_FileStatus_Name_Get', retval('char*'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileStatus_Name_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
||||
mod.add_function('gorrent_FileStatus_Url_Get', retval('char*'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileStatus_Url_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
||||
mod.add_function('gorrent_FileStatus_Progress_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileStatus_Progress_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
mod.add_function('gorrent_FileStatus_Length_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileStatus_Length_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
mod.add_function('gorrent_Info_CTor', retval('int64_t'), [])
|
||||
mod.add_function('gorrent_Info_Name_Get', retval('char*'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_Info_Name_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
||||
@@ -207,6 +191,22 @@ add_checked_function(mod, 'gorrent_Engine_FileStatus', retval('int64_t'), [param
|
||||
add_checked_function(mod, 'gorrent_Engine_Stop', None, [param('int64_t', '_handle'), param('bool', 'goRun')])
|
||||
add_checked_string_function(mod, 'gorrent_Engine_GetMsg', retval('char*'), [param('int64_t', '_handle')])
|
||||
add_checked_function(mod, 'gorrent_Engine_Clean', None, [param('int64_t', '_handle'), param('bool', 'goRun')])
|
||||
mod.add_function('gorrent_FileInfo_CTor', retval('int64_t'), [])
|
||||
mod.add_function('gorrent_FileInfo_Length_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileInfo_Length_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
mod.add_function('gorrent_FileInfo_Path_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileInfo_Path_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
mod.add_function('gorrent_FileInfo_PathUTF8_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileInfo_PathUTF8_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
mod.add_function('gorrent_FileStatus_CTor', retval('int64_t'), [])
|
||||
mod.add_function('gorrent_FileStatus_Name_Get', retval('char*'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileStatus_Name_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
||||
mod.add_function('gorrent_FileStatus_Url_Get', retval('char*'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileStatus_Url_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
||||
mod.add_function('gorrent_FileStatus_Progress_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileStatus_Progress_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
mod.add_function('gorrent_FileStatus_Length_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
||||
mod.add_function('gorrent_FileStatus_Length_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
||||
add_checked_function(mod, 'gorrent_GetMetaFromFile', retval('int64_t'), [param('char*', 'path')])
|
||||
add_checked_function(mod, 'gorrent_NewSettings', retval('int64_t'), [])
|
||||
add_checked_function(mod, 'gorrent_NewEngine', retval('int64_t'), [param('int64_t', 'settings')])
|
||||
|
||||
+100
-100
@@ -1246,102 +1246,6 @@ func handleFromPtr_gorrent_TorrentStatus(p interface{}) CGoHandle {
|
||||
|
||||
// ---- Structs ---
|
||||
|
||||
// --- wrapping struct: gorrent.FileInfo ---
|
||||
//export gorrent_FileInfo_CTor
|
||||
func gorrent_FileInfo_CTor() CGoHandle {
|
||||
return CGoHandle(handleFromPtr_gorrent_FileInfo(&gorrent.FileInfo{}))
|
||||
}
|
||||
//export gorrent_FileInfo_Length_Get
|
||||
func gorrent_FileInfo_Length_Get(handle CGoHandle) C.longlong {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
return C.longlong(op.Length)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_Length_Set
|
||||
func gorrent_FileInfo_Length_Set(handle CGoHandle, val C.longlong) {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
op.Length = int64(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_Path_Get
|
||||
func gorrent_FileInfo_Path_Get(handle CGoHandle) CGoHandle {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
return handleFromPtr_Slice_string(&op.Path)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_Path_Set
|
||||
func gorrent_FileInfo_Path_Set(handle CGoHandle, val CGoHandle) {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
op.Path = deptrFromHandle_Slice_string(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_PathUTF8_Get
|
||||
func gorrent_FileInfo_PathUTF8_Get(handle CGoHandle) CGoHandle {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
return handleFromPtr_Slice_string(&op.PathUTF8)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_PathUTF8_Set
|
||||
func gorrent_FileInfo_PathUTF8_Set(handle CGoHandle, val CGoHandle) {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
op.PathUTF8 = deptrFromHandle_Slice_string(val)
|
||||
}
|
||||
|
||||
|
||||
// --- wrapping struct: gorrent.FileStatus ---
|
||||
//export gorrent_FileStatus_CTor
|
||||
func gorrent_FileStatus_CTor() CGoHandle {
|
||||
return CGoHandle(handleFromPtr_gorrent_FileStatus(&gorrent.FileStatus{}))
|
||||
}
|
||||
//export gorrent_FileStatus_Name_Get
|
||||
func gorrent_FileStatus_Name_Get(handle CGoHandle) *C.char {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
return C.CString(op.Name)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Name_Set
|
||||
func gorrent_FileStatus_Name_Set(handle CGoHandle, val *C.char) {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
op.Name = C.GoString(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Url_Get
|
||||
func gorrent_FileStatus_Url_Get(handle CGoHandle) *C.char {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
return C.CString(op.Url)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Url_Set
|
||||
func gorrent_FileStatus_Url_Set(handle CGoHandle, val *C.char) {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
op.Url = C.GoString(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Progress_Get
|
||||
func gorrent_FileStatus_Progress_Get(handle CGoHandle) C.longlong {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
return C.longlong(op.Progress)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Progress_Set
|
||||
func gorrent_FileStatus_Progress_Set(handle CGoHandle, val C.longlong) {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
op.Progress = int(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Length_Get
|
||||
func gorrent_FileStatus_Length_Get(handle CGoHandle) C.longlong {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
return C.longlong(op.Length)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Length_Set
|
||||
func gorrent_FileStatus_Length_Set(handle CGoHandle, val C.longlong) {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
op.Length = int(val)
|
||||
}
|
||||
|
||||
|
||||
// --- wrapping struct: gorrent.Info ---
|
||||
//export gorrent_Info_CTor
|
||||
func gorrent_Info_CTor() CGoHandle {
|
||||
@@ -1540,7 +1444,7 @@ func gorrent_TorrentStatus_DownloadRate_Get(handle CGoHandle) C.longlong {
|
||||
//export gorrent_TorrentStatus_DownloadRate_Set
|
||||
func gorrent_TorrentStatus_DownloadRate_Set(handle CGoHandle, val C.longlong) {
|
||||
op := ptrFromHandle_gorrent_TorrentStatus(handle)
|
||||
op.DownloadRate = int(val)
|
||||
op.DownloadRate = int64(val)
|
||||
}
|
||||
|
||||
//export gorrent_TorrentStatus_UploadRate_Get
|
||||
@@ -1552,7 +1456,7 @@ func gorrent_TorrentStatus_UploadRate_Get(handle CGoHandle) C.longlong {
|
||||
//export gorrent_TorrentStatus_UploadRate_Set
|
||||
func gorrent_TorrentStatus_UploadRate_Set(handle CGoHandle, val C.longlong) {
|
||||
op := ptrFromHandle_gorrent_TorrentStatus(handle)
|
||||
op.UploadRate = int(val)
|
||||
op.UploadRate = int64(val)
|
||||
}
|
||||
|
||||
//export gorrent_TorrentStatus_Seeds_Get
|
||||
@@ -1564,7 +1468,7 @@ func gorrent_TorrentStatus_Seeds_Get(handle CGoHandle) C.longlong {
|
||||
//export gorrent_TorrentStatus_Seeds_Set
|
||||
func gorrent_TorrentStatus_Seeds_Set(handle CGoHandle, val C.longlong) {
|
||||
op := ptrFromHandle_gorrent_TorrentStatus(handle)
|
||||
op.Seeds = int(val)
|
||||
op.Seeds = int64(val)
|
||||
}
|
||||
|
||||
|
||||
@@ -1590,7 +1494,7 @@ func gorrent_Engine_StartTorrent(_handle CGoHandle, idx C.longlong) *C.char {
|
||||
if __err != nil {
|
||||
return C.CString("")
|
||||
}
|
||||
__err = gopyh.Embed(vifc, reflect.TypeOf(gorrent.Engine{})).(*gorrent.Engine).StartTorrent(int(idx))
|
||||
__err = gopyh.Embed(vifc, reflect.TypeOf(gorrent.Engine{})).(*gorrent.Engine).StartTorrent(int64(idx))
|
||||
|
||||
if __err != nil {
|
||||
estr := C.CString(__err.Error())
|
||||
@@ -1664,6 +1568,102 @@ func gorrent_Engine_Clean(_handle CGoHandle, goRun C.char) {
|
||||
}
|
||||
}
|
||||
|
||||
// --- wrapping struct: gorrent.FileInfo ---
|
||||
//export gorrent_FileInfo_CTor
|
||||
func gorrent_FileInfo_CTor() CGoHandle {
|
||||
return CGoHandle(handleFromPtr_gorrent_FileInfo(&gorrent.FileInfo{}))
|
||||
}
|
||||
//export gorrent_FileInfo_Length_Get
|
||||
func gorrent_FileInfo_Length_Get(handle CGoHandle) C.longlong {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
return C.longlong(op.Length)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_Length_Set
|
||||
func gorrent_FileInfo_Length_Set(handle CGoHandle, val C.longlong) {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
op.Length = int64(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_Path_Get
|
||||
func gorrent_FileInfo_Path_Get(handle CGoHandle) CGoHandle {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
return handleFromPtr_Slice_string(&op.Path)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_Path_Set
|
||||
func gorrent_FileInfo_Path_Set(handle CGoHandle, val CGoHandle) {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
op.Path = deptrFromHandle_Slice_string(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_PathUTF8_Get
|
||||
func gorrent_FileInfo_PathUTF8_Get(handle CGoHandle) CGoHandle {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
return handleFromPtr_Slice_string(&op.PathUTF8)
|
||||
}
|
||||
|
||||
//export gorrent_FileInfo_PathUTF8_Set
|
||||
func gorrent_FileInfo_PathUTF8_Set(handle CGoHandle, val CGoHandle) {
|
||||
op := ptrFromHandle_gorrent_FileInfo(handle)
|
||||
op.PathUTF8 = deptrFromHandle_Slice_string(val)
|
||||
}
|
||||
|
||||
|
||||
// --- wrapping struct: gorrent.FileStatus ---
|
||||
//export gorrent_FileStatus_CTor
|
||||
func gorrent_FileStatus_CTor() CGoHandle {
|
||||
return CGoHandle(handleFromPtr_gorrent_FileStatus(&gorrent.FileStatus{}))
|
||||
}
|
||||
//export gorrent_FileStatus_Name_Get
|
||||
func gorrent_FileStatus_Name_Get(handle CGoHandle) *C.char {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
return C.CString(op.Name)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Name_Set
|
||||
func gorrent_FileStatus_Name_Set(handle CGoHandle, val *C.char) {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
op.Name = C.GoString(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Url_Get
|
||||
func gorrent_FileStatus_Url_Get(handle CGoHandle) *C.char {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
return C.CString(op.Url)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Url_Set
|
||||
func gorrent_FileStatus_Url_Set(handle CGoHandle, val *C.char) {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
op.Url = C.GoString(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Progress_Get
|
||||
func gorrent_FileStatus_Progress_Get(handle CGoHandle) C.longlong {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
return C.longlong(op.Progress)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Progress_Set
|
||||
func gorrent_FileStatus_Progress_Set(handle CGoHandle, val C.longlong) {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
op.Progress = int64(val)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Length_Get
|
||||
func gorrent_FileStatus_Length_Get(handle CGoHandle) C.longlong {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
return C.longlong(op.Length)
|
||||
}
|
||||
|
||||
//export gorrent_FileStatus_Length_Set
|
||||
func gorrent_FileStatus_Length_Set(handle CGoHandle, val C.longlong) {
|
||||
op := ptrFromHandle_gorrent_FileStatus(handle)
|
||||
op.Length = int64(val)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---- Slices ---
|
||||
|
||||
|
||||
+174
-174
@@ -127,179 +127,6 @@ class Slice_Ptr_gorrent_FileInfo(go.GoClass):
|
||||
|
||||
# ---- Structs ---
|
||||
|
||||
# Python type for struct gorrent.FileInfo
|
||||
class FileInfo(go.GoClass):
|
||||
""""""
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
handle=A Go-side object is always initialized with an explicit handle=arg
|
||||
otherwise parameters can be unnamed in order of field names or named fields
|
||||
in which case a new Go object is constructed first
|
||||
"""
|
||||
if len(kwargs) == 1 and 'handle' in kwargs:
|
||||
self.handle = kwargs['handle']
|
||||
_gorrent.IncRef(self.handle)
|
||||
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
||||
self.handle = args[0].handle
|
||||
_gorrent.IncRef(self.handle)
|
||||
else:
|
||||
self.handle = _gorrent.gorrent_FileInfo_CTor()
|
||||
_gorrent.IncRef(self.handle)
|
||||
if 0 < len(args):
|
||||
self.Length = args[0]
|
||||
if "Length" in kwargs:
|
||||
self.Length = kwargs["Length"]
|
||||
if 1 < len(args):
|
||||
self.Path = args[1]
|
||||
if "Path" in kwargs:
|
||||
self.Path = kwargs["Path"]
|
||||
if 2 < len(args):
|
||||
self.PathUTF8 = args[2]
|
||||
if "PathUTF8" in kwargs:
|
||||
self.PathUTF8 = kwargs["PathUTF8"]
|
||||
def __del__(self):
|
||||
_gorrent.DecRef(self.handle)
|
||||
def __str__(self):
|
||||
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
||||
sv = 'gorrent.FileInfo{'
|
||||
first = True
|
||||
for v in pr:
|
||||
if callable(v[1]):
|
||||
continue
|
||||
if first:
|
||||
first = False
|
||||
else:
|
||||
sv += ', '
|
||||
sv += v[0] + '=' + str(v[1])
|
||||
return sv + '}'
|
||||
def __repr__(self):
|
||||
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
||||
sv = 'gorrent.FileInfo ( '
|
||||
for v in pr:
|
||||
if not callable(v[1]):
|
||||
sv += v[0] + '=' + str(v[1]) + ', '
|
||||
return sv + ')'
|
||||
@property
|
||||
def Length(self):
|
||||
return _gorrent.gorrent_FileInfo_Length_Get(self.handle)
|
||||
@Length.setter
|
||||
def Length(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileInfo_Length_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileInfo_Length_Set(self.handle, value)
|
||||
@property
|
||||
def Path(self):
|
||||
return go.Slice_string(handle=_gorrent.gorrent_FileInfo_Path_Get(self.handle))
|
||||
@Path.setter
|
||||
def Path(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileInfo_Path_Set(self.handle, value.handle)
|
||||
else:
|
||||
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
||||
@property
|
||||
def PathUTF8(self):
|
||||
return go.Slice_string(handle=_gorrent.gorrent_FileInfo_PathUTF8_Get(self.handle))
|
||||
@PathUTF8.setter
|
||||
def PathUTF8(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileInfo_PathUTF8_Set(self.handle, value.handle)
|
||||
else:
|
||||
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
||||
|
||||
# Python type for struct gorrent.FileStatus
|
||||
class FileStatus(go.GoClass):
|
||||
""""""
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
handle=A Go-side object is always initialized with an explicit handle=arg
|
||||
otherwise parameters can be unnamed in order of field names or named fields
|
||||
in which case a new Go object is constructed first
|
||||
"""
|
||||
if len(kwargs) == 1 and 'handle' in kwargs:
|
||||
self.handle = kwargs['handle']
|
||||
_gorrent.IncRef(self.handle)
|
||||
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
||||
self.handle = args[0].handle
|
||||
_gorrent.IncRef(self.handle)
|
||||
else:
|
||||
self.handle = _gorrent.gorrent_FileStatus_CTor()
|
||||
_gorrent.IncRef(self.handle)
|
||||
if 0 < len(args):
|
||||
self.Name = args[0]
|
||||
if "Name" in kwargs:
|
||||
self.Name = kwargs["Name"]
|
||||
if 1 < len(args):
|
||||
self.Url = args[1]
|
||||
if "Url" in kwargs:
|
||||
self.Url = kwargs["Url"]
|
||||
if 2 < len(args):
|
||||
self.Progress = args[2]
|
||||
if "Progress" in kwargs:
|
||||
self.Progress = kwargs["Progress"]
|
||||
if 3 < len(args):
|
||||
self.Length = args[3]
|
||||
if "Length" in kwargs:
|
||||
self.Length = kwargs["Length"]
|
||||
def __del__(self):
|
||||
_gorrent.DecRef(self.handle)
|
||||
def __str__(self):
|
||||
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
||||
sv = 'gorrent.FileStatus{'
|
||||
first = True
|
||||
for v in pr:
|
||||
if callable(v[1]):
|
||||
continue
|
||||
if first:
|
||||
first = False
|
||||
else:
|
||||
sv += ', '
|
||||
sv += v[0] + '=' + str(v[1])
|
||||
return sv + '}'
|
||||
def __repr__(self):
|
||||
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
||||
sv = 'gorrent.FileStatus ( '
|
||||
for v in pr:
|
||||
if not callable(v[1]):
|
||||
sv += v[0] + '=' + str(v[1]) + ', '
|
||||
return sv + ')'
|
||||
@property
|
||||
def Name(self):
|
||||
return _gorrent.gorrent_FileStatus_Name_Get(self.handle)
|
||||
@Name.setter
|
||||
def Name(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileStatus_Name_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileStatus_Name_Set(self.handle, value)
|
||||
@property
|
||||
def Url(self):
|
||||
return _gorrent.gorrent_FileStatus_Url_Get(self.handle)
|
||||
@Url.setter
|
||||
def Url(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileStatus_Url_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileStatus_Url_Set(self.handle, value)
|
||||
@property
|
||||
def Progress(self):
|
||||
return _gorrent.gorrent_FileStatus_Progress_Get(self.handle)
|
||||
@Progress.setter
|
||||
def Progress(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileStatus_Progress_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileStatus_Progress_Set(self.handle, value)
|
||||
@property
|
||||
def Length(self):
|
||||
return _gorrent.gorrent_FileStatus_Length_Get(self.handle)
|
||||
@Length.setter
|
||||
def Length(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileStatus_Length_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileStatus_Length_Set(self.handle, value)
|
||||
|
||||
# Python type for struct gorrent.Info
|
||||
class Info(go.GoClass):
|
||||
""""""
|
||||
@@ -678,7 +505,7 @@ class Engine(go.GoClass):
|
||||
"""IsAlive() bool"""
|
||||
return _gorrent.gorrent_Engine_IsAlive(self.handle)
|
||||
def StartTorrent(self, idx):
|
||||
"""StartTorrent(int idx) str"""
|
||||
"""StartTorrent(long idx) str"""
|
||||
return _gorrent.gorrent_Engine_StartTorrent(self.handle, idx)
|
||||
def Status(self):
|
||||
"""Status() object"""
|
||||
@@ -696,6 +523,179 @@ class Engine(go.GoClass):
|
||||
"""Clean() """
|
||||
_gorrent.gorrent_Engine_Clean(self.handle, goRun)
|
||||
|
||||
# Python type for struct gorrent.FileInfo
|
||||
class FileInfo(go.GoClass):
|
||||
""""""
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
handle=A Go-side object is always initialized with an explicit handle=arg
|
||||
otherwise parameters can be unnamed in order of field names or named fields
|
||||
in which case a new Go object is constructed first
|
||||
"""
|
||||
if len(kwargs) == 1 and 'handle' in kwargs:
|
||||
self.handle = kwargs['handle']
|
||||
_gorrent.IncRef(self.handle)
|
||||
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
||||
self.handle = args[0].handle
|
||||
_gorrent.IncRef(self.handle)
|
||||
else:
|
||||
self.handle = _gorrent.gorrent_FileInfo_CTor()
|
||||
_gorrent.IncRef(self.handle)
|
||||
if 0 < len(args):
|
||||
self.Length = args[0]
|
||||
if "Length" in kwargs:
|
||||
self.Length = kwargs["Length"]
|
||||
if 1 < len(args):
|
||||
self.Path = args[1]
|
||||
if "Path" in kwargs:
|
||||
self.Path = kwargs["Path"]
|
||||
if 2 < len(args):
|
||||
self.PathUTF8 = args[2]
|
||||
if "PathUTF8" in kwargs:
|
||||
self.PathUTF8 = kwargs["PathUTF8"]
|
||||
def __del__(self):
|
||||
_gorrent.DecRef(self.handle)
|
||||
def __str__(self):
|
||||
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
||||
sv = 'gorrent.FileInfo{'
|
||||
first = True
|
||||
for v in pr:
|
||||
if callable(v[1]):
|
||||
continue
|
||||
if first:
|
||||
first = False
|
||||
else:
|
||||
sv += ', '
|
||||
sv += v[0] + '=' + str(v[1])
|
||||
return sv + '}'
|
||||
def __repr__(self):
|
||||
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
||||
sv = 'gorrent.FileInfo ( '
|
||||
for v in pr:
|
||||
if not callable(v[1]):
|
||||
sv += v[0] + '=' + str(v[1]) + ', '
|
||||
return sv + ')'
|
||||
@property
|
||||
def Length(self):
|
||||
return _gorrent.gorrent_FileInfo_Length_Get(self.handle)
|
||||
@Length.setter
|
||||
def Length(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileInfo_Length_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileInfo_Length_Set(self.handle, value)
|
||||
@property
|
||||
def Path(self):
|
||||
return go.Slice_string(handle=_gorrent.gorrent_FileInfo_Path_Get(self.handle))
|
||||
@Path.setter
|
||||
def Path(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileInfo_Path_Set(self.handle, value.handle)
|
||||
else:
|
||||
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
||||
@property
|
||||
def PathUTF8(self):
|
||||
return go.Slice_string(handle=_gorrent.gorrent_FileInfo_PathUTF8_Get(self.handle))
|
||||
@PathUTF8.setter
|
||||
def PathUTF8(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileInfo_PathUTF8_Set(self.handle, value.handle)
|
||||
else:
|
||||
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
||||
|
||||
# Python type for struct gorrent.FileStatus
|
||||
class FileStatus(go.GoClass):
|
||||
""""""
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
handle=A Go-side object is always initialized with an explicit handle=arg
|
||||
otherwise parameters can be unnamed in order of field names or named fields
|
||||
in which case a new Go object is constructed first
|
||||
"""
|
||||
if len(kwargs) == 1 and 'handle' in kwargs:
|
||||
self.handle = kwargs['handle']
|
||||
_gorrent.IncRef(self.handle)
|
||||
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
||||
self.handle = args[0].handle
|
||||
_gorrent.IncRef(self.handle)
|
||||
else:
|
||||
self.handle = _gorrent.gorrent_FileStatus_CTor()
|
||||
_gorrent.IncRef(self.handle)
|
||||
if 0 < len(args):
|
||||
self.Name = args[0]
|
||||
if "Name" in kwargs:
|
||||
self.Name = kwargs["Name"]
|
||||
if 1 < len(args):
|
||||
self.Url = args[1]
|
||||
if "Url" in kwargs:
|
||||
self.Url = kwargs["Url"]
|
||||
if 2 < len(args):
|
||||
self.Progress = args[2]
|
||||
if "Progress" in kwargs:
|
||||
self.Progress = kwargs["Progress"]
|
||||
if 3 < len(args):
|
||||
self.Length = args[3]
|
||||
if "Length" in kwargs:
|
||||
self.Length = kwargs["Length"]
|
||||
def __del__(self):
|
||||
_gorrent.DecRef(self.handle)
|
||||
def __str__(self):
|
||||
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
||||
sv = 'gorrent.FileStatus{'
|
||||
first = True
|
||||
for v in pr:
|
||||
if callable(v[1]):
|
||||
continue
|
||||
if first:
|
||||
first = False
|
||||
else:
|
||||
sv += ', '
|
||||
sv += v[0] + '=' + str(v[1])
|
||||
return sv + '}'
|
||||
def __repr__(self):
|
||||
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
||||
sv = 'gorrent.FileStatus ( '
|
||||
for v in pr:
|
||||
if not callable(v[1]):
|
||||
sv += v[0] + '=' + str(v[1]) + ', '
|
||||
return sv + ')'
|
||||
@property
|
||||
def Name(self):
|
||||
return _gorrent.gorrent_FileStatus_Name_Get(self.handle)
|
||||
@Name.setter
|
||||
def Name(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileStatus_Name_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileStatus_Name_Set(self.handle, value)
|
||||
@property
|
||||
def Url(self):
|
||||
return _gorrent.gorrent_FileStatus_Url_Get(self.handle)
|
||||
@Url.setter
|
||||
def Url(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileStatus_Url_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileStatus_Url_Set(self.handle, value)
|
||||
@property
|
||||
def Progress(self):
|
||||
return _gorrent.gorrent_FileStatus_Progress_Get(self.handle)
|
||||
@Progress.setter
|
||||
def Progress(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileStatus_Progress_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileStatus_Progress_Set(self.handle, value)
|
||||
@property
|
||||
def Length(self):
|
||||
return _gorrent.gorrent_FileStatus_Length_Get(self.handle)
|
||||
@Length.setter
|
||||
def Length(self, value):
|
||||
if isinstance(value, go.GoClass):
|
||||
_gorrent.gorrent_FileStatus_Length_Set(self.handle, value.handle)
|
||||
else:
|
||||
_gorrent.gorrent_FileStatus_Length_Set(self.handle, value)
|
||||
|
||||
|
||||
# ---- Slices ---
|
||||
|
||||
|
||||
Reference in new issue
Block a user