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
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
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')
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
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)))
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))
def getCurrentImages(self): result = Bag() result.fromJson(self.docker.images(),listJoiner=',') return result