Пример #1
0
    def show_map(self):
        """
		Print a user sensable view of the object map
		"""
        if not self.vTree:
            self._build_vTree()
        utils.print_array(self.obj_map)
Пример #2
0
    def inspect(self, filter='dict'):
        """
		print object info
		"""
        print "OBJECT >>>"
        if filter == 'full':
            index = {}
            for key in dir(self):
                key_type = type(eval("self.%s" % key))
                try:
                    index[key_type][key] = eval("self.%s" % key)
                except:
                    index[key_type] = {key: eval("self.%s" % key)}
            utils.print_array(index)
            return 1
        else:
            index = {}
            for key in dir(self):
                key_type = type(eval("self.%s" % key))
                if key_type in [dict, str] and key != "__dict__":
                    try:
                        index[key_type][key] = eval("self.%s" % key)
                    except:
                        index[key_type] = {key: eval("self.%s" % key)}
            utils.print_array(index)
            return 1
Пример #3
0
        # first create the workspace
        parent = '/stonefs%d/%s' % (partition, project)
        self._create_node(parent, 'WORKSPACE', library)

    def create_subfolder(self, partition, project, library, subfolder):
        """
		+ nodeID => /stonefs7/proj07/WT_LIB01/MEDIA_LIBRARY/dir01
		+ type => LIBRARY
		"""
        parent = '/stonefs%d/%s/%s/MEDIA_LIBRARY' % (partition, project,
                                                     library)
        self._create_node(parent, 'LIBRARY', subfolder)

if __name__ == '__main__':
    w = Wiretap('flame02')
    print_array(
        w._get_children('stonefs4/13E542-Nike_Id/kevins/MEDIA_LIBRARY'))
    #	print_array(w._get_children('stonefs4/workspace_test/workspace3/MEDIA_LIBRARY'))
    #	w.create_subfolder(1,'2013_2_53_proj01','hacker','Default Library')

    # NOTES: Creating a project is still pretty straight forward
    #        Creating a shared library is weird though. You create
    #	   a 'workspace' which is what a shared library really is.
    #	w.create_project(7,'proj07')
    #	w.create_shared_library(7,'proj07','WT_LIB02')
    #	w.create_subfolder(7,'proj07','WT_LIB02','sf02')
    #	w.create_subfolder(7,'proj07','WT_LIB02','sf03')
    #	w.create_subfolder(7,'proj07','WT_LIB02','sf04')
    #	w.create_subfolder(7,'proj07','WT_LIB02','sf05')
    #	w.create_user(5,'wt_user01')

    #	w.create_desktop(7,'proj07','workspace','Desktop')
Пример #4
0
    def show(self, **kwargs):
        """
		Print a user sensable view of the vTree
		"""
        self._build_vTree(**kwargs)
        utils.print_array(self.vTree)
Пример #5
0
 def tina_listcart(self, label):
     obj = TinaListCart(label)
     obj.run()
     print_array(obj.data)
Пример #6
0
 def tina_cart_control(self, **kwargs):
     obj = TinaCartControl(**kwargs)
     obj.run()
     print_array(obj.data)
Пример #7
0
 def tina_find(self, **kwargs):
     obj = TinaFind(**kwargs)
     obj.run()
     print_array(obj.data)