Permalink
Browse files

Add c-style /* ... */ comment support

  • Loading branch information...
1 parent c74181a commit ec69674460d8a4553e264826fcd662ce3b74c837 @toddlipcon toddlipcon committed Oct 26, 2009
Showing with 8 additions and 3 deletions.
  1. +4 −1 manifest.py
  2. +4 −2 shell-tests/follow_tag.sh
View
@@ -5,6 +5,7 @@
from contextlib import closing
import logging
import os
+import re
import simplejson
from git_command import GitCommand
@@ -46,7 +47,9 @@ def from_dict(data, base_dir=None):
@classmethod
def from_json_file(cls, path):
- data = simplejson.load(file(path))
+ data_txt = file(path).read()
+ data_txt = re.sub(r'(?s)/\*.+?\*/', "", data_txt)
+ data = simplejson.loads(data_txt)
return cls.from_dict(data, base_dir=os.path.abspath(os.path.dirname(path)))
def add_project(self, project):
@@ -37,10 +37,12 @@ mkdir tests
pushd tests
cat > manifest.json <<EOF
-{
+{ /* comment here! */
"remotes":
{"origin": { "fetch": "$TESTDIR/%(name)s" }},
-
+/* multi
+line
+comment*/
"projects":
{"repo_a": { "track-tag": "commit_b" }}
}

0 comments on commit ec69674

Please sign in to comment.