summaryrefslogtreecommitdiff
path: root/gear/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'gear/client.py')
-rw-r--r--gear/client.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/gear/client.py b/gear/client.py
index 2da25571..d14edd31 100644
--- a/gear/client.py
+++ b/gear/client.py
@@ -26,11 +26,11 @@ class theController():
self.builder_client = BuilderClient(self)
self.cache_client = CacheRequestClient(self)
self.builder_client.addServer('localhost')
- self.builder_client.waitForServer() # Wait for at least one server to be connected
+ self.builder_client.waitForServer()
self.graph_client.addServer('localhost')
- self.graph_client.waitForServer() # Wait for at least one server to be connected
+ self.graph_client.waitForServer()
self.cache_client.addServer('localhost')
- self.cache_client.waitForServer() # Wait for at least one server to be connected
+ self.cache_client.waitForServer()
self.artifact = None
self.build_started = False
@@ -53,8 +53,6 @@ class theController():
print "Setting them as unbuilt"
self._map_build_graph(self.artifact, set_initial_state)
print "Setting them as unbuilt done"
- # TODO: check cache before marking as started:
- # http://stackoverflow.com/questions/9110593/asynchronous-requests-with-python-requests
self._check_cache_state(self.artifact)
@@ -107,13 +105,14 @@ class theController():
mapped_components.append(a)
return result, mapped_components
- def find_artifacts_that_are_ready_to_build(self, root_artifact, components=[]):
+ def find_artifacts_that_are_ready_to_build(self, root_artifact,
+ components=[]):
'''Return unbuilt artifacts whose dependencies are all built.
- The 'root_artifact' parameter is expected to be a tree of ArtifactReference
- objects. These must have the 'state' attribute set to BUILT or UNBUILT. If
- 'components' is passed, then only those artifacts and their dependencies
- will be built.
+ The 'root_artifact' parameter is expected to be a tree of
+ ArtifactReference objects. These must have the 'state' attribute set
+ to BUILT or UNBUILT. If 'components' is passed, then only those
+ artifacts and their dependencies will be built.
'''
def is_ready_to_build(artifact):
@@ -155,7 +154,7 @@ class theController():
# we're also building all the chunk artifacts
# in this source
same_chunk_artifacts = [a for a in artifacts
- if a.cache_key == artifact.cache_key]
+ if a.cache_key == artifact.cache_key]
for a in same_chunk_artifacts:
a.state = BUILDING
artifacts.remove(a)
@@ -285,6 +284,6 @@ while True:
import time
time.sleep(0.0001)
if controller.artifact != None and controller.build_started == True:
- to_build = controller.find_artifacts_that_are_ready_to_build(controller.artifact)
- #print to_build
+ to_build = controller.find_artifacts_that_are_ready_to_build(
+ controller.artifact)
controller._queue_worker_builds(to_build)