vispa.remote package

Submodules

vispa.remote.filesystem module

class vispa.remote.filesystem.FileSystem(userid, workspaceid)

Bases: object

ADDITIONAL_MIMES = {'root': 'text/plain', 'pxlio': 'text/plain'}
BROWSER_EXTENSIONS = ['png', 'jpg', 'jpeg', 'bmp']
FILE_EXTENSIONS = ['png', 'jpg', 'jpeg', 'bmp', 'ps', 'eps', 'pdf', 'txt', 'xml', 'py', 'c', 'cpp', 'root', 'pxlio']
GLOBAL_WORKSPACE_CONF = '/etc/vispa/workspace.ini'
PRIVATE_WORKSPACE_CONF = '~/.vispa/workspace.ini'
checkPermissions(path, permission=2)
check_file_extension(path, extensions=[])
close()
compress(paths, path, name, is_tmp=False)
create_file(path, name)
create_folder(path, name)
cut_slashs(path)
decompress(path)
exists(path, type=None)
expand(path)
get_file(path, binary=False, utf8=False, window_id=None, view_id=None, watch_id=None, max_size=20)
get_file_content(path, offset=0, length=None)
get_file_count(path, window_id=None, view_id=None, watch_id=None)
get_file_list(path, filter=None, reverse=False, hide_hidden=True, encode_json=True, window_id=None, view_id=None, watch_id=None)
get_mime_type(filepath)
get_mtime(path)
get_suggestions(path, length=1, append_hidden=True, encode_json=True)
get_workspaceini(request, fail_on_missing=False)
getfacl(path)
handle_file_name_collision(name, path)
is_browser_file(path)
move(source, destination)
paste(path, fullsrc, cut)
remove(path)
rename(path, name, new_name, force=False)
save_file(path, content, force=True, binary=False, utf8=False, window_id=None, view_id=None, watch_id=None)
save_file_content(filename, content, path=None, force=True, append=False)
set_workspaceini(request)
setfacl(path, type, name, mode, remove=False, recursive=False, default=False)
setup(basedir=None)
stat(path)
thumbnail(path, width=100, height=100, sharpen=True)
unwatch(window_id, view_id, watch_id=None)
watch(path, window_id, view_id, watch_id, pattern=None, reverse=False, hide_hidden=True)
class vispa.remote.filesystem.WatchService

Bases: object

stop()
subscribe(id, path, pattern=None, reverse=False, hide_hidden=True)
unsubscribe(id)
class vispa.remote.filesystem.WatchSubscriber(service, id)

Bases: object

EVENT_DELAYS = {'modify': [1.0, 0.2], 'change': [1.0, 0.1]}
MAX_INLINE_SUBJECTS = 10
MAX_SUBJECT_NAMES = 25
bind(path)
destroy()
emit(event)
flush(force=False)
process(event, subject='')
unbind()
update(path, pattern='', reverse=False, hide_hidden=True)
vispa.remote.filesystem.file_compare(a, b)
vispa.remote.filesystem.get_file_info(base, name)
vispa.remote.filesystem.string_compare(a, b)

vispa.remote.helper module

class vispa.remote.helper.UTF8Buffer

Bases: object

Buffers incoming UTF8 encoded data, and prevents chunks from being created in the middle of a multi byte sequence.

fill(data)

Fill the buffer with the given data.

passThru(data, count=None)

A convenience function for adding data to the buffer and reading up to count of it again. If count is None the current buffer length is used.

read(count=None)

Get a maximum of count bytes from the buffer. UTF8 multibyte characters will not be broken apart. If count is None the current buffer length is used.

Module contents

exception vispa.remote.AjaxException(message, code=None, alert=True)

Bases: exceptions.Exception

AjaxException that is handled by the ajax tool and that can be raised in controller methods. message is the error message to show. code should be an integer that represents a specific type of exception. If code is None and message is an integer representing a http status code, the error message is set to the standard error message for that http error. If alert is True, the message is shown in a dialog in the GUI.

vispa.remote.raise_ajax(fn=None, **kwargs)

Decorator that transforms raised exceptions into AjaxExceptions.

vispa.remote.send_topic(topic, data=None, window_id=None, user_id=None)