Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: devserver.py

Issue 6508001: devserver: introduce --datadir option to override where devserver puts static (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dev-util.git@master
Patch Set: Fixed a tab Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | devserver_test.py » ('j') | devserver_test.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devserver.py
diff --git a/devserver.py b/devserver.py
index 9d4b87ef01f5cc0ba3165ca69af88cb90eecf61b..69c7bc73484335894d100db5b002242d21a4ccb0 100755
--- a/devserver.py
+++ b/devserver.py
@@ -121,6 +121,9 @@ if __name__ == '__main__':
parser.add_option('--client_prefix', dest='client_prefix',
help='Required prefix for client software version.',
default='MementoSoftwareUpdate')
+ parser.add_option('--datadir', dest='datadir',
+ help='Writable directory where static lives',
+ default=os.path.dirname(os.path.abspath(sys.argv[0])))
parser.add_option('--exit', action='store_true', default=False,
help='Don\'t start the server (still pregenerate or clear'
'cache).')
@@ -160,7 +163,7 @@ if __name__ == '__main__':
_PrepareToServeUpdatesOnly(static_dir)
serve_only = True
else:
- static_dir = os.path.realpath('%s/static' % devserver_dir)
+ static_dir = os.path.realpath('%s/static' % options.datadir)
os.system('mkdir -p %s' % static_dir)
cache_dir = os.path.join(static_dir, 'cache')
@@ -185,6 +188,7 @@ if __name__ == '__main__':
else:
os.makedirs(cache_dir)
+ cherrypy.log('Data dir is %s' %options.datadir, 'DEVSERVER')
davidjames 2011/02/11 23:31:53 Need a space after the % sign.
cherrypy.log('Source root is %s' % root_dir, 'DEVSERVER')
cherrypy.log('Serving from %s' % static_dir, 'DEVSERVER')
« no previous file with comments | « no previous file | devserver_test.py » ('j') | devserver_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698