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

Unified Diff: tools/remove_html_imports.py

Issue 810223002: Remove the http package from the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
« pkg/pkg.gyp ('K') | « sdk/bin/pub ('k') | utils/pub/pub.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/remove_html_imports.py
diff --git a/tools/remove_html_imports.py b/tools/remove_html_imports.py
deleted file mode 100644
index 49a87c46e1cd5b010903a389f39832d32b0fbc86..0000000000000000000000000000000000000000
--- a/tools/remove_html_imports.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-'''Tool for removing dart:html and related imports from a library.
-
-Copy SOURCE to TARGET, removing any lines that import dart:html.
-
-Usage:
- python tools/remove_html_imports.py SOURCE TARGET
-'''
-
-import os
-import re
-import shutil
-import sys
-
-HTML_IMPORT = re.compile(r'''^import ["']dart:(html|html_common|indexed_db'''
- r'''|js|svg|web_(audio|gl|sql))["'];$''',
- flags=re.MULTILINE)
-
-def main(argv):
- source = argv[1]
- target = argv[2]
- shutil.rmtree(target)
- shutil.copytree(source, target, ignore=shutil.ignore_patterns('.svn'))
-
- for root, subFolders, files in os.walk(target):
- for path in files:
- if not path.endswith('.dart'): next
- with open(os.path.join(root, path), 'r+') as f:
- contents = f.read()
- f.seek(0)
- f.truncate()
- f.write(HTML_IMPORT.sub(r'// import "dart:\1";', contents))
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
« pkg/pkg.gyp ('K') | « sdk/bin/pub ('k') | utils/pub/pub.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698