import logging, json
from indx.webserver.handlers.base import BaseHandler
import requests
from indxclient import IndxClient
from blank import BlankApp

class BlankApp(BaseHandler):

    def __init__(self, server):
        BaseHandler.__init__(self, server)
        self.isLeaf = True
        self.app = BlankApp() # with any params a real app would need

    def config(self): # what params?
    	if "first use":
    		# how do we check that it's first use?
    	else :
    		# when we want to change somthing in the config

    def check_auth(self):
    	# check if the app can do stuff 
    	return False

    def start(self):
    	if check_auth():
    		# do the stuff
    	else:
    		# error because the app is not authorised

    def stop(self):
    	if check_auth():
    		# stop me!
    	else:
    		# can't stop me!

APP = BlankApp

@@ -13,16 +13,28 @@
 ng, json
+, subprocess
 %0Afrom in
@@ -152,19 +152,16 @@
 rt Blank
-App
 %0A%0Aclass 
@@ -298,70 +298,174 @@
     
-self.app = BlankApp() # with any params a real app would need%0A
+manifest_data = open('manifest.json')%0A        self.manifest = json.load(manifest_data)%0A        manifest_data.close()%0A%0A    def _get_indx_creds(self):%0A        %0A        
 %0A   
@@ -469,16 +469,20 @@
     def 
+set_
 config(s
@@ -484,16 +484,25 @@
 fig(self
+, request
 ): # wha
@@ -519,135 +519,506 @@
     
-%09if %22first use%22:%0A    %09%09# how do we check that it's first use?%0A    %09else :%0A    %09%09# when we want to change somthing in the config
+    # when we want to change something in the config%0A        # invoke external process to set their configs%0A        %0A        # get theconfiguraiton we want to set out of request%0A        # do that thang here%0A        config = %7B%7D%0A        jsonconfig = json.dumps(config)%0A        # somewhere inside this we have put %7B0%7D wildcard so we wanna substitute that%0A        # with the actual config obj%0A        expanded = %5Bx.format(jsonconfig) for x in self.manfiest%5B'config'%5D%5D%0A        subprocess.call(expanded)%0A
 %0A%0A  
@@ -1023,16 +1023,17 @@
     def 
+_
 check_au
@@ -1046,17 +1046,20 @@
 f):%0A    
+   
-%09
+ 
 # check 
@@ -1087,17 +1087,20 @@
 ff %0A    
-%09
+    
 return F
@@ -1122,33 +1122,36 @@
 tart(self):%0A    
-%09
+    
 if check_auth():
@@ -1155,18 +1155,24 @@
 ():%0A    
-%09%09
+        
 # do the
@@ -1178,21 +1178,25 @@
 e stuff%0A
+%0A    
     
-%09
 else:%0A  
@@ -1197,18 +1197,24 @@
 se:%0A    
-%09%09
+        
 # error 
@@ -1272,17 +1272,20 @@
 f):%0A    
-%09
+    
 if check
@@ -1297,18 +1297,24 @@
 ():%0A    
-%09%09
+        
 # stop m
@@ -1320,17 +1320,20 @@
 me!%0A    
-%09
+    
 else:%0A  
@@ -1338,10 +1338,16 @@
     
+  
-%09%09
+      
 # ca
@@ -1360,16 +1360,18 @@
 op me!%0A%0A
+%0A%0A
 APP = Bl

test app that doesn't do anything