comparison jb2_webserver.py @ 46:4181e97c70a7 draft

planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
author fubar
date Mon, 04 Mar 2024 09:47:19 +0000
parents f728cf0df71d
children 460d5b6c5d98
comparison
equal deleted inserted replaced
45:0ec526d2d8c1 46:4181e97c70a7
40 import socketserver 40 import socketserver
41 import webbrowser 41 import webbrowser
42 from http.server import SimpleHTTPRequestHandler 42 from http.server import SimpleHTTPRequestHandler
43 43
44 44
45 DEFAULT_PORT = 8080 45 DEFAULT_PORT = 8081
46 46
47 47
48 def copy_byte_range(infile, outfile, start=None, stop=None, bufsize=16 * 1024): 48 def copy_byte_range(infile, outfile, start=None, stop=None, bufsize=16 * 1024):
49 """Like shutil.copyfileobj, but only copy a range of the streams. 49 """Like shutil.copyfileobj, but only copy a range of the streams.
50 50
154 allow_reuse_address = True 154 allow_reuse_address = True
155 155
156 156
157 if __name__ == "__main__": 157 if __name__ == "__main__":
158 parser = argparse.ArgumentParser( 158 parser = argparse.ArgumentParser(
159 description="Simple Python Web Server with Range Support" 159 description="Tiny Python Web Server supporting range requests, for local viewing of unzipped Galaxy JBrowse2 configurations"
160 ) 160 )
161 parser.add_argument( 161 parser.add_argument(
162 "--root", 162 "--root",
163 default=os.getcwd(), 163 default=os.getcwd(),
164 help="Root path to serve files from (default: current working directory)", 164 help="Root path to serve files from (default: current working directory)",