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

Unified Diff: chrome/common/extensions/docs/server2/local_file_system.py

Issue 14856006: Docserver: achieve online vs offline (cron vs instance) behaviour at the object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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
Index: chrome/common/extensions/docs/server2/local_file_system.py
diff --git a/chrome/common/extensions/docs/server2/local_file_system.py b/chrome/common/extensions/docs/server2/local_file_system.py
index 2955d8c64b35149635862a059850a49270213674..d243583638a27f7eab8cb05466e9986f6f94123a 100644
--- a/chrome/common/extensions/docs/server2/local_file_system.py
+++ b/chrome/common/extensions/docs/server2/local_file_system.py
@@ -3,15 +3,19 @@
# found in the LICENSE file.
import os
+import sys
from file_system import FileSystem, FileNotFoundError, StatInfo, ToUnicode
from future import Future
class LocalFileSystem(FileSystem):
- """FileSystem implementation which fetches resources from the local
+ '''FileSystem implementation which fetches resources from the local
filesystem.
- """
- def __init__(self, base_path):
+ '''
+ def __init__(self, base_path=None):
+ if base_path is None:
+ # Default to the base of the extensions directory.
+ base_path = os.path.join(sys.path[0], os.pardir, os.pardir)
self._base_path = self._ConvertToFilepath(base_path)
def _ConvertToFilepath(self, path):

Powered by Google App Engine
This is Rietveld 408576698