Пример #1
0
	def get_from_web(self,url):
		setdefaulttimeout(4.0)
		url = urlparse.urlparse(url)
		HOST = url.netloc
		PORT = 80
		try:
			s = socket(AF_INET, SOCK_STREAM)
		except error as msg:
			s = None

		s.settimeout(4.0)


		s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)

		try:
			s.connect((HOST, PORT))
		except error as msg:
			s.close()
			s = None

		if s!=None:
			s.send("GET http://www.opvdm.com/update.php?ver_core="+ver_core()+"&ver_gui="+ver_gui()+"&ver_mat="+ver_mat()+"&os="+platform.platform()+"&"+" HTTP/1.0" +CRLF)
			data = (s.recv(1000000))

			s.shutdown(1)
			s.close()
			self.text=data.split('charset=UTF-8\r\n\r\n', 1)[-1]
			gobject.idle_add(gobject.GObject.emit,self,"got-data")
Пример #2
0
	def debug(self):
		self.server_check_user()
		#Transmit debug info
		a=http_get()
		params = {'action':"new_sim",'ver_core': ver_core()+"."+ver_subver()+" "+self.reg_client_ver, 'uid': self.get_uid(), 'opengl': str(self.open_gl_working)}
		#'lang': get_full_language(),'disk_speed': get_disk_speed() ,'os': platform.platform()
		tx_string="http://"+self.website+self.port+"/debug?"+urllib.parse.urlencode(params)
		lines=a.get(tx_string)
Пример #3
0
	def tx_error(self,n):
		page="http://www.gpvdm.com/bug.html?ver_core="+ver_core()+"error="+quote(self.error)
		message=get_data_from_web(page)
		print("from web:",message)
		if message.startswith("ok")==True:
			self.reported.emit(True)
		else:
			self.reported.emit(False)
Пример #4
0
	def tx_error(self,n):
		page="http://www.gpvdm.com/bug.html?ver_core="+ver_core()+"."+ver_subver()+"error="+quote(self.error)
		message=get_data_from_web(page)
		print("from web:",message)
		if message.startswith("ok")==True:
			self.reported.emit(True)
		else:
			self.reported.emit(False)
Пример #5
0
	def get_from_web(self,url):
			page="http://www.gpvdm.com/download_windows/update.php?ver_core="+ver_core()+"."+ver_subver()+"&uid="+uid_get()+"&os="+platform.platform()+"&opengl="+is_open_gl_working()+"&lang="+get_full_language()+"&bugs="+bugs_to_url()+"&disk_speed="+get_disk_speed()
			message=get_data_from_web(page)

			message=message.split("\n")
			#print(message)
			self.text=""
			if message[0].startswith("update"):
				token,ver=message[0].split("#")
				self.text="Version "+ver+" of opvdm is now available."
			self.got_data.emit(self.text)
Пример #6
0
	def get_from_web(self,url):
			page="http://www.gpvdm.com/download_windows/update.php?ver_core="+ver_core()+"&ver_mat="+ver_mat()+"&os="+platform.platform()+"&opengl="+is_open_gl_working()
			message=get_data_from_web(page)

			message=message.split("\n")
			print(message)
			self.text=""
			if message[0].startswith("update"):
				token,ver=message[0].split("#")
				self.text="Version "+ver+" of opvdm is now available."
			self.got_data.emit(self.text)
Пример #7
0
	def report_bug(self,data):
		#Transmit debug info
		a=http_get()
		params = {'action':"crash_report",'ver_core': ver_core()+"."+ver_subver()+" "+self.reg_client_ver, 'uid': self.get_uid(),'data':data.replace("\n"," ")}
		tx_string="http://"+self.website+self.port+"/debug?"+urllib.parse.urlencode(params)
		lines=a.get(tx_string)