コード例 #1
0
	def __findRequest(self, uri):
		"""
			Searches the config resources list to find the correct mapping of URI to Request class

			Arguements:
				uri

			Raises:
				LookupError - no resource/request mapping found in the config file
		"""
		from Common.config import TopHatConfig

		for entry in TopHatConfig.getKey("resources"):
			if entry[0] == uri:
				return entry[1]
	
		if self.uri[-1:] is "/":
			(uri, sep, self.arg) = self.uri[0:-1].rpartition("/")
		else:
			(uri, sep, self.arg) = self.uri.rpartition("/")

		uri += sep

		for entry in TopHatConfig.getKey("resources"):
			if entry[0] == uri:
				return entry[1]

		raise LookupError("No request/resource mappping found in the config file for URI %s" % uri)
コード例 #2
0
    def __findRequest(self, uri):
        """
			Searches the config resources list to find the correct mapping of URI to Request class

			Arguements:
				uri

			Raises:
				LookupError - no resource/request mapping found in the config file
		"""
        from Common.config import TopHatConfig

        for entry in TopHatConfig.getKey("resources"):
            if entry[0] == uri:
                return entry[1]

        if self.uri[-1:] is "/":
            (uri, sep, self.arg) = self.uri[0:-1].rpartition("/")
        else:
            (uri, sep, self.arg) = self.uri.rpartition("/")

        uri += sep

        for entry in TopHatConfig.getKey("resources"):
            if entry[0] == uri:
                return entry[1]

        raise LookupError(
            "No request/resource mappping found in the config file for URI %s"
            % uri)
コード例 #3
0
    def __init__(self, ):
        super(Version, self).__init__()

        from Common.config import TopHatConfig

        self._version = TopHatConfig.getKey("Version")
        self._gameVersion = TopHatConfig.getKey("GameVersion")
        self._serverName = TopHatConfig.getKey("ServerTitle")
コード例 #4
0
	def __init__(self,):
		super(Version, self).__init__()

		from Common.config import TopHatConfig

		self._version = TopHatConfig.getKey("Version")
		self._gameVersion = TopHatConfig.getKey("GameVersion")
		self._serverName = TopHatConfig.getKey("ServerTitle")