# encoding=utf_8
from __future__ import unicode_literals

import socket
from time import sleep


def mount(s, at, uuid=None, label=None, name=None):
    for name, value in ((b'uuid', uuid), (b'label', label), (b'name', name)):
        if value is not None:
            value = value.encode('utf_8')
            at = at.encode('utf_8')
            msg = b'5:mount{0}:{1}={2}{3}:at={4}$'.format(
                len(name + value) + 1, name, value,
                len(b'at' + at) + 1, at)
            print repr(msg)
            s.sendall(msg[0:9])
            sleep(1)
            s.sendall(msg[9:])
            return


def main():
    s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    s.connect('/tmp/arise.sock')
    mount(s, '/mnt/place', label='UFDé')
    sleep(1)


if __name__ == '__main__':
    main()

@@ -98,189 +98,191 @@
 def 
-mount(s, at, uuid=None, label=None, name=None):%0A    for name, value in ((b'uuid', uuid), (b'label', label), (b'name', name)):%0A        if value is not None:%0A            value = value
+send_command(s, command, **kwargs):%0A    command = command.encode('utf_8')%0A    msg = b'%7B%7D:%7B%7D'.format(len(command), command)%0A%0A    for key, value in kwargs.iteritems():%0A        key = key
 .enc
@@ -306,19 +306,21 @@
     
- 
-   at = at
+value = value
 .enc
@@ -344,86 +344,49 @@
     
-   
- 
 msg 
++
 = b'
-5:mount%7B0
+%7B
 %7D:%7B
-1
 %7D=%7B
-2%7D%7B3%7D:at=%7B4%7D$'.format(%0A                len(name + 
+%7D'.format(len(key) + len(
 valu
@@ -397,70 +397,38 @@
  1, 
-name
+key
 , value
-,
+)%0A
 %0A    
-            len(b'at' + at) + 1, at)%0A        
+msg += b'$'%0A%0A
     
@@ -437,26 +437,12 @@
 int 
-repr(
 msg
-)
 %0A
-        
     
@@ -458,85 +458,9 @@
 (msg
-%5B0:9%5D)%0A            sleep(1)%0A            s.sendall(msg%5B9:%5D)%0A            return
+)
 %0A%0A%0Ad
@@ -569,17 +569,36 @@
     
-mount(s, 
+send_command(s, 'mount', at=
 '/mn
@@ -621,16 +621,60 @@
 'UFD%C3%A9')%0A
+    send_command(s, 'umount', label='UFD%C3%A9')%0A
     slee
@@ -679,17 +679,16 @@
 eep(1)%0A%0A
-%0A
 if __nam

Add send_command