Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(16)  |  Derive(0)  |  Import(0)
Imports the required module and returns a new instance of the request
class name. Returns None in case of an error.

        def createClassInstance(name):
	"""Imports the required module and returns a new instance of the request
	class name. Returns None in case of an error.
	"""
	mod = importModule(name)
	if mod:
		try:
			cs = getattr(mod, name)
		except AttributeError, param:
			Log.logDebug("Helper.createClassInstance(): AttributeError: " + str(param), 2)
			Log.logDebug("Helper.createClassInstance(): module '" + name + "' misses class with the same name!", 1)
			return None
		ci = cs()
		return ci
	return None
        


src/s/f/sftf-HEAD/Transaction.py   sftf(Download)
				con = self.dialog.getLocalContact()
			else:
				con = Helper.createClassInstance("Contact")
				con.uri.protocol = "sip"
				con.uri.username = Config.SC_USER_NAME
				con = self.dialog.getLocalContact()
			else:
				con = Helper.createClassInstance("Contact")
				con.uri.protocol = "sip"
				con.uri.username = Config.SC_USER_NAME
			reply.setHeaderValue("Contact", con.create())
			reply.body = []
		cl = Helper.createClassInstance("Contentlength")
		cl.length = Helper.calculateBodyLength(reply.body)
		reply.setHeaderValue("Content-Length", cl.create())

src/s/f/sftf-HEAD/Dialog.py   sftf(Download)
		self.transaction = []
		if neh is not None:
			con = Helper.createClassInstance("Contact")
			con.uri.protocol = "sip"
			con.uri.username = Config.SC_USER_NAME
			return self.remoteContact.uri, None, dst
		else:
			ruri = Helper.createClassInstance("sip_uri")
			ruri.protocol = "sip"
			ruri.username = str(Config.TEST_USER_NAME)
		elif (self.localUri is not None):
			Log.logDebug("Dialog.getLocalContact(): deep-copy localuri", 2)
			con = Helper.createClassInstance("Contact")
			con.uri = copy.deepcopy(self.localUri.uri)
			con.uri.params = []
			con.uri.headers = []
		else:
			con = Helper.createClassInstance("Contact")

src/s/f/sftf-HEAD/SipRequest.py   sftf(Download)
			fLine = fLine[index+1:]
			index = fLine.index(' ')
			self.rUri = Helper.createClassInstance("sip_uri")
			self.rUri.parse(fLine[0:index])
			fLine = fLine[index+1:]

src/s/f/sftf-HEAD/SFTF.py   sftf(Download)
	def readInTestCase(self, _tcname):
		"""Tries to load and add the test case with the given name.
		"""
		tc = Helper.createClassInstance(_tcname)
		if tc:

src/s/f/sftf-HEAD/TestCase.py   sftf(Download)
			i_mapped = Helper.getMappedHFH(i)
			Log.logDebug("TestCase.parseMessage(): HF: " + str(i) + ", mapped: " + str(i_mapped), 5)
			hf = Helper.createClassInstance(i_mapped)
			if hf is not None:
				parse_s = "hf.parse(_message.getHeaderValue(\"" + i + "\"))"
			if ct.subtype is not None:
				parser_class += str(ct.subtype).lower()
			pi = Helper.createClassInstance(parser_class)
			if pi is not None:
				try:
			if repl is None:
				raise SCException("TestCase", "createChallenge", "createReply(407, \"Proxy Authentication Required\", createEvent=False) failed")
			auth = Helper.createClassInstance("Proxyauthenticate")
			if realm is not None:
				auth.realm = realm
			if repl is None:
				raise SCException("TestCase", "createChallenge", "createReply(401, \"Unauthorized\", createEvent=False) failed")
			auth = Helper.createClassInstance("Wwwauthenticate")
			if realm is not None:
				auth.realm = realm
				ruri = copy.deepcopy(trans.firstRequest.rUri)
		elif ruri is None:
			ruri = Helper.createClassInstance("sip_uri")
			ruri.protocol = "sip"
			ruri.username = str(Config.TEST_USER_NAME)