Skip to content

Instantly share code, notes, and snippets.

View vortec's full-sized avatar

Fabian Kochem vortec

View GitHub Profile
class Food(object):
def eat(self):
pass
@pytest.fixture
def product():
return Food()
def test_product(product):
>>> from test_dispatcher import Food
>>> product = Food()
>>> x = {'x': product}
>>> assert x['x'] is product
>>> assert x['x'].eat == product.eat
>>> assert x['x'].eat is product.eat
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AssertionError
class Food(object):
def eat(self):
pass
product = Food()
x = {'x': product}
print x['x'] is product
print x['x'].eat == product.eat
print x['x'].eat is product.eat
Compiling vfs_python.c
vfs_python.c: In function ‘get_py_mod’:
vfs_python.c:50:2: warning: return from incompatible pointer type [enabled by default]
vfs_python.c: In function ‘get_py_func’:
vfs_python.c:63:4: warning: return from incompatible pointer type [enabled by default]
vfs_python.c: In function ‘get_func’:
vfs_python.c:78:14: warning: assignment from incompatible pointer type [enabled by default]
vfs_python.c: At top level:
vfs_python.c:105:17: error: ‘python_connect’ undeclared here (not in a function)
vfs_python.c:106:20: error: ‘python_disconnect’ undeclared here (not in a function)
vfs_python.c: In function ‘get_py_mod’:
vfs_python.c:50:2: warning: return from incompatible pointer type [enabled by default]
vfs_python.c: In function ‘get_py_func’:
vfs_python.c:63:4: warning: return from incompatible pointer type [enabled by default]
vfs_python.c: In function ‘get_func’:
vfs_python.c:78:14: warning: assignment from incompatible pointer type [enabled by default]
vfs_python.c: At top level:
vfs_python.h:18:12: warning: ‘python_connect’ used but never defined [enabled by default]
vfs_python.h:21:13: warning: ‘python_disconnect’ used but never defined [enabled by default]
vfs_python.h:22:12: warning: ‘python_mkdir’ used but never defined [enabled by default]
Compiling vfs_python.c
#@gcc -g -O2 -g -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER -fPIC -Iinclude -I/home/vortec/workspace/samba/source3/include -I/home/vortec/workspace/samba/source3/include/autoconf -I/home/vortec/workspace/samba/source3/autoconf -I/home/vortec/workspace/samba/source3/../popt -I/home/vortec/workspace/samba/source3/../lib/replace -I/home/vortec/workspace/samba/source3/../lib/talloc -I/home/vortec/workspace/samba/source3/../lib/tevent -I/home/vortec/workspace/samba/source3/../lib/tdb/include -I/home/vortec/workspace/samba/source3/librpc -I/home/vortec/workspace/samba/source3/../librpc -I/home/vortec/workspace/samba/source3/../ -I/home/vortec/workspace/samba/source3 -I. -c commands.c -c python_importer.c -c vfs_python.c -Dvfs_python_init=samba_init_module
commands.c: In function ‘python_connect’:
commands.c:15:22: warning: initialization from incompatible pointer type [enabled by default]
commands.c:18:3: warning
Compiling vfs_python.c
commands.c: In function ‘python_connect’:
commands.c:15:22: warning: initialization from incompatible pointer type [enabled by default]
commands.c:18:3: warning: passing argument 2 of ‘PyObject_CallFunction’ discards ‘const’ qualifier from pointer target type [enabled by default]
/usr/include/python2.7/abstract.h:326:29: note: expected ‘char *’ but argument is of type ‘const char *’
commands.c: In function ‘python_mkdir’:
commands.c:45:22: warning: initialization from incompatible pointer type [enabled by default]
commands.c:48:3: warning: passing argument 2 of ‘PyObject_CallFunction’ discards ‘const’ qualifier from pointer target type [enabled by default]
/usr/include/python2.7/abstract.h:326:29: note: expected ‘char *’ but argument is of type ‘const char *’
python_importer.c: In function ‘get_py_mod’:
[vortec@nuotp] local/samba/bin $ ./smbclient //localhost/public †: 0
Enter vortec's password:
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.0.16]
smb: \> put /tmp/vagrant20140325-1684-pazm0i good_file
putting file /tmp/vagrant20140325-1684-pazm0i as \good_file (0.0 kb/s) (average 0.0 kb/s)
smb: \> put /tmp/vagrant20140325-1684-pazm0i bad_file
NT_STATUS_UNSUCCESSFUL opening remote file \bad_file
smb: \>
struct vfs_fn_pointers skel_transparent_fns = {
/* Disk operations */
.connect_fn = skel_connect,
.disconnect_fn = skel_disconnect,
.disk_free_fn = skel_disk_free,
.get_quota_fn = skel_get_quota,
.set_quota_fn = skel_set_quota,
.get_shadow_copy_data_fn = skel_get_shadow_copy_data,
.statvfs_fn = skel_statvfs,
/*int a = 11; // top
int b = 10; // top right
int c = 5; // bottom right
int d = 4; // bottom
int e = 3; // bottom left
int f = 12; // top left
int g = 13; // middle
int h = 6; // point
*/