BT source code learning experience (9): client source code analysis (Graphic Interface Analysis)Author: Wolfenstein
The client will start from btdownloadgui. py for analysis, so that you can take a look at the GUI programming in Python. The GUI programming in Python also has a lot of content, so it is impossible to analyze it in depth. Just take the source code of Bt as an example.In btdownloadgui. py, GTK is used as the development library for its gr
BT source code learning experience (6): code analysis (initialization) of the Tracking Server (tracker)Author: Wolfenstein
Tracker is an important part in BT. I noticed that this term was directly referenced in previous articles and was not translated. I thought about it and decided to translate it into a tracking server.In BT download, the seed file indicates the information of the file to be downloaded and the message digest code for checking it. Ho
BT source code learning experience (14th): client source code analysis (blocking Management in peer-to-peer connection) Author: Wolfenstein from our previous analysis we can see that when a peer-to-peer connection is established, exchange information through the handshake protocol, so that each connection has a connection object, and then there is a singledownload and upload corresponding to it. This time, we will continue to analyze the handshake pro
is 5-12 digits! ", 'The address length cannot exceed 50 characters! ',' Is a Chinese character within 10 characters! ',' The mobile phone number is 11 digits! ',' The zip code is a six-digit number! ',' The username must be 3-15 characters long! ',' Domain name format error! ',' This user name has been registered! ',' This email address has been registered! ']
Var ErrorClass = ['msg _ OK ', 'msg _ warning', 'msg _ warning', 'msg _ error', 'msg _ warning', 'msg _ error ', 'msg _ warning', 'msg
is 5-12 digits! ", 'The address length cannot exceed 50 characters! ',' Is a Chinese character within 10 characters! ',' The mobile phone number is 11 digits! ',' The zip code is a six-digit number! ',' The username must be 3-15 characters long! ',' Domain name format error! ',' This user name has been registered! ',' This email address has been registered! ']
Var ErrorClass = ['msg _ OK ', 'msg _ warning', 'msg _ warning', 'msg _ error', 'msg _ warning', 'msg _ error ', 'msg _ warning', 'msg
Ec (2); nbsp; the Code below copies the code functionmatchdomain ($ q) {preg_match ([a-z0-9] (w | }? [A-z0-9] | [a-z0-9]).) {1 ,} (aero | arpa | asia | biz | cat | com | coop | co | edu | gov | info | int | jobs | mil | mobi | mu script ec (2 ); script
The Code is as follows:
Function matchdomain ($ q ){Preg_match ('/([a-z0-9] (w | }? [A-z0-9] | [a-z0-9]).) {1 ,} (aero | arpa | asia | biz | cat | com |
ability of Chinese scholars comes from the relatively few feasible ideas. As a result, many scholars in the discussion together, no one is willing to throw their own ideas, for fear of being stolen. As a result, academics are either talking about gossip or discussing the details of others ' results. Don't we say the idea, we really have a good harvest? I believe that the human brain needs a certain degree of intensity of use, and constantly output ideas, in order to make room for later ideas. L
is a six-digit number! ',' The username must be 3-15 characters long! ',' Domain name format error! ',' This user name has been registered! ',' This email address has been registered! ']
Var ErrorClass = ['msg _ OK ', 'msg _ warning', 'msg _ warning', 'msg _ error', 'msg _ warning', 'msg _ error ', 'msg _ warning', 'msg _ warning', 'msg _ error ', 'msg _ error ', 'msg _ error']
(3) I started to write various verification types. I wrote all the information I could think...Copy codeThe Code is as
.HTTPCookieProcessor(cj)) req = urllib2.Request(url, urllib.urlencode(bodyfieleds)) resp = opener.open(req, timeout=60) strlist = resp.read()
The code is simple. this is the charm of python. bodyfieleds is The post parameter and is a dictionary.
3. for asynchronous page requests, the getpage segment of twisted is used as follows:
self.PostDATA[self.passw] = passl #print temp zs = getPage(self.url, method='POST', postdata=urllib.urlencode(self.PostDATA), headers=self.header
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.