diff options
Diffstat (limited to 'plugins/nautilus.py')
-rw-r--r-- | plugins/nautilus.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/nautilus.py b/plugins/nautilus.py new file mode 100644 index 0000000..e208a8c --- /dev/null +++ b/plugins/nautilus.py @@ -0,0 +1,48 @@ +# -*- coding: UTF-8 -*- +# -*- python -*- +# Copyright (C) 2005 by Sebastien Estienne +# +# This file may be distributed and/or modified under the terms of +# the GNU General Public License version 2 as published by +# the Free Software Foundation. +# This file is distributed without any warranty; without even the implied +# warranty of merchantability or fitness for a particular purpose. +# See "COPYING" in the source distribution for more information. +# +# $id$ +# + +from sdapplet.pluginutils import * + +import gnome + +class plugin_nautilus: + def __init__(self): + self.service_type = ["_http._tcp", "_ftp._tcp" , "_https._tcp", "_ftps._tcp" , "_webdav._tcp", "_webdav._tcp", "_sftp-ssh._tcp"] + self.author = "Sébastien Estienne" + self.description = "Accessing zeroconf services using Nautilus" + + def connect(self, name, stype, hostname, address, port, txts): + print "connecting using nautilus" + path = get_txt_value(txts,"path") + username = get_txt_value(txts,"u") + password = get_txt_value(txts,"p") + if stype == "_http._tcp": + url = build_url("http",address,port, path, username,password) + if stype == "_https._tcp": + url = build_url("https",address,port, path, username,password) + if stype == "_ftp._tcp": + url = build_url("ftp",address,port, path, username,password) + if stype == "_ftps._tcp": + url = build_url("ftps",address,port, path, username,password) + if stype == "_sftp-ssh._tcp": + url = build_url("sftp",address,port, path, username,password) + if stype == "_webdav._tcp": + url = build_url("webdav",address,port, path, username,password) + if stype == "_webdavs._tcp": + url = build_url("webdavs",address,port, path, username,password) + gnome.url_show(url) + + +def load(): + return plugin_nautilus() |