(self)
return builder.to_string()
builds a full xml snapshot xml including all metadata
builds a full xml snapshot xml including all metadata
builds a full xml snapshot xml including all metadata
def get_full_snapshot_xml(self):
        '''builds a full xml snapshot xml including all metadata'''
        snapshot_xml = self.get_xml_value("snapshot")

        from pyasm.checkin import SnapshotBuilder
        builder = SnapshotBuilder(snapshot_xml)
        root = builder.get_root_node()

        version = self.get_value("version")
        Xml.set_attribute(root, "version", version )

        description = self.get_value("description")
        Xml.set_attribute(root, "description", description )


        # find the path for each file
        file_nodes = snapshot_xml.get_nodes("snapshot/file")
        for file_node in file_nodes:
            file_code = Xml.get_attribute(file_node, "file_code")
            file_object = File.get_by_code(file_code)

            checkin_dir = file_object.get_value("checkin_dir")
            source_path = file_object.get_value("source_path")

            to_name = file_object.get_full_file_name()

            file_type = Xml.get_attribute(file_node, "type")
            client_dir = self.get_client_lib_dir(file_type=file_type)
            web_dir = self.get_remote_web_dir(file_type=file_type)

            file_node = snapshot_xml.get_node("snapshot/file[@name='%s']" % to_name)
            assert file_node is not None
            Xml.set_attribute(file_node, "checkin_dir", checkin_dir )
            Xml.set_attribute(file_node, "client_dir", client_dir )
            Xml.set_attribute(file_node, "web_dir", web_dir )
            Xml.set_attribute(file_node, "source_path", source_path )

        return builder.to_string()
def get_full_snapshot_xml ( self ) : snapshot_xml = self . get_xml_value ( "snapshot" ) from pyasm . checkin import SnapshotBuilder builder = SnapshotBuilder ( snapshot_xml ) root = builder . get_root_node ( ) version = self . get_value ( "version" ) Xml . set_attribute ( root , "version" , version ) description = self . get_value ( "description" ) Xml . set_attribute ( root , "description" , description ) # find the path for each file file_nodes = snapshot_xml . get_nodes ( "snapshot/file" ) for file_node in file_nodes : file_code = Xml . get_attribute ( file_node , "file_code" ) file_object = File . get_by_code ( file_code ) checkin_dir = file_object . get_value ( "checkin_dir" ) source_path = file_object . get_value ( "source_path" ) to_name = file_object . get_full_file_name ( ) file_type = Xml . get_attribute ( file_node , "type" ) client_dir = self . get_client_lib_dir ( file_type = file_type ) web_dir = self . get_remote_web_dir ( file_type = file_type ) file_node = snapshot_xml . get_node ( "snapshot/file[@name='%s']" % to_name ) assert file_node is not None Xml . set_attribute ( file_node , "checkin_dir" , checkin_dir ) Xml . set_attribute ( file_node , "client_dir" , client_dir ) Xml . set_attribute ( file_node , "web_dir" , web_dir ) Xml . set_attribute ( file_node , "source_path" , source_path ) return builder . to_string ( )