commit/galaxy-central: martenson: pep8 fixes
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/4bf3a182df98/ Changeset: 4bf3a182df98 User: martenson Date: 2014-05-07 21:31:03 Summary: pep8 fixes Affected #: 1 file diff -r bc1d006b0e66209e26f107ff6b48bfece3777eec -r 4bf3a182df988e5c17e5f6080900130636ecf00f lib/galaxy/util/streamball.py --- a/lib/galaxy/util/streamball.py +++ b/lib/galaxy/util/streamball.py @@ -2,11 +2,13 @@ A simple wrapper for writing tarballs as a stream. """ import os -import logging, tarfile +import logging +import tarfile from galaxy.exceptions import ObjectNotFound log = logging.getLogger( __name__ ) + class StreamBall( object ): def __init__( self, mode, members=None ): self.members = members @@ -15,16 +17,19 @@ self.mode = mode self.wsgi_status = None self.wsgi_headeritems = None + def add( self, file, relpath, check_file=False): - if check_file and len(file)>0: + if check_file and len(file) > 0: if not os.path.isfile(file): raise ObjectNotFound else: self.members[file] = relpath else: self.members[file] = relpath + def stream( self, environ, start_response ): response_write = start_response( self.wsgi_status, self.wsgi_headeritems ) + class tarfileobj: def write( self, *args, **kwargs ): response_write( *args, **kwargs ) @@ -34,10 +39,12 @@ tf.close() return [] + class ZipBall(object): def __init__(self, tmpf, tmpd): self._tmpf = tmpf self._tmpd = tmpd + def stream(self, environ, start_response): response_write = start_response( self.wsgi_status, self.wsgi_headeritems ) tmpfh = open( self._tmpf ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org