Hello community,
here is the log from the commit of package python-smbc for openSUSE:Factory
checked in at Mon May 30 17:05:28 CEST 2011.
--------
--- python-smbc/python-smbc.changes 2010-11-10 14:39:17.000000000 +0100
+++ python-smbc/python-smbc.changes 2011-05-27 15:24:18.000000000 +0200
@@ -1,0 +2,6 @@
+Fri May 27 15:22:24 CEST 2011 - vuntz@opensuse.org
+
+- Update to version 1.0.11:
+ + read/iternext now use Bytes type
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
pysmbc-1.0.10.tar.bz2
New:
----
pysmbc-1.0.11.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-smbc.spec ++++++
--- /var/tmp/diff_new_pack.RaXej3/_old 2011-05-30 17:04:10.000000000 +0200
+++ /var/tmp/diff_new_pack.RaXej3/_new 2011-05-30 17:04:10.000000000 +0200
@@ -1,7 +1,7 @@
#
-# spec file for package python-smbc (Version 1.0.10)
+# spec file for package python-smbc
#
-# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -23,7 +23,7 @@
BuildRequires: libsmbclient-devel
BuildRequires: python-devel
BuildRequires: python3-devel
-Version: 1.0.10
+Version: 1.0.11
Release: 1
# FIXME: once we have proper macros for python3 packaging, build a python3-smbc subpackage
Group: Development/Libraries/Python
++++++ pysmbc-1.0.10.tar.bz2 -> pysmbc-1.0.11.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.10/NEWS new/pysmbc-1.0.11/NEWS
--- old/pysmbc-1.0.10/NEWS 2010-11-01 17:21:31.000000000 +0100
+++ new/pysmbc-1.0.11/NEWS 2011-05-20 17:33:11.000000000 +0200
@@ -1,6 +1,10 @@
NEWS
----
+New in 1.0.11:
+
+* read/iternext now use Bytes type
+
New in 1.0.10:
* smbc.NoSpaceError
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.10/PKG-INFO new/pysmbc-1.0.11/PKG-INFO
--- old/pysmbc-1.0.10/PKG-INFO 2010-11-01 17:23:22.000000000 +0100
+++ new/pysmbc-1.0.11/PKG-INFO 2011-05-20 17:35:02.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: pysmbc
-Version: 1.0.10
+Version: 1.0.11
Summary: Python bindings for libsmbclient
Home-page: http://cyberelk.net/tim/software/pysmbc/
Author: ['Tim Waugh ', 'Tsukasa Hamano ']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.10/context.c new/pysmbc-1.0.11/context.c
--- old/pysmbc-1.0.10/context.c 2010-10-25 16:49:16.000000000 +0200
+++ new/pysmbc-1.0.11/context.c 2011-02-08 16:12:09.000000000 +0100
@@ -588,6 +588,26 @@
return 0;
}
+static PyObject *
+Context_getTimeout (Context *self, void *closure)
+{
+ int timeout = smbc_getTimeout (self->context);
+ return PyLong_FromLong (timeout);
+}
+
+static int
+Context_setTimeout (Context *self, PyObject *value, void *closure)
+{
+ if (!PyInt_Check (value))
+ {
+ PyErr_SetString (PyExc_TypeError, "must be long");
+ return -1;
+ }
+
+ smbc_setTimeout (self->context, PyInt_AsLong (value));
+ return 0;
+}
+
static int
Context_setFunctionAuthData (Context *self, PyObject *value, void *closure)
{
@@ -667,6 +687,12 @@
"Workgroup used for making connections.",
NULL },
+ { "timeout",
+ (getter) Context_getTimeout,
+ (setter) Context_setTimeout,
+ "Get the timeout used for waiting on connections and response data(in milliseconds)",
+ NULL },
+
{ "functionAuthData",
(getter) NULL,
(setter) Context_setFunctionAuthData,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.10/dir.c new/pysmbc-1.0.11/dir.c
--- old/pysmbc-1.0.10/dir.c 2010-10-25 16:17:36.000000000 +0200
+++ new/pysmbc-1.0.11/dir.c 2011-01-26 11:36:40.000000000 +0100
@@ -143,9 +143,15 @@
PyObject *largs = Py_BuildValue ("()");
PyObject *lkwlist;
int len = dirp->dirlen;
+
+#if PY_MAJOR_VERSION >= 3
PyObject *name = PyUnicode_FromString (dirp->name);
- PyObject *type = PyLong_FromLong (dirp->smbc_type);
PyObject *comment = PyUnicode_FromString (dirp->comment);
+#else
+ PyObject *name = PyString_FromString (dirp->name);
+ PyObject *comment = PyString_FromString (dirp->comment);
+#endif
+ PyObject *type = PyLong_FromLong (dirp->smbc_type);
lkwlist = PyDict_New ();
PyDict_SetItemString (lkwlist, "name", name);
PyDict_SetItemString (lkwlist, "comment", comment);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.10/file.c new/pysmbc-1.0.11/file.c
--- old/pysmbc-1.0.10/file.c 2010-10-25 16:17:36.000000000 +0200
+++ new/pysmbc-1.0.11/file.c 2011-05-20 17:31:53.000000000 +0200
@@ -1,6 +1,6 @@
/* -*- Mode: C; c-file-style: "gnu" -*-
* pysmbc - Python bindings for libsmbclient
- * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010 Red Hat, Inc
+ * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2011 Red Hat, Inc
* Copyright (C) 2010 Open Source Solution Technology Corporation
* Copyright (C) 2010 Patrick Geltinger
* Authors:
@@ -94,16 +94,19 @@
Py_INCREF (ctxobj);
ctx = (Context *) ctxobj;
self->context = ctx;
- if(uri){
- fn = smbc_getFunctionOpen (ctx->context);
- file = (*fn) (ctx->context, uri, (int) flags, (mode_t) mode);
- if (file == NULL)
- {
- pysmbc_SetFromErrno();
- return -1;
- }
- self->file = file;
- }
+ if (uri)
+ {
+ fn = smbc_getFunctionOpen (ctx->context);
+ file = (*fn) (ctx->context, uri, (int) flags, (mode_t) mode);
+ if (file == NULL)
+ {
+ pysmbc_SetFromErrno();
+ return -1;
+ }
+
+ self->file = file;
+ }
+
debugprintf ("%p open()\n", self->file);
debugprintf ("%p <- File_init() = 0\n", self->file);
return 0;
@@ -122,15 +125,13 @@
}
if (self->context)
- {
- Py_DECREF ((PyObject *) self->context);
- }
+ Py_DECREF ((PyObject *) self->context);
- Py_TYPE(self)->tp_free ((PyObject *) self);
+ Py_TYPE (self)->tp_free ((PyObject *) self);
}
static PyObject *
-File_read(File *self, PyObject *args)
+File_read (File *self, PyObject *args)
{
Context *ctx = self->context;
size_t size = 0;
@@ -141,34 +142,37 @@
smbc_fstat_fn fn_fstat;
struct stat st;
- if(!PyArg_ParseTuple(args, "|k", &size)){
+ if (!PyArg_ParseTuple (args, "|k", &size))
return NULL;
- }
- fn = smbc_getFunctionRead(ctx->context);
- if(size == 0){
- fn_fstat = smbc_getFunctionFstat(ctx->context);
- (*fn_fstat)(ctx->context, self->file, &st);
- size = st.st_size;
- }
-
- buf = (char *)malloc(size);
- if(!buf){
- return PyErr_NoMemory();
- }
- len = (*fn)(ctx->context, self->file, buf, size);
- if(len < 0){
- pysmbc_SetFromErrno();
- free(buf);
- return NULL;
- }
- ret = PyUnicode_FromStringAndSize(buf, len);
- free(buf);
+ fn = smbc_getFunctionRead (ctx->context);
+
+ if (size == 0)
+ {
+ fn_fstat = smbc_getFunctionFstat (ctx->context);
+ (*fn_fstat) (ctx->context, self->file, &st);
+ size = st.st_size;
+ }
+
+ buf = (char *) malloc(size);
+ if (!buf)
+ return PyErr_NoMemory ();
+
+ len = (*fn) (ctx->context, self->file, buf, size);
+ if (len < 0)
+ {
+ pysmbc_SetFromErrno ();
+ free (buf);
+ return NULL;
+ }
+
+ ret = PyBytes_FromStringAndSize (buf, len);
+ free (buf);
return ret;
}
static PyObject *
-File_write(File *self, PyObject *args)
+File_write (File *self, PyObject *args)
{
Context *ctx = self->context;
int size = 0;
@@ -176,90 +180,96 @@
char *buf;
ssize_t len;
- if(!PyArg_ParseTuple(args, "s#", &buf, &size)){
- return NULL;
- }
- fn = smbc_getFunctionWrite(ctx->context);
- len = (*fn)(ctx->context, self->file, buf, size);
- if(len < 0){
- pysmbc_SetFromErrno();
- return NULL;
- }
- return PyLong_FromLong(len);
+ if (!PyArg_ParseTuple (args, "s#", &buf, &size))
+ return NULL;
+
+ fn = smbc_getFunctionWrite (ctx->context);
+ len = (*fn) (ctx->context, self->file, buf, size);
+ if (len < 0)
+ {
+ pysmbc_SetFromErrno ();
+ return NULL;
+ }
+
+ return PyLong_FromLong (len);
}
static PyObject *
-File_fstat(File *self, PyObject *args)
+File_fstat (File *self, PyObject *args)
{
Context *ctx = self->context;
smbc_fstat_fn fn;
struct stat st;
int ret;
- fn = smbc_getFunctionFstat(ctx->context);
+ fn = smbc_getFunctionFstat (ctx->context);
errno = 0;
- ret = (*fn)(ctx->context, self->file, &st);
- if(ret < 0){
- pysmbc_SetFromErrno();
- return NULL;
- }
- return Py_BuildValue("(IKKKIIKIII)",
- st.st_mode,
- (unsigned long long)st.st_ino,
- (unsigned long long)st.st_dev,
- (unsigned long long)st.st_nlink,
- st.st_uid,
- st.st_gid,
- st.st_size,
- st.st_atime,
- st.st_mtime,
- st.st_ctime);
+ ret = (*fn) (ctx->context, self->file, &st);
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno ();
+ return NULL;
+ }
+
+ return Py_BuildValue ("(IKKKIIKIII)",
+ st.st_mode,
+ (unsigned long long)st.st_ino,
+ (unsigned long long)st.st_dev,
+ (unsigned long long)st.st_nlink,
+ st.st_uid,
+ st.st_gid,
+ st.st_size,
+ st.st_atime,
+ st.st_mtime,
+ st.st_ctime);
}
static PyObject *
-File_close(File *self, PyObject *args)
+File_close (File *self, PyObject *args)
{
Context *ctx = self->context;
smbc_close_fn fn;
int ret = 0;
- fn = smbc_getFunctionClose(ctx->context);
- if(self->file){
- ret = (*fn)(ctx->context, self->file);
- self->file = NULL;
- }
- return PyLong_FromLong(ret);
+ fn = smbc_getFunctionClose (ctx->context);
+ if (self->file)
+ {
+ ret = (*fn) (ctx->context, self->file);
+ self->file = NULL;
+ }
+
+ return PyLong_FromLong (ret);
}
static PyObject *
-File_iter(PyObject *self)
+File_iter (PyObject *self)
{
- Py_INCREF(self);
+ Py_INCREF (self);
return self;
}
static PyObject *
-File_iternext(PyObject *self)
+File_iternext (PyObject *self)
{
- File *file = (File *)self;
+ File *file = (File *) self;
Context *ctx = file->context;
smbc_read_fn fn;
char buf[2048];
ssize_t len;
- fn = smbc_getFunctionRead(ctx->context);
- len = (*fn)(ctx->context, file->file, buf, 2048);
- if(len > 0){
- return PyUnicode_FromStringAndSize(buf, len);
- }else if(len == 0){
- PyErr_SetNone(PyExc_StopIteration);
- }else{
- pysmbc_SetFromErrno();
- }
+ fn = smbc_getFunctionRead (ctx->context);
+ len = (*fn) (ctx->context, file->file, buf, 2048);
+ if (len > 0)
+ return PyBytes_FromStringAndSize (buf, len);
+ else if (len == 0)
+ PyErr_SetNone (PyExc_StopIteration);
+ else
+ pysmbc_SetFromErrno ();
+
return NULL;
}
static PyObject *
-File_lseek(File *self, PyObject *args)
+File_lseek (File *self, PyObject *args)
{
Context *ctx = self->context;
smbc_lseek_fn fn;
@@ -268,21 +278,24 @@
int whence=0;
off_t ret;
- if(!PyArg_ParseTuple(args, (OFF_T_FORMAT "|i"), &py_offset, &whence)){
- return NULL;
- }
+ if (!PyArg_ParseTuple (args, (OFF_T_FORMAT "|i"), &py_offset, &whence))
+ return NULL;
+
offset = py_offset;
+
/* check for data loss from cast */
- if ((off_t_long)offset != py_offset) {
- PyErr_SetString(PyExc_OverflowError, "Data loss in casting off_t");
- }
- fn = smbc_getFunctionLseek(ctx->context);
- ret = (*fn)(ctx->context, self->file, offset, whence);
- if(ret < 0){
- pysmbc_SetFromErrno();
- return NULL;
- }
- return Py_BuildValue(OFF_T_FORMAT, ret);
+ if ((off_t_long) offset != py_offset)
+ PyErr_SetString(PyExc_OverflowError, "Data loss in casting off_t");
+
+ fn = smbc_getFunctionLseek (ctx->context);
+ ret = (*fn) (ctx->context, self->file, offset, whence);
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno ();
+ return NULL;
+ }
+
+ return Py_BuildValue (OFF_T_FORMAT, ret);
}
PyMethodDef File_methods[] =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.10/setup.py new/pysmbc-1.0.11/setup.py
--- old/pysmbc-1.0.10/setup.py 2010-11-01 17:20:01.000000000 +0100
+++ new/pysmbc-1.0.11/setup.py 2011-05-20 17:32:40.000000000 +0200
@@ -52,7 +52,7 @@
from distutils.core import setup, Extension
setup (name="pysmbc",
- version="1.0.10",
+ version="1.0.11",
description="Python bindings for libsmbclient",
long_description=__doc__,
author=["Tim Waugh ",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.10/smbcdirent.c new/pysmbc-1.0.11/smbcdirent.c
--- old/pysmbc-1.0.10/smbcdirent.c 2010-10-25 16:17:36.000000000 +0200
+++ new/pysmbc-1.0.11/smbcdirent.c 2011-05-18 13:16:22.000000000 +0200
@@ -109,7 +109,7 @@
char s[1024];
snprintf (s, sizeof (s),
"", dent->name,
- dent->smbc_type <= sizeof (types) ?
+ dent->smbc_type < (sizeof (types) / sizeof *(types)) ?
types[dent->smbc_type] : "?",
dent);
return PyUnicode_FromString (s);
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org