Permalink
Browse files

Get rid of JSON Export ability in manifest

  • Loading branch information...
1 parent ab5c4dd commit 3cef627e72224a15bd6d1f583cb753a562e3df2a @toddlipcon toddlipcon committed Sep 21, 2009
Showing with 1 addition and 35 deletions.
  1. +1 −35 manifest.py
View
@@ -51,20 +51,6 @@ def add_project(self, project):
raise Exception("Project %s already in manifest" % project.name)
self.projects[project.name] = project
- def to_json(self):
- return simplejson.dumps(self.data_for_json(), indent=2)
-
- def data_for_json(self):
- return {
- "default-revision": self.default_ref,
- "default-remote": self.default_remote,
- "remotes": dict( [(name, remote.data_for_json()) for (name, remote) in self.remotes.iteritems()] ),
- "projects": dict( [(name, project.data_for_json()) for (name, project) in self.projects.iteritems()] ),
- }
-
- def __repr__(self):
- return self.to_json()
-
class Remote(object):
def __init__(self,
@@ -75,11 +61,6 @@ def __init__(self,
def from_dict(data):
return Remote(fetch=data.get('fetch'))
- def to_json(self):
- return simplejson.dumps(self.data_for_json(), indent=2)
-
- def data_for_json(self):
- return {'fetch': self.fetch}
class TrackBranch(object):
def __init__(self, from_remote, track_branch):
@@ -136,7 +117,7 @@ def tracking_status(self, repo):
def create_tracking_branch(self, repo):
repo.command(["branch", self.tag, self.remote_ref])
-
+
class Project(object):
def __init__(self,
@@ -217,16 +198,6 @@ def from_dict(manifest, name, data):
def tracking_status(self):
return self.tracker.tracking_status(self.git_repo)
- def to_json(self):
- return simplejson.dumps(self.data_for_json())
-
- def data_for_json(self):
- return {'name': self.name,
- 'remotes': self.remotes.keys(),
- 'ref': self.ref,
- 'from-remote': self.from_remote,
- 'dir': self.dir}
-
@property
def dir(self):
return os.path.join(self.manifest.base_dir, self._dir)
@@ -302,8 +273,3 @@ def checkout_tracking_branch(self):
def load_manifest(path):
return Manifest.from_json_file(path)
-
-
-def test_json_load_store():
- man = load_manifest(os.path.join(os.path.dirname(__file__), 'test', 'test_manifest.json'))
- assert len(man.to_json()) > 10

0 comments on commit 3cef627

Please sign in to comment.