Example #1
0
 def readCode(self, modulepath=None):
     result = Bag()
     modulepath = modulepath or sys.modules[self.__module__].__file__
     with open(modulepath, "r") as source_code:
         red = RedBaron(source_code.read())
     result.fromJson(red.fst())
     return result
Example #2
0
 def readCode(self,modulepath=None):
     result=Bag()
     modulepath=modulepath or sys.modules[self.__module__].__file__
     with open(modulepath, "r") as source_code:
         red = RedBaron(source_code.read())
     result.fromJson(red.fst())
     return result
Example #3
0
 def infoPanel(self,pane):
     info = Bag()
     info.fromJson(self.docker.info())
     version = Bag()
     version.fromJson(self.docker.version())
     pane.data('.info',info)
     pane.data('.version',version)
     box = pane.div(margin='10px')
     box.div('Info',color='#2A7ACC',font_weight='bold',line_height='40px',padding='5px',font_size='18px')
     box.div('==_v.getFormattedValue({nested:true})',_v='^.info')
     box = pane.div(margin='10px')
     box.div('Version',color='#2A7ACC',font_weight='bold',line_height='40px',padding='5px',font_size='18px')
     box.div('==_v.getFormattedValue({nested:true})',_v='^.version')
Example #4
0
 def getLocalImages(self):
     result = Bag()
     images = self.docker.images()
     if not images:
         return result
     for i,img in enumerate(images):
         r = Bag()
         r.fromJson(img,listJoiner=',')
         r['Id'] = r['Id'][0:8]
         r['ParentId'] = r['ParentId'][0:8]
         r['name'] = img['RepoTags'][0]
         result['r_%i' %i] = r
     return result
Example #5
0
 def getContainerDetails(self,container=None):
     inspect = Bag()
     changes = Bag()
     inspect.fromJson(self.docker.inspect_container(container))
     changes.fromJson(self.docker.diff(container))
     return Bag(dict(inspect=inspect,changes=changes,logs=self.docker.logs(container)))
Example #6
0
 def getImageDetails(self,image=None):
     inspect = Bag()
     history = Bag()
     inspect.fromJson(self.docker.inspect_image(image))
     history.fromJson(self.docker.history(image))
     return Bag(dict(inspect=inspect,history=history))
Example #7
0
 def getCurrentImages(self):
     result = Bag()
     result.fromJson(self.docker.images(),listJoiner=',')
     return result