示例#1
0
    def format(self):
        l = 80
        obj = self.getattrOnly(constants.OBJECT_KEY)

        result =  '\n#' + '='*(l-2) + '\n'
        result += '# %s\n' % obj
        result += '#' + '='*(l-2) + '\n\n'

        for key, value in self.iteritems():
            if value is not None:
                result += '#' + '-'*(l-2) + '\n'
                result += '# %s\n' % key
                result += '#' + '-'*(l-2) + '\n'
                result += io.formatDictItems(value,
                                             '{key:20} : {value!s}\n'
                                            )
            #end if
        #end for
        return result
示例#2
0
文件: Adict.py 项目: jakesyl/cing
 def formatItems(self, fmt='{key:20} : {value!s}\n'):
     return io.formatDictItems(self, fmt)
示例#3
0
文件: main.py 项目: jakesyl/cing
def pfd( object ):
    print io.formatDictItems( object )