@command(directory=str, title=unicode, description=unicode)
    def do_create(self, directory=None, title="my archive", description=None):
        """
        Usage: create <directory> <title> [<description>]
        """
        try:
            if not os.path.isdir(directory):
                print "The specified folder does not exist."
                return

            def mycb(path, rel):
                if not path:
                    print "Encrypting.."
                else:
                    if isinstance(path, unicode):
                        path = path.encode('UTF-8')
                    print path, "=>", rel.encode('UTF-8')
            self.cache.prepare(title, directory,
                               description=description, cb=mycb)
            print "archive prepared"

        except __HOLE__ as e:
            fsenc = sys.getfilesystemencoding()
            if fsenc != "UTF-8":
                fsenc += " or UTF-8"
            getLogger().debug("exception while preparing",
                              exc_info=True)
            print "error: failed to decode filename {} as {}".format(
                e.object.encode('string_escape'), fsenc)
        except Exception as e:
            getLogger().debug("exception while preparing",
                              exc_info=True)
            print "error: " + str(e)
dataset/ETHPy150Open longaccess/longaccess-client/lacli/command.py/LaArchiveCommand.do_create