From siropio at gmail.com Thu Jan 6 08:14:45 2011 From: siropio at gmail.com (John Giftakis) Date: Thu, 6 Jan 2011 09:14:45 +0200 Subject: [PyAthens] =?iso-8859-7?b?0P7yIO3hIHN1Ym1pdCDs6eEgSFRNTCBmb3Jt?= =?iso-8859-7?b?IOzlIEphdmFzY3JpcHQg8/Tv6ffl3+E/?= Message-ID: ??????? ??????, ?? ????? ??? ???????? ??? ?? ??? ???????? ??? ???. ???? ?? ???? ???????? SUBMIT ?????? ?? ??? script ?? Python. ???? ? ????? ???????? ???? ???????? HTML ?? ??? ????????? ??? ????? ??????? ?????? ??? ?? ??? Library mechanize ???? ??? ?? ??? ???? urllib2. ?? ???? ??? ????? ??? ????? ?? ???? submit ??? ????? ???? ???? ???? Javascript. ??????????: ???? ??? ????? ??? ???? ?????: >
> > ??????????:  > > ???????:  > > > > src="/Portals/_default/Skins/fsa/images/search1.gif" onClick="if > (!validateitems()) return false;" alt="?????????"> >
A? ? form ???? ???? HTML ???? ?? ??? mechanize ?? ????????? ?? ?????? ?? ????:(???? ??? ?????????? ??????? ??? ??????? ????????) import mechanize > > br = mechanize.Browser() > br.open("http://www.example.com") > br.select_form(predicate=lamda(form): 'form1' in form.action) > br['dateduty'] = '6/1/2011' > br['areaid'] = '83' > > response = br.submit() ???? ? Javascript ?? ????????? ??????? ??? ??????????? ??? onclick ??? onchange. ????????? ?? ??? ????????????????? ??????? - ???????? - www.digitalfairytales.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpessas at gmail.com Thu Jan 6 10:35:54 2011 From: mpessas at gmail.com (Apostolos Bessas) Date: Thu, 6 Jan 2011 11:35:54 +0200 Subject: [PyAthens] =?utf-8?b?zqDPjs+CIM69zrEgc3VibWl0IM68zrnOsSBIVE1MIGZv?= =?utf-8?b?cm0gzrzOtSBKYXZhc2NyaXB0IM+Dz4TOv865z4fOtc6vzrE/?= In-Reply-To: References: Message-ID: 2011/1/6 John Giftakis : > ??????? ??????, > > ?? ????? ??? ???????? ??? ?? ??? ???????? ??? ???. > ???? ?? ???? ???????? SUBMIT ?????? ?? ??? script ?? Python. ???? ? ????? > ???????? ???? ???????? HTML ?? ??? ????????? ??? ????? ??????? ?????? ??? ?? > ??? Library mechanize ???? ??? ?? ??? ???? urllib2. > > ?? ???? ??? ????? ??? ????? ?? ???? submit ??? ????? ???? ???? ???? > Javascript. > > ??????????: > > ???? ??? ????? ??? ???? ?????: >> >>
> ? ? >> ? ? >> ? ???????????:  >> ? ? ? ? >> ? ? ? ????????:  >> ? ? >> ? ? ? >> >> ? ? ? ? > src="/Portals/_default/Skins/fsa/images/search1.gif" onClick="if >> (!validateitems()) return false;" alt="?????????"> >>
> > A? ? form ???? ???? HTML ???? ?? ??? mechanize ?? ????????? ?? ?????? ?? > ????:(???? ??? ?????????? ??????? ??? ??????? ????????) > >> import mechanize >> >> br = mechanize.Browser() >> br.open("http://www.example.com") >> br.select_form(predicate=lamda(form): 'form1' in form.action) >> br['dateduty'] = '6/1/2011' >> br['areaid'] = '83' >> >> response = br.submit() > > ???? ? Javascript ?? ????????? ??????? ??? ??????????? ??? onclick ??? > onchange. > > > ????????? ?? ??? ????????? > > ???????? ??????? - ???????? - www.digitalfairytales.com > > > _______________________________________________ > PyAthens mailing list > PyAthens at python.org > http://mail.python.org/mailman/listinfo/pyathens > > ?? ??? ???? ????? ?? ?????? ???' ??????? POST request ?? ?? urllib2, ???? ??? (??? http://docs.python.org/library/urllib2.html): import urllib import urllib2 data = {'prevcat': 'value', 'prevcat1': 'value1', 'dateduty': '6/1/2011', 'areaid': '83'} enc_data = urllib.urlencode(data) urllib2.urlopen(url, enc_data) ? ??? ??????????? ??????? ?? ???????? ??? ??? ?????????? ? javascript; ????????? From siropio at gmail.com Thu Jan 6 21:50:43 2011 From: siropio at gmail.com (John Giftakis) Date: Thu, 6 Jan 2011 22:50:43 +0200 Subject: [PyAthens] =?iso-8859-7?b?0P7yIO3hIHN1Ym1pdCDs6eEgSFRNTCBmb3Jt?= =?iso-8859-7?b?IOzlIEphdmFzY3JpcHQg8/Tv6ffl3+E/?= Message-ID: ?????? ???? ????? ??? ????? ???? ????????? ??? ??????? ????? ???? ???????? ????????? ??????. ??? ?? ???? ??? ?????: ???? ?? ?????? ???????? ??? ????????? ??? ?????????? ???????. ????? site --> http://www.fsa.gr/duties.asp ????? ???? ?? ?? script ?? ???? fetch ??? ?????? ?????? ??? ?? Submit. ???? ?? URL ??? ??????? ??? ?????? ??? ?? Submit. ????????? ???? ????? ?? link ???? ?? Submit ????? ??? ???? Source Code ???? browser ?? ???????????? ????????. ??? ????????? ??? ??????? ? ????? AJAX. ?? ???? ????? ??? ???? browser ??????? ??? ?? ?? ??? ??? ??? script ???? ????? fetch ??? source code? ???????? ???????? ??? ?????? ??? ?????????????. (????????????? ??? opener ????? ???? ??? ????????? login ??? ???? ??? ??? ???????????) *#!/usr/bin/env python #coding=utf-8 import urllib, urllib2, cookielib file = "./svise_me" url_action = "http://www.fsa.gr/duties.asp" url_index = "http://www.fsa.gr/duties.asp" url_topic = "http://www.fsa.gr/duties.asp" def getConnection(url_action): cj = cookielib.LWPCookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) urllib2.install_opener(opener) opener.addheaders=[('Content-Type','application/x-www-form-urlencoded'),('Connection','keep-alive'),('User-Agent','Mozilla/5.0')] params = urllib.urlencode({'action':url_action , 'referer':url_index, 'dateduty':"6/1/2011", 'areaid':86, 'enctype':"multipart/form-data"}) f = opener.open(url_action, params) f.close() f = opener.open(url_action, params) f.close() return opener def get_source_code( opener, url_x ): f = opener.open(url_x) data = f.read() print type(data) f.close() return data def keep_log( data, file ): f = open(file, 'w') f.write(data) f.close() opener = getConnection(url_action) src_code = get_source_code(opener, url_topic) print src_code keep_log(src_code, file)* -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzot at medbar.gr Thu Jan 6 21:56:10 2011 From: tzot at medbar.gr (Christos Georgiou) Date: Thu, 06 Jan 2011 22:56:10 +0200 Subject: [PyAthens] =?iso-8859-7?b?0P7yIO3hIHN1Ym1pdCDs6eEgSFRNTCBmb3Jt?= =?iso-8859-7?b?IOzlIEphdmFzY3JpcHQg8/Tv6ffl3+E/?= In-Reply-To: References: Message-ID: <4D262C6A.8080109@medbar.gr> On 2011-01-06 22:50, John Giftakis wrote: > ?????? ???? ????? ??? ????? ???? ????????? ??? ??????? ????? ???? > ???????? ????????? ??????. > ??? ?? ???? ??? ?????: > > ???? ?? ?????? ???????? ??? ????????? ??? ?????????? ???????. ??? ?????????? ??????? ?? ??? ??????, ????? ??? ???????? ??? ??????????? ???? ??? ??? ????????? ?????????? (?????????? ?? ??? ??? ?? ????? ??? ?????? ????????, ?????? ?? ????????? ?? ?????? ?????? ??? GPS), ??? ?????? ??? ??????? ??? ?????? ????????? ????????: http://www.e-database.gr/Pharmacy_Duties/Now ??? ????????? ???? ???? ?????, ?? ?????: http://www.e-database.gr/Pharmacy_Duties/Now/36 From mpessas at gmail.com Thu Jan 6 23:52:00 2011 From: mpessas at gmail.com (Apostolos Bessas) Date: Fri, 7 Jan 2011 00:52:00 +0200 Subject: [PyAthens] =?utf-8?b?zqDPjs+CIM69zrEgc3VibWl0IM68zrnOsSBIVE1MIGZv?= =?utf-8?b?cm0gzrzOtSBKYXZhc2NyaXB0IM+Dz4TOv865z4fOtc6vzrE/?= In-Reply-To: References: Message-ID: 2011/1/6 John Giftakis : > ?????? ???? ????? ??? ????? ???? ????????? ??? ??????? ????? ???? ???????? > ????????? ??????. > ??? ?? ???? ??? ?????: > > ???? ?? ?????? ???????? ??? ????????? ??? ?????????? ???????. > ????? site --> http://www.fsa.gr/duties.asp > ????? ???? ?? ?? script ?? ???? fetch ??? ?????? ?????? ??? ?? Submit. > > ???? ?? URL ??? ??????? ??? ?????? ??? ?? Submit. ????????? ???? ????? ?? > link ???? ?? Submit ????? ??? ???? Source Code ???? browser? ?? ???????????? > ????????. ??? ????????? ??? ??????? ? ????? AJAX. > > ?? ???? ????? ??? ???? browser ??????? ??? ?? ?? ??? ??? ??? script ???? > ????? fetch ??? source code? > ???????? ???????? ??? ?????? ??? ?????????????. > (????????????? ??? opener ????? ???? ??? ????????? login ??? ???? ??? ??? > ???????????) > > > #!/usr/bin/env python > #coding=utf-8 > import urllib, urllib2, cookielib > > file = "./svise_me" > > url_action = "http://www.fsa.gr/duties.asp" > url_index = "http://www.fsa.gr/duties.asp" > url_topic = "http://www.fsa.gr/duties.asp" > > def getConnection(url_action): > ??? cj = cookielib.LWPCookieJar() > ??? opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) > ??? urllib2.install_opener(opener) > > opener.addheaders=[('Content-Type','application/x-www-form-urlencoded'),('Connection','keep-alive'),('User-Agent','Mozilla/5.0')] > ??? params = urllib.urlencode({'action':url_action , 'referer':url_index, > ??? ??? ??? ??? ??? ??? ??? ??? ? 'dateduty':"6/1/2011", 'areaid':86, > 'enctype':"multipart/form-data"}) > ??? f = opener.open(url_action, params) > ??? f.close() > ??? f = opener.open(url_action, params) > ??? f.close() > ??? return opener > > def get_source_code( opener, url_x ): > ??? f = opener.open(url_x) > ??? data = f.read() > ??? print type(data) > ??? f.close() > ??? return data > > def keep_log( data, file ): > ??? f = open(file, 'w') > ??? f.write(data) > ??? f.close() > > opener = getConnection(url_action) > src_code = get_source_code(opener, url_topic) > print src_code > keep_log(src_code, file) > > _______________________________________________ > PyAthens mailing list > PyAthens at python.org > http://mail.python.org/mailman/listinfo/pyathens > > ?? ???????????? ? ????? AJAX, ???? ??????? ??????????? ?? requests ????? ??? ?? ????? GET (??????? ?? ?????) ? POST (??????? ?? ????????????). ???????? ?? ????????: import urllib, urllib2, cookielib url_action = "http://www.fsa.gr/duties.asp" url_index = "http://www.fsa.gr/duties.asp" url_topic = "http://www.fsa.gr/duties.asp" cj = cookielib.LWPCookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) urllib2.install_opener(opener) opener.addheaders=[('Content-Type','application/x-www-form-urlencoded'),('Connection','keep-alive'),('User-Agent','Mozilla/5.0')] params = urllib.urlencode({'action':url_action , 'referer':url_index, 'dateduty':"6/1/2011", 'areaid':86, 'enctype':"multipart/form-data"}) f = opener.open(url_action, params) print f.read() f.close() ??????, ?????? print ?? ????? ?????? (GET request ???? ??? POST). ?? ??? ?? ?????????? ??? ????, ?????? ??? ?? ????????: import urllib import urllib2 url = 'http://www.fsa.gr/duties.asp' data = { 'dateduty': '9/1/2011', 'areaid': '95' } enc_data = urllib.urlencode(data) f = urllib2.urlopen(url, enc_data) print f.read() ????????? PS ????? ???? ????, ?? ??????? ??? ??? ???????????? ??? urllib2, ????? ?????? ????? ??? ???????? ?? ???? ?????? ?????. From siropio at gmail.com Fri Jan 7 06:25:53 2011 From: siropio at gmail.com (John Giftakis) Date: Fri, 7 Jan 2011 07:25:53 +0200 Subject: [PyAthens] =?iso-8859-7?b?0P7yIO3hIHN1Ym1pdCDs6eEgSFRNTCBmb3Jt?= =?iso-8859-7?b?IOzlIEphdmFzY3JpcHQg8/Tv6ffl3+E/?= Message-ID: > > ??? ?????????? ??????? ?? ??? ??????, ????? ??? ???????? ??? ??????????? > ???? ??? ??? ????????? ?????????? (?????????? ?? ??? ??? ?? ????? ??? > ?????? ????????, ?????? ?? ????????? ?? ?????? ?????? ??? GPS), ??? > ?????? ??? ??????? ??? ?????? ????????? ????????: > > http://www.e-database.gr/Pharmacy_Duties/Now > > ??? ????????? ???? ???? ?????, ?? ?????: > http://www.e-database.gr/Pharmacy_Duties/Now/36 > > ???? ??????? ?? site ????????? ????, *??????*! *????????* ? ??????? ??? ??? ????????? ?????? ????? :) ??? ???? ??????? ??? ??? ????? ???????? ??? ??? ????? ????? ???? ???? ????? ????? ??? ?? ??? ?????? ?????. ??? ????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From openfest at teipir.gr Thu Jan 20 09:36:01 2011 From: openfest at teipir.gr (openfest2011) Date: Thu, 20 Jan 2011 10:36:01 +0200 Subject: [PyAthens] =?iso-8859-7?b?0PH88+rr5/PnIPP17Ozl9O/33vIg8/TvIE9w?= =?iso-8859-7?q?enFest_2011?= Message-ID: ?? ?????? ?? ??? ???????????? ??? ?? *OpenFest 2011,* ?? ???????? ???????? ?????? ??? ????????? ??????????, ?? ????? ???????????? ??? ??????? ?????????? ?????? ??? ??? ?????? ??? ???????? *?*??????????? *?*???????????? *?*????????? ??? *???? ???????*.?? ??????????????? ???? *9 ??? 10 ???????? 2011* ?????? ??? ?????????? ????? ?? ???????????? ?? ???????? ??? ??????? ????????? ??? ?????. ?? ???????, ??????????, ????? ??? ?? ???????????? ??????????? ??? ??? ?????????? ??? ???????????? ??? ??????? ???. ?? *????????? ????????* ?? ????????? ??? ???????? ??????? 1? ???????? ??????? : ???????? Open Source ???? ?????????? ??? ?? ??????? 2? ???????? ??????? : ?????? ????????? 3? ???????? ??????? : ?????? ??????? ??????? & ?????? ????? (patents,copyright) 4? ???????? ??????? : OS / Open Source 5? ???????? ??????? : Web / Networks / Programming 6? ???????? ??????? : Mobile/ Embedded Developemnt *??? ??????? ??????*, ?? ???????? ??? ????????? ??? ??? ?? ????????? ??? ????? ??? ??????/??????????, ??? ?????? ?????? ???? ??? ?? ?????????, ?? ????????? ?????, ? ??? ?? ?????????? ??? ?????????? ??? ???????????. ?????? ??????? ? ??????????, ?????? ?? ?????????, ?? ?????? ??? ?????????? ??? project ???, ?? ????? *Workshops*. ???????? ?? *???????? ????????? ????? 15 ???????????* ??? * http://openfest.teipir.gr* ?? ????????? ? ???????? ??? OpenFest 2011, ??????????????????? ??? ??????? ??? ?? ????????? ??? ????????? (abstract). *?????????? ????????* *?penfest 2011* -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian.curtin at gmail.com Thu Jan 27 21:49:31 2011 From: brian.curtin at gmail.com (Brian Curtin) Date: Thu, 27 Jan 2011 14:49:31 -0600 Subject: [PyAthens] PSF Sprints - Call For Applications Message-ID: Hello Athens Python Users! On behalf of the Python Software Foundation?s sponsored sprint group, I wanted to drop your group a quick note introducing us. If you?re already familiar with our sponsored sprints, you?ll be happy to know we made a few changes to help both sprint groups and Python even more. The PSF recently set aside funding to be distributed to groups who spend time contributing to the Python ecosystem, often in the form of development sprints. Our goal is to help you help Python, so whether it?s buying meals or renting meeting space for your all-day hackathon, we have a budget set aside to reimburse your expenses up to $300 USD (up from $250). If your goal is to make the Python world a better place, and you work on the problems facing Python today, we want to help you. We?re looking for groups of hackers that spend their time fixing and expanding the wide variety of Python interpreters, libraries, tools, and anything else affecting the community.We?re also looking for groups who want to help and get started but don?t have the resources to get together. Whether your group is separated by a train ride or lacking a shared space, we want to help you. On-boarding new contributors to open source Python projects is an especially important area that we?d like to work with.This means if you have a Python project and you want to sprint -- we want to help you.Some sprints we?ve sponsored include the porting of Genshi to Python 3, improvements to packaging (Distribute/distutils), and most recently, the PyPy winter sprint in Switzerland. If your group is interested in hosting a sprint, check out the full details of our call for applications at http://www.pythonsprints.com/cfa/ and contact us at sprints at python.org. Thanks for your time, and happy sprinting! Brian Curtin Jesse Noller http://www.pythonsprints.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthony at itia.ntua.gr Sun Jan 30 19:45:17 2011 From: anthony at itia.ntua.gr (Antonis Christofides) Date: Sun, 30 Jan 2011 20:45:17 +0200 Subject: [PyAthens] Thread-safe global Message-ID: <4D45B1BD.1040302@itia.ntua.gr> ??????? ?????? ?? ??? ???? ??? ?? ??????? ?? global variable ???? ?? ????? thread safe? ?????? ?? ????? ?? ??? ????? ??? ???? (??????????? ???????? ??? ?????????) ??? ???????? ?? ????? ?? ???????? ???? ??? ???? (??????????? ???????? ??? ???? ?????????)? ???? ??? ???????? ?? ???? ????? ??? manager ??? django ??? ?? ???? ???????? ??? request object, ??? ? ????? ??? ??? ????? ???? ?? ?? ???? ???? ????? ????? ???? ? manager ?? ?????????? ???? ?? ??????????? ??? ????? ???? ???????? ????????? ? request.user, ???? ???? ?? ???????? ?? ?????????????? ?? ?????? ???????. ??? ??????? ??? ????? ?? ?? ????, ???? ??????????? ??? ??????? ?? ????? ??? ?????, ????? ?? ??? ????????????? ??? ?????. From orestis at orestis.gr Sun Jan 30 21:06:18 2011 From: orestis at orestis.gr (Orestis Markou) Date: Sun, 30 Jan 2011 22:06:18 +0200 Subject: [PyAthens] Thread-safe global In-Reply-To: <4D45B1BD.1040302@itia.ntua.gr> References: <4D45B1BD.1040302@itia.ntua.gr> Message-ID: <2C822581-B38C-493E-89F2-F93F305FCBA6@orestis.gr> ????????? ??????, ???????? - ??? ???????: http://docs.python.org/library/threading.html#threading.local (?????????? ????? ??? ???? thread) ???????????? - ?????? ??? ? ?????????? ??? ????? ??????????. ??? ???????????? ??? ??? ????? ??? ???????? ??? (??? ????? ?? ???????? ?? ???? ?? ??????? ??? ????????, ?????? ?? ??????? ?????): ????? ??? ??????? ??????????? ???? manager ??? ?? ??? ?????? ???????????? ?? request.user; class UserSavvyManager(...): def get_rows_for_user(self, user): pass ? ???????????, ????? ??? model ??? ????????? ??? ?? ?????????? ???? manager ???? ??? ????? ??? ?????? (??????? ?? ?????? ??? caching/memoization ?? ?? ????????? ?? performance): class MyManager(Manager): def __init__(self, user): self.user = user def get_query_set(self): qs = Manager.get_query_set(self) return qs.filter(user=self.user) class MyModel(models.Model): def get_objects(self, user): manager = MyManager(user) return manager On 30 Jan 2011, at 20:45, Antonis Christofides wrote: > ??????? ?????? ?? ??? ???? ??? ?? ??????? ?? global variable ???? ?? > ????? thread safe? ?????? ?? ????? ?? ??? ????? ??? ???? (??????????? > ???????? ??? ?????????) ??? ???????? ?? ????? ?? ???????? ???? ??? > ???? (??????????? ???????? ??? ???? ?????????)? > > ???? ??? ???????? ?? ???? ????? ??? manager ??? django ??? ?? ???? > ???????? ??? request object, ??? ? ????? ??? ??? ????? ???? ?? ?? ???? > ???? ????? ????? ???? ? manager ?? ?????????? ???? ?? ??????????? ??? > ????? ???? ???????? ????????? ? request.user, ???? ???? ?? ???????? ?? > ?????????????? ?? ?????? ???????. > > ??? ??????? ??? ????? ?? ?? ????, ???? ??????????? ??? ??????? ?? > ????? ??? ?????, ????? ?? ??? ????????????? ??? ?????. > > _______________________________________________ > PyAthens mailing list > PyAthens at python.org > http://mail.python.org/mailman/listinfo/pyathens