def vsreenqueue(item_id, item_s, args, **kwargs):
    '''Enqueue a string, or string-like object to other queues, with arbitrary
       arguments, sreenqueue is to reenqueue what sprintf is to printf,
       sreenqueue is to vsreenqueue what sprintf is to vsprintf.
    '''
    charset = kwargs.get('charset', _c.FSQ_CHARSET)
    if kwargs.has_key('charset'):
        del kwargs['charset']

    kwargs['item_id'] = item_id
    # we coerce here because StringIO.StringIO will coerce on file-write,
    # and cStringIO.StringIO has a bug which injects NULs for unicode
    if isinstance(item_s, unicode):
        try:
            item_s = item_s.encode(charset)
        except UnicodeEncodeError:
            raise FSQCoerceError(errno.EINVAL, u'cannot encode item with'\
                                 u' charset {0}'.format(charset))

    return vreenqueue(StringIO(item_s), item_id, args, **kwargs)
def vsreenqueue ( item_id , item_s , args , ** kwargs ) : charset = kwargs . get ( 'charset' , _c . FSQ_CHARSET ) if kwargs . has_key ( 'charset' ) : del kwargs [ 'charset' ] kwargs [ 'item_id' ] = item_id if isinstance ( item_s , unicode ) : try : item_s = item_s . encode ( charset ) except UnicodeEncodeError : raise FSQCoerceError ( errno . EINVAL , u'cannot encode item with' u' charset {0}' . format ( charset ) ) return vreenqueue ( StringIO ( item_s ) , item_id , args , ** kwargs )
Enqueue a string, or string-like object to other queues, with arbitrary
       arguments, sreenqueue is to reenqueue what sprintf is to printf,
       sreenqueue is to vsreenqueue what sprintf is to vsprintf.