From javier at candeira.com Tue Sep 2 00:03:43 2014 From: javier at candeira.com (Javier Candeira) Date: Tue, 2 Sep 2014 08:03:43 +1000 Subject: [melbourne-pug] Thanks for doing MPUG last night Message-ID: Thanks to everyone who attended MPUG last night. Special thanks go to Jason King and Andy Kitchen for presenting, and to Graeme Cross for organising the resources to make giving What's New talks easy for anyone: http://www.curiousvenn.com/2014/08/resources-for-creating-the-whats-new-talks/ Thanks also to Ed Schofield for organising pizza and Graeme for running the session, and to the many folks who helped with moving tables around. It was great to just attend and not have to worry about stuff. Finally, thanks to John Barham for stepping up and proposing a talk for October. We only need a What's New presenter now. By the way, my talk is here: http://tinyurl.com/mpug-sept-2014 See you in October, Javier From tleeuwenburg at gmail.com Wed Sep 3 04:21:28 2014 From: tleeuwenburg at gmail.com (Tennessee Leeuwenburg) Date: Wed, 3 Sep 2014 12:21:28 +1000 Subject: [melbourne-pug] Rounded-value ticks on X axis In-Reply-To: References: Message-ID: Hi Kevin, I have taken to using the Python port of ggplot, available at http://ggplot.yhathq.com/ . I think it's on pip also. It takes pandas dataframes just fine and provides a syntactically shorter route to graph tweaking. It's not perfect, but it solved my problems more easily than getting into the guts of matplotlib. (it is built on top of matplotlib so you can provide mpl tweaks onto the graphs it produces if you really need to). Pandas is not really a complete solution for graphing IMO. Feel free to share some gists of what you are trying to to, I'm happy to try and help out a little. Cheers, -T On 31 August 2014 16:31, Kevin Shackleton wrote: > Unfortunately these matplotlib methods expect the data to be float, where > using pandas I am able to parse and handle the time series data as > datetime. But graphing in pandas does not seem to inherit all the > matplotlib methods (I suppose that would be a mammoth task, including all > the method overlays). I'm forming the opinion that I either do the job in > numpy/matplotlib with extra code to sculpt the exact format I want or I go > the concise and elegant pandas way and live with the loss of control of the > x axis. > > Thanks, > > Kevin > > > On 31 August 2014 12:01, Anthony Briggs wrote: > >> Quick update: http://matplotlib.org/examples/api/date_demo.html and >> http://stackoverflow.com/questions/3677368/matplotlib-format-axis-offset-values-to-whole-numbers-or-specific-number >> mention something called a Formatter. DateFormatter from the first link >> looks like it should do what you're after (convert to a date rather than a >> time). >> >> Anthony >> >> >> >> >> >> On 31 August 2014 13:57, Anthony Briggs wrote: >> >>> Hi Kevin, >>> >>> Looks like it's just pulling those keys from the data, so something to >>> convert those explicitly when you read it in would probably be the easiest >>> way. There might be something in the read_csv function to convert data from >>> a particular column, or you could try a dictionary comprehension per >>> station (something along the lines of station_data = {reading['DT'][:10]: >>> reading for reading in d[stn]}. >>> >>> You seem to have a lot of values for the same day though, so you'd >>> either want to grab just the minimum, or do some sort of formatting in >>> matplotlib. >>> >>> Another method would be to find the minimum value (or minimum 3) for a >>> station and just report a warning if it's below a certain amount, rather >>> than a graph which someone has to interpret. >>> >>> Final point - having a lot of one and two character variables makes it >>> really hard to tell what your script is doing. >>> >>> Hope that helps, >>> >>> Anthony >>> >>> >>> >>> On 31 August 2014 11:11, Kevin Shackleton >>> wrote: >>> >>>> Hi, >>>> >>>> New to Melbourne PUG. Fairly new to Python. >>>> >>>> I have a script that interprets power levels at several automated >>>> surveying total stations working at a site. The idea is to show that the >>>> batteries have enough amp-hours to see the total station through a run of >>>> cloudy days. After 2 or 3 years of battery life the battery amp-hour >>>> capacity will have reduced to a point where the installation will run often >>>> out of power before the solar panels kick in each morning. In practice >>>> this is often affected by 3rd parties hanging extra electrical load on our >>>> installation. >>>> >>>> The data looks like this: >>>> 2014-06-16T18:40:20,HUT1,56 >>>> 2014-06-16T19:02:49,HUT2,15 >>>> 2014-06-16T20:16:12,HUT1,58 >>>> 2014-06-16T20:17:08,HUT2,11 >>>> 2014-06-16T20:51:17,HUT1,67 >>>> 2014-06-17T11:51:05,HUT1,100 >>>> 2014-06-17T11:51:07,HUT2,48 >>>> 2014-06-17T11:51:08,HUT3,57 >>>> where power level readings are coming from each of the huts (there are >>>> actually 4 of them) at random times and with different data densities per >>>> hut according to the cycle schedules. The power levels are percent. Some >>>> total stations report in volts but that's another problem. >>>> >>>> My script solution is: >>>> import pandas as pd >>>> import matplotlib.pyplot as plt >>>> df = pd.read_csv('Power_Log.csv',names=['DT','Station','Power']) >>>> df2=df.groupby(['Station']) # set 'Station' as the data index >>>> d = dict(iter(df2)) # make a dictionary including each station's data >>>> for stn in d.keys(): >>>> plt.figure() # creates a new plot canvas >>>> fig, ax = plt.subplots() # creates components of the plot >>>> ax.set_ylabel('Power (%)',fontsize=12) >>>> fig.subplots_adjust(bottom=0.15) >>>> d[stn].interpolate().plot(x='DT',y='Power',rot=15,title='Power >>>> Level: ' + stn) >>>> ax.set_xlabel('Date-Time',fontsize=12) >>>> plt.savefig('Station_Power_' + stn + '.png') >>>> >>>> Possibly a bit wasteful going from dataframe to dataframe to dictionary. >>>> >>>> This code knocks out nice graphs, except for one thing - the x ticks >>>> are at unrounded positions and therefore have long labels. >>>> >>>> I'm getting nowhere with set_major_formatter and autofmt_xdate methods >>>> to try to set the ticks to rounded days. >>>> >>>> And brilliant ideas here? >>>> >>>> Thanks, >>>> >>>> Kevin. >>>> >>>> _______________________________________________ >>>> melbourne-pug mailing list >>>> melbourne-pug at python.org >>>> https://mail.python.org/mailman/listinfo/melbourne-pug >>>> >>>> >>> >> >> _______________________________________________ >> melbourne-pug mailing list >> melbourne-pug at python.org >> https://mail.python.org/mailman/listinfo/melbourne-pug >> >> > > _______________________________________________ > melbourne-pug mailing list > melbourne-pug at python.org > https://mail.python.org/mailman/listinfo/melbourne-pug > > -- -------------------------------------------------- Tennessee Leeuwenburg http://myownhat.blogspot.com/ "Don't believe everything you think" -------------- next part -------------- An HTML attachment was scrubbed... URL: From gcross at fastmail.fm Wed Sep 3 05:30:49 2014 From: gcross at fastmail.fm (Graeme Cross) Date: Wed, 03 Sep 2014 13:30:49 +1000 Subject: [melbourne-pug] Melb Django School Message-ID: <1409715049.1120521.162976405.14E74838@webmail.messagingengine.com> Hi all. People on the list who want to learn more about Django might be interested in this: "Melb Django & Common Code is giving a free course on Django. The classes are going to be held fortnightly starting Sep. 11 from 4-6pm. They will be going through the essentials of Django to advance topics. The course will be given by leading Django Developers in the industry. Please bring a laptop and we'll provide the rest. See you in School!" More details at: http://www.meetup.com/MelbDjango/events/204586962/ Regards, Graeme From javier at candeira.com Wed Sep 3 14:20:29 2014 From: javier at candeira.com (Javier Candeira) Date: Wed, 3 Sep 2014 22:20:29 +1000 Subject: [melbourne-pug] Your favourite talk of Pycon AU 2014? Message-ID: After Juan's amazing presentation in the August meeting, I think MPUG's recap of Pycon 2014 was a bit lackluster. So please come up with links to your favourite presentations from this year! I started this email three weeks ago, but then decided to wait until the pycon au 2014 videos were available, so we could link there. Here are acouple of my Pycon AU 2014 selections, plus a couple of old ones that came up in my lightning talk: - Hacking bytecode for fun and prof... for fun.: http://pyvideo.org/video/1000/bytecode-what-why-and-how-to-hack-it (from 2011, but featured in our August session). - How to monkeypatch builtin objects: http://pyvideo.org/video/2210/dont-do-this (from 2013, but featured in our August session) - The new Computational Thinking curriculom for Australian Schools: http://pyvideo.org/video/3131/python-for-every-child-in-australia-by-dr-james-r. (If you don't have much time, start at minute 24, when the actual curriculum starts being discussed. Also minute 38 for how you can help). - The new default web stack, by one of the creators of Django: http://pyvideo.org/video/2856/a-new-default-web-stack (Unfortuely the Pycon AU talk was not recorded, but we have an earlier performance). - PyPy.js: What? How? Why? https://www.youtube.com/watch?v=8C9q94F6Uqo (For those who missed it at MPUG, and also for those who didn't, because this presentation is much better finished. Awesome also as an example of how to give a technical talk). Please add your own! J From krshackleton at gmail.com Wed Sep 3 04:29:10 2014 From: krshackleton at gmail.com (Kevin Shackleton) Date: Wed, 3 Sep 2014 10:29:10 +0800 Subject: [melbourne-pug] Rounded-value ticks on X axis In-Reply-To: References: Message-ID: Thanks for that Tennessee. Yes it did pip install. I will try it out this evening when I don't have distraction like a job . . And thanks for the comment on pandas. It's handy to take a hint on when it's worth persevering to find the right syntax and when it's not. Regards, Kevin On 3 September 2014 10:21, Tennessee Leeuwenburg wrote: > Hi Kevin, > > I have taken to using the Python port of ggplot, available at > http://ggplot.yhathq.com/ . I think it's on pip also. It takes pandas > dataframes just fine and provides a syntactically shorter route to graph > tweaking. It's not perfect, but it solved my problems more easily than > getting into the guts of matplotlib. (it is built on top of matplotlib so > you can provide mpl tweaks onto the graphs it produces if you really need > to). Pandas is not really a complete solution for graphing IMO. > > Feel free to share some gists of what you are trying to to, I'm happy to > try and help out a little. > > Cheers, > -T > > > On 31 August 2014 16:31, Kevin Shackleton wrote: > >> Unfortunately these matplotlib methods expect the data to be float, where >> using pandas I am able to parse and handle the time series data as >> datetime. But graphing in pandas does not seem to inherit all the >> matplotlib methods (I suppose that would be a mammoth task, including all >> the method overlays). I'm forming the opinion that I either do the job in >> numpy/matplotlib with extra code to sculpt the exact format I want or I go >> the concise and elegant pandas way and live with the loss of control of the >> x axis. >> >> Thanks, >> >> Kevin >> >> >> On 31 August 2014 12:01, Anthony Briggs wrote: >> >>> Quick update: http://matplotlib.org/examples/api/date_demo.html and >>> http://stackoverflow.com/questions/3677368/matplotlib-format-axis-offset-values-to-whole-numbers-or-specific-number >>> mention something called a Formatter. DateFormatter from the first link >>> looks like it should do what you're after (convert to a date rather than a >>> time). >>> >>> Anthony >>> >>> >>> >>> >>> >>> On 31 August 2014 13:57, Anthony Briggs >>> wrote: >>> >>>> Hi Kevin, >>>> >>>> Looks like it's just pulling those keys from the data, so something to >>>> convert those explicitly when you read it in would probably be the easiest >>>> way. There might be something in the read_csv function to convert data from >>>> a particular column, or you could try a dictionary comprehension per >>>> station (something along the lines of station_data = {reading['DT'][:10]: >>>> reading for reading in d[stn]}. >>>> >>>> You seem to have a lot of values for the same day though, so you'd >>>> either want to grab just the minimum, or do some sort of formatting in >>>> matplotlib. >>>> >>>> Another method would be to find the minimum value (or minimum 3) for a >>>> station and just report a warning if it's below a certain amount, rather >>>> than a graph which someone has to interpret. >>>> >>>> Final point - having a lot of one and two character variables makes it >>>> really hard to tell what your script is doing. >>>> >>>> Hope that helps, >>>> >>>> Anthony >>>> >>>> >>>> >>>> On 31 August 2014 11:11, Kevin Shackleton >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> New to Melbourne PUG. Fairly new to Python. >>>>> >>>>> I have a script that interprets power levels at several automated >>>>> surveying total stations working at a site. The idea is to show that the >>>>> batteries have enough amp-hours to see the total station through a run of >>>>> cloudy days. After 2 or 3 years of battery life the battery amp-hour >>>>> capacity will have reduced to a point where the installation will run often >>>>> out of power before the solar panels kick in each morning. In practice >>>>> this is often affected by 3rd parties hanging extra electrical load on our >>>>> installation. >>>>> >>>>> The data looks like this: >>>>> 2014-06-16T18:40:20,HUT1,56 >>>>> 2014-06-16T19:02:49,HUT2,15 >>>>> 2014-06-16T20:16:12,HUT1,58 >>>>> 2014-06-16T20:17:08,HUT2,11 >>>>> 2014-06-16T20:51:17,HUT1,67 >>>>> 2014-06-17T11:51:05,HUT1,100 >>>>> 2014-06-17T11:51:07,HUT2,48 >>>>> 2014-06-17T11:51:08,HUT3,57 >>>>> where power level readings are coming from each of the huts (there are >>>>> actually 4 of them) at random times and with different data densities per >>>>> hut according to the cycle schedules. The power levels are percent. Some >>>>> total stations report in volts but that's another problem. >>>>> >>>>> My script solution is: >>>>> import pandas as pd >>>>> import matplotlib.pyplot as plt >>>>> df = pd.read_csv('Power_Log.csv',names=['DT','Station','Power']) >>>>> df2=df.groupby(['Station']) # set 'Station' as the data index >>>>> d = dict(iter(df2)) # make a dictionary including each station's data >>>>> for stn in d.keys(): >>>>> plt.figure() # creates a new plot canvas >>>>> fig, ax = plt.subplots() # creates components of the plot >>>>> ax.set_ylabel('Power (%)',fontsize=12) >>>>> fig.subplots_adjust(bottom=0.15) >>>>> d[stn].interpolate().plot(x='DT',y='Power',rot=15,title='Power >>>>> Level: ' + stn) >>>>> ax.set_xlabel('Date-Time',fontsize=12) >>>>> plt.savefig('Station_Power_' + stn + '.png') >>>>> >>>>> Possibly a bit wasteful going from dataframe to dataframe to >>>>> dictionary. >>>>> >>>>> This code knocks out nice graphs, except for one thing - the x ticks >>>>> are at unrounded positions and therefore have long labels. >>>>> >>>>> I'm getting nowhere with set_major_formatter and autofmt_xdate methods >>>>> to try to set the ticks to rounded days. >>>>> >>>>> And brilliant ideas here? >>>>> >>>>> Thanks, >>>>> >>>>> Kevin. >>>>> >>>>> _______________________________________________ >>>>> melbourne-pug mailing list >>>>> melbourne-pug at python.org >>>>> https://mail.python.org/mailman/listinfo/melbourne-pug >>>>> >>>>> >>>> >>> >>> _______________________________________________ >>> melbourne-pug mailing list >>> melbourne-pug at python.org >>> https://mail.python.org/mailman/listinfo/melbourne-pug >>> >>> >> >> _______________________________________________ >> melbourne-pug mailing list >> melbourne-pug at python.org >> https://mail.python.org/mailman/listinfo/melbourne-pug >> >> > > > -- > -------------------------------------------------- > Tennessee Leeuwenburg > http://myownhat.blogspot.com/ > "Don't believe everything you think" > > _______________________________________________ > melbourne-pug mailing list > melbourne-pug at python.org > https://mail.python.org/mailman/listinfo/melbourne-pug > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tleeuwenburg at gmail.com Sun Sep 7 02:27:45 2014 From: tleeuwenburg at gmail.com (Tennessee Leeuwenburg) Date: Sun, 7 Sep 2014 10:27:45 +1000 Subject: [melbourne-pug] Idea: moving the 3rd Nov meeting away from cup day Message-ID: Hi all, I've just noticed that the November meeting is over the cup day weekend. While I have no great fascination for horses, I do enjoy having the long weekend free. I was wondering what people thought of moving the November meeting as a once-off to Monday 10th November? If people are agreeable, I am happy to contact the venue to determine whether we could hold it a week later. Thanks, -Tennessee -- -------------------------------------------------- Tennessee Leeuwenburg http://myownhat.blogspot.com/ "Don't believe everything you think" -------------- next part -------------- An HTML attachment was scrubbed... URL: From ed at pythoncharmers.com Sun Sep 7 06:37:39 2014 From: ed at pythoncharmers.com (Ed Schofield) Date: Sun, 7 Sep 2014 14:37:39 +1000 Subject: [melbourne-pug] Idea: moving the 3rd Nov meeting away from cup day In-Reply-To: References: Message-ID: > On 7 Sep 2014, at 10:27, Tennessee Leeuwenburg wrote: > > Hi all, > > I've just noticed that the November meeting is over the cup day weekend. While I have no great fascination for horses, I do enjoy having the long weekend free. I was wondering what people thought of moving the November meeting as a once-off to Monday 10th November? > > If people are agreeable, I am happy to contact the venue to determine whether we could hold it a week later. Hi Tennessee, That sounds like a good idea, although Inspire9 might not have a free evening; they're pretty full these days. If we can get a venue for Nov 10th ... let's ask John Barham (CCed): would you be willing to reschedule your talk from 3rd Nov to 10th? Best wishes, Ed From javier at candeira.com Sun Sep 7 09:48:19 2014 From: javier at candeira.com (Javier Candeira) Date: Sun, 7 Sep 2014 17:48:19 +1000 Subject: [melbourne-pug] Idea: moving the 3rd Nov meeting away from cup day In-Reply-To: References: Message-ID: John is slated to present in October, btw. I don't know what's wrong with me; I keep previewing the wiki and forgetting to save. (goes now add John to October, properly this time) J On Sun, Sep 7, 2014 at 2:37 PM, Ed Schofield wrote: > >> On 7 Sep 2014, at 10:27, Tennessee Leeuwenburg wrote: >> >> Hi all, >> >> I've just noticed that the November meeting is over the cup day weekend. While I have no great fascination for horses, I do enjoy having the long weekend free. I was wondering what people thought of moving the November meeting as a once-off to Monday 10th November? >> >> If people are agreeable, I am happy to contact the venue to determine whether we could hold it a week later. > > Hi Tennessee, > > That sounds like a good idea, although Inspire9 might not have a free evening; they're pretty full these days. > > If we can get a venue for Nov 10th ... let's ask John Barham (CCed): would you be willing to reschedule your talk from 3rd Nov to 10th? > > Best wishes, > Ed > > _______________________________________________ > melbourne-pug mailing list > melbourne-pug at python.org > https://mail.python.org/mailman/listinfo/melbourne-pug From andy.larrymite at gmail.com Tue Sep 9 03:25:22 2014 From: andy.larrymite at gmail.com (Andrew Jones) Date: Tue, 9 Sep 2014 11:25:22 +1000 Subject: [melbourne-pug] Medibank is still looking for a python technical tester $500-$600+/day Message-ID: Hi All, our team is after a python automation tester, willing to pay $500-$600+/day. We're a mature agile team that has a really fun team culture. Our tech stack is: python, django, angular.js, flask, postgresql, selenium and linux. This role would also suite a developer who's interested in learning new skills and working in the agile testing space. More details here: http://www.seek.com.au/job/27115990?tracking=JMC-0000787 Cheers Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simonwentley at gmail.com Fri Sep 5 12:36:50 2014 From: simonwentley at gmail.com (Simon Wentley) Date: Fri, 5 Sep 2014 20:36:50 +1000 Subject: [melbourne-pug] Melb Python developer with Amazon EC2 / Web Services experience looking for contract work Message-ID: Hi folks I'm a Python dev looking for contract work in Melbourne. Boiling it down to a few lines...... I'm a pretty good Python developer, able to build end to end applications and I'm a relentless problem solver. I'm able to build web applications and web APIs. Experienced with Flask, Postgres, MongoDB and SQL Alchemy. Throw a web app at me and I can probably get it built assuming it's of reasonable scope. I have a particular enjoyment of databases of all sorts. In depth knowledge of Linux and Amazon Web Services - probably at sysadmin level of expertise for many tasks. Not much I can't do or work out how to do. I'm an application designer and have designed and built many applications from end to end. I'm looking for contract work in Melbourne. Drop me a note if you think you might know of a three to six month project that I would be an asset to. thanks Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: From javier at candeira.com Tue Sep 9 14:20:42 2014 From: javier at candeira.com (Javier Candeira) Date: Tue, 9 Sep 2014 22:20:42 +1000 Subject: [melbourne-pug] Idea: moving the 3rd Nov meeting away from cup day In-Reply-To: References: Message-ID: Hi all, The November session has now been moved to the 10th, which is the second Monday. I've also edited the wiki, and I'll remember it when announcement time comes. Cheers, Javier On Sun, Sep 7, 2014 at 5:48 PM, Javier Candeira wrote: > John is slated to present in October, btw. I don't know what's wrong > with me; I keep previewing the wiki and forgetting to save. > > (goes now add John to October, properly this time) > > J > > On Sun, Sep 7, 2014 at 2:37 PM, Ed Schofield wrote: >> >>> On 7 Sep 2014, at 10:27, Tennessee Leeuwenburg wrote: >>> >>> Hi all, >>> >>> I've just noticed that the November meeting is over the cup day weekend. While I have no great fascination for horses, I do enjoy having the long weekend free. I was wondering what people thought of moving the November meeting as a once-off to Monday 10th November? >>> >>> If people are agreeable, I am happy to contact the venue to determine whether we could hold it a week later. >> >> Hi Tennessee, >> >> That sounds like a good idea, although Inspire9 might not have a free evening; they're pretty full these days. >> >> If we can get a venue for Nov 10th ... let's ask John Barham (CCed): would you be willing to reschedule your talk from 3rd Nov to 10th? >> >> Best wishes, >> Ed >> >> _______________________________________________ >> melbourne-pug mailing list >> melbourne-pug at python.org >> https://mail.python.org/mailman/listinfo/melbourne-pug From patrickchan7 at gmail.com Tue Sep 9 15:01:36 2014 From: patrickchan7 at gmail.com (Patrick Chan) Date: Tue, 9 Sep 2014 23:01:36 +1000 Subject: [melbourne-pug] Fwd: Opportunity to work on a project on Natural Language Processing In-Reply-To: <26452027.3129236.1409836785775.JavaMail.zimbra@packtpub.com> References: <1359183134.3128469.1409836611304.JavaMail.zimbra@packtpub.com> <26452027.3129236.1409836785775.JavaMail.zimbra@packtpub.com> Message-ID: Hey MPUG, Birmingham based, Packt Publishing, are looking for subject matter experts to author Python/Linux related books. Sample proposed topics include: - Learning Python Data Mining - Express.js Cookbook - Mastering Parallel Computing with Python - Mastering Apache Pig - Big Data with Postgres If you think you can commit to a 6months plus schedule to write a book on a technical topic, please get in touch with James Jones. As an example, the recently revised NLTK book has 9 chapters, and around 250 pages worth of contents. https://www.packtpub.com/application-development/python-3-text-processing-nltk-3-cookbook Cheers, Patrick Chan ---------- Forwarded message ---------- From: James Jones Date: Thu, Sep 4, 2014 at 11:19 PM Subject: Opportunity to work on a project on Natural Language Processing To: patrickchan7 at gmail.com Hi Patrick, First of all let me introduce myself. My name is James and I am an editor from Packt Publishing. We have recently been exploring the possibility of looking into various new projects around the topic of 'Natural Language Processing'. I understand that you were a reviewer on the previous book Python Text Processing Cookbook with NLTK, so I wanted to see whether or not you were possibly interested in writing? There are a few projects we can discuss should you be interested and it would be great to hear from you! Kind Regards, James Jones Acquisition Editor [Packt Publishing] Tel: 0121 265 6486 Web: www.packtpub.com Linkedin: uk.linkedin.com/pub/james-jones/52/3b9/596/ Twitter: @_James_Jones_ Packt Publishing Limited Registered Office: Livery Place, 35 Livery Street, Birmingham, West Midlands, B3 2PB Registered in England - Number 4759694 SAVE PAPER - THINK BEFORE YOU PRINT! This E-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return E-mail. Whilst Packt Publishing Ltd take every reasonable precaution to avoid the transfer of software viruses or defects that may cause damage to computer systems; it is the responsibility of the recipient to ensure that all emails and attachments received, are free from infection. -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott.junner at gmail.com Wed Sep 10 01:29:01 2014 From: scott.junner at gmail.com (Scott Junner) Date: Wed, 10 Sep 2014 09:29:01 +1000 Subject: [melbourne-pug] small talk at next meeting Message-ID: Hi Gang. I forgot who I'm supposed to talk to about perhaps giving a small presentation at one of the monthly meetings. Or if I did remember I would be at a loss for how to contact them directly. Therefore...mailing list message. I was wondering if an idea proposal put to the group would fit in. As in, put the idea forward, get feedback, connect with interested parties. It's an idea for a startup. As a very new programmer I know little about what the idea would require and would like to get the group to suggest what hurdles would be faced and possible solutions. The presentation itself needs little more than 5 minutes. Discussion, who knows? Thanks Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From javier at candeira.com Wed Sep 10 04:00:40 2014 From: javier at candeira.com (Javier Candeira) Date: Wed, 10 Sep 2014 12:00:40 +1000 Subject: [melbourne-pug] small talk at next meeting In-Reply-To: References: Message-ID: Hi, Scott, Thanks for offering. This seems not a specifically Python-related topic, and there are exellent startup-related meetings and other resources in Melbourne: http://pollenizer.com/melbournes-startup-scene Maybe you'd be better served by attending those and asking your questions there. Having said that, since it's such an open topic, you could write your ideas on this mailing list. More people read it than attend MPUG any given month, and email offers itself to a more premeditated discussion. Regards, Javier On Wed, Sep 10, 2014 at 9:29 AM, Scott Junner wrote: > Hi Gang. > > I forgot who I'm supposed to talk to about perhaps giving a small > presentation at one of the monthly meetings. Or if I did remember I would be > at a loss for how to contact them directly. Therefore...mailing list > message. > > I was wondering if an idea proposal put to the group would fit in. As in, > put the idea forward, get feedback, connect with interested parties. > > It's an idea for a startup. As a very new programmer I know little about > what the idea would require and would like to get the group to suggest what > hurdles would be faced and possible solutions. > > The presentation itself needs little more than 5 minutes. Discussion, who > knows? > > Thanks > > Scott > > _______________________________________________ > melbourne-pug mailing list > melbourne-pug at python.org > https://mail.python.org/mailman/listinfo/melbourne-pug > From ed at pythoncharmers.com Wed Sep 10 08:47:48 2014 From: ed at pythoncharmers.com (Ed Schofield) Date: Wed, 10 Sep 2014 16:47:48 +1000 Subject: [melbourne-pug] small talk at next meeting In-Reply-To: References: Message-ID: <273F96B4-D95B-4ADA-A84D-216706A7BFBD@pythoncharmers.com> Hi Scott, I would welcome your short presentation idea. The discussion would benefit everyone in the group who has considered starting up a company. There may even be a potential co-founder or collaborators for you in the room. Presumably you are keen to use Python as your technology platform or Python has a significant role, so that would be the reason you?re seeking our ideas and feedback, rather than presenting your concept to a more general audience? I would be happy to give you my feedback and hear other people?s ideas too. It could be an interesting discussion! Best wishes, Ed On 10 Sep 2014, at 9:29 am, Scott Junner wrote: > Hi Gang. > > I forgot who I'm supposed to talk to about perhaps giving a small presentation at one of the monthly meetings. Or if I did remember I would be at a loss for how to contact them directly. Therefore...mailing list message. > > I was wondering if an idea proposal put to the group would fit in. As in, put the idea forward, get feedback, connect with interested parties. > > It's an idea for a startup. As a very new programmer I know little about what the idea would require and would like to get the group to suggest what hurdles would be faced and possible solutions. > > The presentation itself needs little more than 5 minutes. Discussion, who knows? > > Thanks > > Scott > _______________________________________________ > melbourne-pug mailing list > melbourne-pug at python.org > https://mail.python.org/mailman/listinfo/melbourne-pug -- Dr. Edward Schofield Python Charmers +61 (0)405 676 229 http://pythoncharmers.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott.junner at gmail.com Wed Sep 10 12:51:17 2014 From: scott.junner at gmail.com (Scott Junner) Date: Wed, 10 Sep 2014 20:51:17 +1000 Subject: [melbourne-pug] small talk at next meeting Message-ID: To tell you the truth, at this point in my programming career I wouldn't know an Anaconda from a hot drink. So I don't really know what to use. I'm asking to present to this group because it's the only group I belong to (been to one session so far) and the only road in I have. I figure I've got nothing to lose by asking. The idea originated from one of the chaps I was talking to while searching for a place to live in Melbourne. I mentioned I was learning programming and he asked if I could help him fix a problem he was having with his computer...I removed some spamware...he saw me as some sort of demi-god and started pitching me his closely guarded idea. I told him I knew of a group of people I could talk to about it to see what it might take to get it to work. It seems feasible, and there's a massive routinely pissed off audience who'd happily fork out for the service he wants to provide. I think it would benefit the group because it would get them all thinking together about a problem and make use of the talent in the room. We may not get too far but I think it would be kinda fun and help strengthen the community feels. Regards Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From kitchen.andy at gmail.com Thu Sep 11 09:56:01 2014 From: kitchen.andy at gmail.com (Andy Kitchen) Date: Thu, 11 Sep 2014 17:56:01 +1000 Subject: [melbourne-pug] Thanks for doing MPUG last night In-Reply-To: References: Message-ID: Hi All, I'm Andy Kitchen, the one who did the ML presentation at MPUG, I just haven't had time to put my code online yet (sorry! I will soon, really) but in the mean time here are some links. Here are those tutorials for theano, it's a little hard going but very detailed: http://deeplearning.net/tutorial/ Google large scale network research (Good Reads): http://googleblog.blogspot.com.au/2012/06/using-large-scale-brain-simulations-for.html http://research.google.com/archive/large_deep_networks_nips2012.html Pretrained large-scale networks: http://cilvr.nyu.edu/doku.php?id=code:start http://caffe.berkeleyvision.org/ On Tue, Sep 2, 2014 at 8:03 AM, Javier Candeira wrote: > Thanks to everyone who attended MPUG last night. Special thanks go to > Jason King and Andy Kitchen for presenting, and to Graeme Cross for > organising the resources to make giving What's New talks easy for > anyone: > > http://www.curiousvenn.com/2014/08/resources-for-creating-the-whats-new-talks/ > > Thanks also to Ed Schofield for organising pizza and Graeme for > running the session, and to the many folks who helped with moving > tables around. It was great to just attend and not have to worry about > stuff. > > Finally, thanks to John Barham for stepping up and proposing a talk > for October. We only need a What's New presenter now. > > By the way, my talk is here: > > http://tinyurl.com/mpug-sept-2014 > > See you in October, > > Javier From dcrisp at netspace.net.au Fri Sep 12 04:11:16 2014 From: dcrisp at netspace.net.au (David Crisp) Date: Fri, 12 Sep 2014 12:11:16 +1000 (EST) Subject: [melbourne-pug] Variable Inheritence between modules. I have no idea! Message-ID: Hello, I've managed to muddle my way through python for the last while and have finally come up with something I dont know how to deal with. (I have included a simplified code group below that represents what m trying to do and see) I have a main module (test6.py) which calls a configuration module (test8.py) and then a number of other modules (test7 etc) which use the data from the configuration module. (ie: configuration.output returns "excel") when I run the code I get the following error: C:\Python33\python.exe C:/Users/dcrisp/Documents/Python/gui/test6.py sql Traceback (most recent call last): excel File "C:/Users/dcrisp/Documents/Python/gui/test6.py", line 10, in mainWin = test7.MainWindow() File "C:\Users\dcrisp\Documents\Python\gui\test7.py", line 5, in __init__ if configuration.input.upper() == "EXCEL": NameError: global name 'configuration' is not defined Which is telling me that configuration isnt a global ... Help? please? OKay, an actual question. How do I read the configuration opbject from within test7 when it is called from test6? I dont really want to call it from every module that needs it as there is meant to be some write back functionality happening to a configuration file and if I try and do that from more than one entry point I will end up writing a corrupted config back. So A single entry point for configuration would be nice.. Or am I doing it wrong? Whats the best way of doing what I want to do. Again, if I havent asked the right questions, please guide and I will try and provide the information you need. Regards, David Crisp Three simplified files provided below. Module 1: test6.py import test8 import test7 if __name__ == '__main__': configuration = test8.client_configuration() print(configuration.output) print(configuration.input) mainWin = test7.MainWindow() pass Module 2: test7.py class MainWindow(): def __init__(self): if configuration.input.upper() == "EXCEL": print("excel in") elif configuration.input.upper() == "SQL": print("SQL in") else: print("Inappropriate Configuration Set") if __name__ == '__main__': import test8 configuration = test8.client_configuration() mainWin = MainWindow() pass Module 3: test8.py class client_configuration(): def __init__(self): self.input = "excel" self.output = "sql" if __name__ == '__main__': configuration = client_configuration() print(configuration.input) print(configuration.output) From miked at dewhirst.com.au Fri Sep 12 05:25:35 2014 From: miked at dewhirst.com.au (Mike Dewhirst) Date: Fri, 12 Sep 2014 13:25:35 +1000 Subject: [melbourne-pug] Variable Inheritence between modules. I have no idea! In-Reply-To: References: Message-ID: <541267AF.4070501@dewhirst.com.au> On 12/09/2014 12:11 PM, David Crisp wrote: > Hello, > > I've managed to muddle my way through python for the last while and have > finally come up with something I dont know how to deal with. > > (I have included a simplified code group below that represents what m > trying to do and see) > > I have a main module (test6.py) which calls a configuration module > (test8.py) and then a number of other modules (test7 etc) which use the > data from the configuration module. (ie: configuration.output returns > "excel") > > when I run the code I get the following error: > C:\Python33\python.exe C:/Users/dcrisp/Documents/Python/gui/test6.py > sql > Traceback (most recent call last): > excel > File "C:/Users/dcrisp/Documents/Python/gui/test6.py", line 10, in > > mainWin = test7.MainWindow() > File "C:\Users\dcrisp\Documents\Python\gui\test7.py", line 5, in > __init__ > if configuration.input.upper() == "EXCEL": > NameError: global name 'configuration' is not defined > > Which is telling me that configuration isnt a global ... > > Help? please? OKay, an actual question. > > How do I read the configuration opbject from within test7 when it is > called from test6? I dont really want to call it from every module > that needs it as there is meant to be some write back functionality > happening to a configuration file and if I try and do that from more > than one entry point I will end up writing a corrupted config back. So > A single entry point for configuration would be nice.. > > Or am I doing it wrong? > > Whats the best way of doing what I want to do. > > Again, if I havent asked the right questions, please guide and I will > try and provide the information you need. > > Regards, > David Crisp > > Three simplified files provided below. > > Module 1: > test6.py > import test8 > import test7 > > if __name__ == '__main__': > configuration = test8.client_configuration() > > print(configuration.output) > print(configuration.input) > > mainWin = test7.MainWindow() > pass > > Module 2: > test7.py > class MainWindow(): > def __init__(self): This class doesn't get "configuration" declared or passed in or otherwise made available to it. You could do ... def __init__(self, configuration): ... which would at least generate an error if you don't pass it in. > if configuration.input.upper() == "EXCEL": > print("excel in") > elif configuration.input.upper() == "SQL": > print("SQL in") > else: > print("Inappropriate Configuration Set") > > When running test6 the following code in test7 never runs. It only runs if test7 is run independently. > if __name__ == '__main__': > import test8 > configuration = test8.client_configuration() > mainWin = MainWindow() > pass > > Module 3: > test8.py > class client_configuration(): > def __init__(self): > self.input = "excel" > self.output = "sql" > ditto for test8 > if __name__ == '__main__': > configuration = client_configuration() > > print(configuration.input) > print(configuration.output) > _______________________________________________ > melbourne-pug mailing list > melbourne-pug at python.org > https://mail.python.org/mailman/listinfo/melbourne-pug > From dcrisp at netspace.net.au Fri Sep 12 05:43:08 2014 From: dcrisp at netspace.net.au (David Crisp) Date: Fri, 12 Sep 2014 13:43:08 +1000 (EST) Subject: [melbourne-pug] Variable Inheritence between modules. I have no idea! In-Reply-To: <541267AF.4070501@dewhirst.com.au> References: <541267AF.4070501@dewhirst.com.au> Message-ID: On Fri, 12 Sep 2014, Mike Dewhirst wrote: > On 12/09/2014 12:11 PM, David Crisp wrote: >> Hello, >> class MainWindow(): >> def __init__(self): > > This class doesn't get "configuration" declared or passed in or otherwise > made available to it. You could do ... > > def __init__(self, configuration): > > ... which would at least generate an error if you don't pass it in. > >> if configuration.input.upper() == "EXCEL": >> print("excel in") >> elif configuration.input.upper() == "SQL": >> print("SQL in") >> else: >> print("Inappropriate Configuration Set") >> >> > > When running test6 the following code in test7 never runs. It only runs if > test7 is run independently. Sorry, yes, I realised this. I left the testing functions in.. Thanks! Regards, David From william.leslie.ttg at gmail.com Fri Sep 12 05:44:17 2014 From: william.leslie.ttg at gmail.com (William ML Leslie) Date: Fri, 12 Sep 2014 13:44:17 +1000 Subject: [melbourne-pug] Variable Inheritence between modules. I have no idea! In-Reply-To: References: Message-ID: On 12 September 2014 12:11, David Crisp wrote: > How do I read the configuration opbject from within test7 when it is > called from test6? I dont really want to call it from every module that > needs it as there is meant to be some write back functionality happening to > a configuration file and if I try and do that from more than one entry > point I will end up writing a corrupted config back. So A single entry > point for configuration would be nice.. > ?? > > ?What makes you think it will be corrupted? Have you tried it?? ?There are no globals in python, really, besides the module system (every import of module 'x' will give the same object(s)), but you can even work around that. > ?? > > Or am I doing it wrong? > > Whats the best way of doing what I want to do. > > Again, if I havent asked the right questions, please guide and I will try > and provide the information you need. > > > ?Why not:? test8.py class ClientConfiguration: def __init__(self): self.input = "excel" self.output = "sql" configuration = ClientConfiguration() ?then there's one configuration object that everyone can use (or not use, if they like): from test8 import configuration? Current best practice, as documented by https://glyph.twistedmatrix.com/2007/07/functional-functions-and-python.html is to have clean places to override the usage of the module, that's the 'best way' really. -- William Leslie Notice: Likely much of this email is, by the nature of copyright, covered under copyright law. You absolutely MAY reproduce any part of it in accordance with the copyright law of the nation you are reading this in. Any attempt to DENY YOU THOSE RIGHTS would be illegal without prior contractual agreement. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcrisp at netspace.net.au Fri Sep 12 06:29:25 2014 From: dcrisp at netspace.net.au (David Crisp) Date: Fri, 12 Sep 2014 14:29:25 +1000 (EST) Subject: [melbourne-pug] Variable Inheritence between modules. I have no idea! In-Reply-To: References: Message-ID: On Fri, 12 Sep 2014, William ML Leslie wrote: > On 12 September 2014 12:11, David Crisp wrote: > >> How do I read the configuration opbject from within test7 when it is >> called from test6? I dont really want to call it from every module that >> needs it as there is meant to be some write back functionality happening to >> a configuration file and if I try and do that from more than one entry >> point I will end up writing a corrupted config back. So A single entry >> point for configuration would be nice.. >> ?? >> >> > ?What makes you think it will be corrupted? Have you tried it?? No I havent tried it. I just ASSumed. > ?There are no globals in python, really, besides the module system (every > import of module 'x' will give the same object(s)), but you can even work > around that. The other way I could sort this out.. probably.. is to have everything in the module. (But I Asthetically I do like having my classes in seperate files (but not 100%... I tend to group functionality into files)) Regards, David From pizza at netspace.net.au Sun Sep 14 15:33:47 2014 From: pizza at netspace.net.au (Jason King) Date: Sun, 14 Sep 2014 23:33:47 +1000 Subject: [melbourne-pug] Thanks for doing MPUG last night In-Reply-To: References: Message-ID: <5415993B.30003@netspace.net.au> On 11/09/14 17:56, Andy Kitchen wrote: > I just haven't had time to put my code online yet > (sorry! I will soon, really) but in the mean time here are some links. > er, yes, I've been slack too, sorry about that. Here's the test of the talk I gave, I tried doing in it ipython notebook format, I'm not convinced it worked that well for me, but here it is. as I mentioned at the time, its only for chrome, I didn't get a chance to get it running for any other browser. -------------- next part -------------- { "metadata": { "celltoolbar": "Raw Cell Format", "name": "", "signature": "sha256:77836ec87db745631fef01ab82a6f5d7c8c12aae2ff5061a222082983a5acca9" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Oh, Behave Yourself." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "How to get behave tests to run selenium code to test your web sites.\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Behave is fairly well decumented, as is selenium. Getting the two to play well with each other was a bit more difficult, \n", "and required checking and experimenting with multiple sources of info to make it work. Here's basically what I did to make it go.\n", "\n", " " ] }, { "cell_type": "code", "collapsed": false, "input": [ "Behave:\n", " \n", " Behave is a framework to create and run python tests in a way that lets the \n", " testers write tests in the language they know best, and the coders implementing \n", " the tests create the code in their favourite language as well.\n", " \n", " \n", " Tests are written like this:\n", " \n", " Given the current state of the program,\n", " When the user does something,\n", " And the user actually turned the power on,\n", " Then test to make sure that the program worked,\n", " And print out a result.\n", " \n", " Its the coders job to turn the text into this:\n", " \n", " Given the current state of the program\n", " When the user does something\n", " When the user actually turned the power on\n", " Then test to make sure that the program worked\n", " Then print out a result\n", " \n", " So replace \"And\" with the word above it (Given , When or Then)\n", " remove punctuation\n", " \n", " The coder then create python tests that look like this:\n", " \n", " \n", "@given('the current state of the program')\n", "def step_impl(context):\n", " #either write some code to test that you're in the expected state, or \n", " assert(True)\n", "\n", "@when('the user does something')\n", "def step_impl(context):\n", " #write some code here to either press a key, or click the mouse on a control\n", " pass \n", " \n", " \n", "@then('test to make sure that the program worked')\n", "def step_impl(context):\n", " assert the_expected_result_happened\n", " \n", "\n", "@then('print out a result')\n", "def step_impl(context):\n", " assert value_appears_on_the_screen\n", " " ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "Install behave and selenium into your environment\n", "\n", "pip install behave\n", "pip install selenium\n", "\n", "Download the chrome webdriver\n", "http://chromedriver.storage.googleapis.com/index.html?path=2.9/\n", "And place it in your $PATH (or %PATH% )\n", " \n", "Note that at the time of writing, chrome webdriver 2.10 didn't work with the most recent chrome release on linux, so 2.9 was used." ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Create the following directory structure" ] }, { "cell_type": "raw", "metadata": {}, "source": [ "Tests\n", "\u251c\u2500\u2500 features\n", "\u2502\u00a0\u00a0 \u251c\u2500\u2500 environment.py\n", "\u2502\u00a0\u00a0 \u251c\u2500\u2500 path1a.feature\n", "\u2502\u00a0\u00a0 \u251c\u2500\u2500 path1d.feature\n", "\u2502\u00a0\u00a0 \u251c\u2500\u2500 path1e.feature\n", "\u2502\u00a0\u00a0 \u2514\u2500\u2500 steps\n", "\u2502\u00a0\u00a0 \u2514\u2500\u2500 steps.py\n", "\u2514\u2500\u2500 readme.txt (instructions for new people)\n", "\n" ] }, { "cell_type": "raw", "metadata": {}, "source": [ "Create your behave tests\n", "\n", "Feature: test path 1a\n", "\n", " Scenario: Choose appointment date then doctor, then register, then make appointment for sel\n", " Given user is on appointment page\n", " When the user selects a date\n", " Then the doctors list filters for availability\n", " And the appointment list filters for availability\n", " When the user selects a doctor\n", " Then the available times are displayed\n", " When the user selects a time\n", " And the user selects next\n", " Then the Login/register modal appears\n", " When the user selects register\n", " Then the registration modal is displayed\n", " When the user fills in the details\n", " And the user clicks next\n", " Then the registration details are verified\n", " And the registration details are written to the database\n", " And the Appointment Confirmation modal is shown with user as default patient\n", " When user clicks confirm\n", " Then the appointment is written to database\n", " And the main modal is shown\n", "\n" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Environment.py" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import threading\n", "from wsgiref import simple_server\n", "from selenium import webdriver\n", "#from my_application import model\n", "#from my_application import web_app\n", "\n", "\n", "def before_all(context):\n", " context.server = simple_server.WSGIServer(('', 8000))\n", " context.server.set_app(web_app.main(environment='test'))\n", " context.thread = threading.Thread(target=context.server.serve_forever)\n", " context.thread.start()\n", " context.browser = webdriver.Chrome()\n", "\n", "def after_all(context):\n", " context.server.shutdown()\n", " context.thread.join()\n", " context.browser.quit()\n", "\n", "def before_feature(context, feature):\n", " #model.init(environment='test')\n", " pass" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Feature" ] }, { "cell_type": "code", "collapsed": false, "input": [ "Feature: test path 1a\n", "\n", " Scenario: Choose appointment date then doctor, then register, then make appointment for sel\n", " Given user is on appointment page\n", " When the user selects a date\n", " Then the doctors list filters for availability\n", " And the appointment list filters for availability\n", " When the user selects a doctor\n", " Then the available times are displayed\n", " When the user selects a time\n", " And the user selects next\n", " Then the Login/register modal appears\n", " When the user selects register\n", " Then the registration modal is displayed\n", " When the user fills in the details\n", " And the user clicks next\n", " Then the registration details are verified\n", " And the registration details are written to the database\n", " And the Appointment Confirmation modal is shown with user as default patient\n", " When user clicks confirm\n", " Then the appointment is written to database\n", " And the main modal is shown\n" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "Finding the right element on the page\n", "\n", "find_elements_by_class_name()\n", "find_element_by_xpath()\n", "find_elements_by_id()\n", "\n", "see http://selenium-python.readthedocs.org/en/latest/locating-elements.html for more" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "XPATH" ] }, { "cell_type": "raw", "metadata": {}, "source": [ "\n", "\n", "see http://selenium-python.readthedocs.org/en/latest/locating-elements.html , it has a short and sweet intro to xpath\n", "\n", "\n", "Suggested browser plugins to help you generate and test xpath queries are:\n", " Chrome\n", " XPath Helper 1.0.13 https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl\n", " Ctrl-Shift X to turn on, hold down shift as you move the mouse to see the XPath query for what is under the mouse\n", " Firefox ?" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "tests.py" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from behave import *\n", "import selenium\n", "from selenium import webdriver\n", "from selenium.common.exceptions import NoSuchElementException\n", "\n", "test_url = 'http://localhost:8011/'\n", "\n", "@given('a suitable date')\n", "# td class=\"bookday month-1 available\" data-date=\"30-06-2014\"\n", "def step_impl(context):\n", " try:\n", " h = context.browser.find_elements_by_class_name('available')\n", " ok_(len(h) > 0)\n", " except NoSuchElementException:\n", " return False\n", "\n", "@given('a list of doctors')\n", "#how should I grab this, the list from the calendar page?\n", "#
    \n", "#\n", "def step_impl(context):\n", " pass\n", "\n", "@given('when login is pressed, we dont have a username and password')\n", "#no user? . check username and password fields in form to make sure they're empty?\n", "def step_impl(context):\n", " pass\n", "\n", "def step_impl(context):\n", " try:\n", " h = context.browser.find_element_by_class_name('time')\n", " return True\n", " except NoSuchElementException:\n", " return False\n", "\n", "@when('the login link is clicked')\n", "#click the login button\n", "def step_impl(context):\n", " login_link = context.browser.get_element(context.browser, tag='login')\n", " webdriver.ActionChains(context.browser).move_to_element(login_link).click(login_link).perform()\n", "\n", "@then('choose a doctor')\n", "#click on a doctor (pass a name in, or click one at random ?)\n", "#there's a function to get all elements with a certain property, use that if you need a random link\n", "def step_impl(context):\n", " login_link = context.browser.get_element(context.browser, tag='doctorlink')\n", " webdriver.ActionChains(context.browser).move_to_element(login_link).click(login_link).perform()\n", " #assert context.failed is False\n", "\n", "@then('enter in our details, and then press OK')\n", "#cycle through form fields, enter details, then press ok\n", "def step_impl(context):\n", " assert False\n", "\n", "@given('user is on appointment page')\n", "#make sure user can see the appointments page (not necessarily see appointments)\n", "def step_impl(context):\n", " context.browser.get(test_url)\n", " assert(True)\n", "\n", "@when('the user selects a date')\n", "def step_impl(context):\n", " try:\n", " h = context.browser.find_element_by_xpath(\"//div[@class='times-grid']/div/a\")\n", " webdriver.ActionChains(context.browser).move_to_element(h).click(h).perform()\n", " except NoSuchElementException:\n", " assert False\n", "\n", "@then('the doctors list filters for availability')\n", "#possible things happen here, someone in the list is unavailable?\n", "#one person is still available?\n", "def step_impl(context):\n", " pass\n", "\n", "@then('the appointment list filters for availability')\n", "#not sure about this, some times may disappear\n", "def step_impl(context):\n", " pass\n", "\n", "@when('the user selects a doctor')\n", "def step_impl(context):\n", " try:\n", " h = context.browser.find_element_by_xpath(\"//li[@class='available']\")\n", " webdriver.ActionChains(context.browser).move_to_element(h).click(h).perform()\n", " except NoSuchElementException:\n", " assert False\n", "\n", "@then('the available times are displayed')\n", "#can see appointments (what if there's no available times? should //a be removed)\n", "def step_impl(context):\n", " try:\n", " h = context.browser.find_element_by_xpath(\"//div[@class='times-grid']//a\")\n", " assert True\n", " except NoSuchElementException:\n", " assert False\n", "\n", "@When('the user selects a time')\n", "#user clicks on an appointment (at random?)\n", "def step_impl(context):\n", " try:\n", " h = context.browser.find_element_by_xpath(\"//div[@class='times-grid']//a\")\n", " webdriver.ActionChains(context.browser).move_to_element(h).click(h).perform()\n", " assert True\n", " except NoSuchElementException:\n", " assert False\n", "\n", "@When('the user selects next')\n", "#find \"next\" and click on it. I'm guessing \"next\" is the submit button to a form.\n", "#if not, well, find the link and click on it\n", "def step_impl(context):\n", " try:\n", " h = context.browser.find_element_by_xpath(\"//div[@class='submit']//a[@class='btn btn-primary']\")\n", " webdriver.ActionChains(context.browser).move_to_element(h).click(h).perform()\n", " assert True\n", " except NoSuchElementException:\n", " assert False\n", "\n", "\n", "\n", "@Then('the Login/register modal appears')\n", "#check for login/register\n", "def step_impl(context):\n", " try:\n", " form = context.browser.find_element_by_id('form')\n", " ok_(form.text.startswith(\"login\"),\n", " 'No login form %r' % h.text)\n", " except NoSuchElementException:\n", " return False\n", "\n", "\n", "@When('the user selects register')\n", "#user clicks on register link\n", "def step_impl(context):\n", " try:\n", " register_link = context.browser.find_element_by_class_name('register')\n", " webdriver.ActionChains(context.browser).move_to_element(register_link).click(register_link).perform()\n", " return True\n", " except NoSuchElementException:\n", " return False\n", "\n", "@Then('the registration modal is displayed')\n", "#make sure the registration form appears\n", "def step_impl(context):\n", " try:\n", " form = context.browser.find_element_by_xpath(\"//form[@id='registerForm']\")\n", " return True\n", " except NoSuchElementException:\n", " assert False\n", "\n", "@When('the user fills in the details')\n", "#cycle through the form and fill in the details\n", "def step_impl(context):\n", " pass\n", "\n", "@When('the user clicks next')\n", "#see 'the user selects next'\n", "def step_impl(context):\n", " try:\n", " form = context.browser.find_element_by_class_name('form')\n", " form,submit()\n", " return True\n", " except NoSuchElementException:\n", " return False\n", "\n", "@Then('the registration details are verified')\n", "#whats verifying the details? javascript? the PMS ?\n", "def step_impl(context):\n", " pass\n", "\n", "@Then('the registration details are written to the database')\n", "#make sure registration details can be accessed from the django ORM\n", "def step_impl(context):\n", " pass\n", "\n", "@Then('the Appointment Confirmation modal is shown with user as default patient')\n", "def step_impl(context):\n", " try:\n", " confirm = context.browser.find_element_by_xpath(\"//*[contains(text(), 'Appointment Details')]\")\n", " assert True\n", " except NoSuchElementException:\n", " assert False\n", "\n", "\n", "@When('user clicks confirm')\n", "#find \"confirm\" and click on it\n", "def step_impl(context):\n", " try:\n", " confirm = context.browser.find_element_by_xpath(\"//*[contains(text(), 'Confirm Appointment')]\")\n", " webdriver.ActionChains(context.browser).move_to_element(confirm).click(confirm).perform()\n", " except NoSuchElementException:\n", " assert False\n", "\n", "@Then('the appointment is written to database')\n", "#make sure the apointment you just made is accessable from the django ORM\n", "def step_impl(context):\n", " assert True\n", "\n", "@Then('the main modal is shown')\n", "#whats \"the main modal\"?\n", "def step_impl(context):\n", " assert False\n", "\n", "@when('the user selects log in')\n", "#find \"log in\" and click on it\n", "def step_impl(context):\n", " try:\n", " login = context.browser.find_element_by_xpath(\"//*[contains(text(), 'Log In')]\")\n", " webdriver.ActionChains(context.browser).move_to_element(login).click(login).perform()\n", " except NoSuchElementException:\n", " assert False\n", "\n", "@then('the login modal is displayed')\n", "#login form is displayed\n", "def step_impl(context):\n", " try:\n", " confirm = context.browser.find_element_by_xpath(\"//*[contains(text(), 'Sign in')]\")\n", " assert True\n", " except NoSuchElementException:\n", " assert False\n", "\n", "\n", "@when('the user fills in username and password')\n", "#cycle through the login form and fill in the details\n", "def step_impl(context):\n", " pass\n", "\n", "\n", "@then('Login details are verified')\n", "#the screen doesn't say \"login failed\"?\n", "def step_impl(context):\n", " pass\n", "\n", "@then('the Appointment Confirmation modal is shown')\n", "def step_impl(context):\n", " pass\n", "\n", "@when('the user selects a different name from the drop down list')\n", "def step_impl(context):\n", " pass\n", "\n", "@when('the user clicks confirm')\n", "#find \"confirm\" and click on it\n", "def step_impl(context):\n", " try:\n", " confirm = context.browser.find_element_by_link_text('Confirm')\n", " webdriver.ActionChains(context.browser).move_to_element(confirm).click(confirm).perform()\n", " except NoSuchElementException:\n", " assert False\n", "\n", "\n", "\n", "@then(u'the available dates are displayed')\n", "def step_impl(context):\n", " assert False\n", "\n", "@when(u'the user fills in all details')\n", "def step_impl(context):\n", " assert False\n", "\n", "@when(u'the user clicks login/register link on page')\n", "def step_impl(context):\n", " assert False\n", "\n", "@when(u'the user selects My Account')\n", "def step_impl(context):\n", " assert False\n", "\n", "@then(u'account details are shown')\n", "def step_impl(context):\n", " assert False\n", "\n", "@when(u'the user selects New Patient')\n", "def step_impl(context):\n", " assert False\n", "\n", "@when(u'the user enters new patient details')\n", "def step_impl(context):\n", " assert False\n", "\n", "@when(u'the user clicks ok')\n", "def step_impl(context):\n", " assert False\n", "\n", "@then(u'new patient data is verified')\n", "def step_impl(context):\n", " assert False\n", "\n", "@then(u'new patient data is written to database')\n", "def step_impl(context):\n", " assert False\n", "\n", "@when(u'the user closes the dialog box')\n", "def step_impl(context):\n", " assert False\n", "\n", "@when(u'the user selects the new patient name from the drop down list')\n", "def step_impl(context):\n", " assert False\n", "\n", "@then(u'the login details are verified')\n", "def step_impl(context):\n", " assert False\n", "\n", "@when(u'the Appointment Confirmation modal is shown with user as default patient')\n", "def step_impl(context):\n", " assert False\n" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "Use behave -v to find out what behave is really doing, to find out why its not working" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "Sources:\n", " http://testingbot.com/support/getting-started/behave.html\n", " http://selenium-python.readthedocs.org/en/latest/locating-elements.html \n", " StackOverflow\n", " \n", "Thanks to:\n", " Ed Schofield (for intro to behave)\n", " Adrienne Walker (for writing the tests)" ], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] } From gcross at fastmail.fm Sun Sep 21 08:41:27 2014 From: gcross at fastmail.fm (Graeme Cross) Date: Sun, 21 Sep 2014 16:41:27 +1000 Subject: [melbourne-pug] Kiwi Pycon 2014 videos are up Message-ID: <1411281687.3372722.169909693.4C53E4D1@webmail.messagingengine.com> Hi everyone. I just noticed that the videos from this year's Kiwi PyCon are up: https://www.youtube.com/playlist?list=PLBGl1tVyiWQSVwxne3yOH79uaSqgbnCqL Did anyone from MPUG go? Want to give us your thoughts and highlights at the next meeting? Regards, Graeme From javier at candeira.com Sun Sep 21 09:46:16 2014 From: javier at candeira.com (Javier Candeira) Date: Sun, 21 Sep 2014 17:46:16 +1000 Subject: [melbourne-pug] Kiwi Pycon 2014 videos are up In-Reply-To: <1411281687.3372722.169909693.4C53E4D1@webmail.messagingengine.com> References: <1411281687.3372722.169909693.4C53E4D1@webmail.messagingengine.com> Message-ID: We don't have a What's New in Python speaker for October, so a "What I Saw on my Kiwi PyCon Holiday" could cover the slot... J On Sun, Sep 21, 2014 at 4:41 PM, Graeme Cross wrote: > Hi everyone. > > I just noticed that the videos from this year's Kiwi PyCon are up: > > https://www.youtube.com/playlist?list=PLBGl1tVyiWQSVwxne3yOH79uaSqgbnCqL > > Did anyone from MPUG go? Want to give us your thoughts and highlights at > the next meeting? > > Regards, > Graeme > _______________________________________________ > melbourne-pug mailing list > melbourne-pug at python.org > https://mail.python.org/mailman/listinfo/melbourne-pug From cfp at ruxcon.org.au Mon Sep 29 05:40:48 2014 From: cfp at ruxcon.org.au (cfp at ruxcon.org.au) Date: Mon, 29 Sep 2014 13:40:48 +1000 (EST) Subject: [melbourne-pug] Ruxcon 2014 Security Conference Message-ID: <20140929034048.91ABBE47E@ruxcon.org.au> Hi, Ruxcon is Australia's premier technical computer security conference, held at the CQ Function Centre in Melbourne. Ruxcon brings together the best and the brightest security talent in the Australia-Pacific region through live presentations, activities, and demonstrations. This year we also feature a fantastic line-up with several high-profile international speakers. Ruxcon 2014 will be held on the weekend of the 11th of October to the 12th of October. Doors open at 8:00am and the first presentation commences at 9:00am. There are a limited number of tickets available and they are going very quickly. Please register via the Ruxcon website to ensure that you don't miss out: http://www.ruxcon.org.au/register For more information, please visit http://www.ruxcon.org.au/speakers 1. Safecracking on a Budget - Jay Davis and Luke Jahnke 2. Software Defined Radness: HackRF meets +613 - y011 & liamosaur 3. Windows ShellBags Forensics in Depth - Vincent Lo 4. Portal Masquerade: Traffic Analysis Resistant Communications - Ryan Lackey 5. APT PenTesting Framework - Writing Zero Days for Security - Sean Park 6. Let's Talk About SOAP Baby, Let's Talk About UPNP - Ricky Lawshae 7. EMET 5.0: Armor Or Curtain - Rene Freingruber 8. Homebrew Incident Response - Mimeframe & Mcgrew 9. Ransomware: A Study of Evolution - Peter Szabo 10. BIOS and Secure Boot Attacks Uncovered - John Loucaides 11. Android Forensics: The Joys of JTAG - tty0x80 12. Cyber Necromancy: Reverse Engineering Dead Protocols - Matthew Halchyshak & Joseph Tartaro 13. Bitcoin Transaction Malleability Theory In Practical - Daniel Chechik 14. International Voicemail Security and Bypassing 2FA for Fun and Profit - Shubham Shah 15. Recapping Breaking the Security of Physical Devices - Silvio Cesare 16. Write Once, Run Anywhere: A Tour of Java Remote Code Execution Vectors - David Jorm 17. Exploiting SQL Race Conditions and Other Oddities - David Litchfield 18. Mobile Underground Activities in China - Lion Gu 19. Bolt On Some Crypto - Michael Samuel 20. Finding Bugs The Rube-Goldberg Way - Mark Brand 21. The Devil in the Detail: Advanced Forensic Artifact Analysis and More Tales From the Coalface - Adam Daniel 22. Image and Video Forensics ??? An Image is Worth 1000 Frauds - Robert Winkel 23. Breaking Bricks and Plumbing Pipes: Cisco ASA a Super Mario Adventure - Alec Stuart-Muirk 24. Advanced Forensic Artefact Analysis & More Tales From the Coalface - Adam Daniel 25. iOS 8: Containers, Sandboxes and Entitlements - Stefan Esser 26. Building Your Own SMS/MMS Fuzzer - Brian Gorenc & Matt Molinyawe 27. Crash & Pay: Reading, Cloning and Fuzzing RFID Payment Cards - Peter Fillmore 28. Extreme Privilege Escalation on Windows 8/UEFI Systems - Corey Kallenberg Videos from previous Ruxon's can be found here: http://www.youtube.com/ruxcon Hope to see you there, Regards, Ruxcon 2014 Staff http://www.ruxcon.org.au From rasjidw at openminddev.net Mon Sep 29 09:14:45 2014 From: rasjidw at openminddev.net (Rasjid Wilcox) Date: Mon, 29 Sep 2014 17:14:45 +1000 Subject: [melbourne-pug] [JOB] Senior Python Developer - Melbourne area Message-ID: <542906E5.4040306@openminddev.net> Hi all, My workplace is looking for a senior software engineer to help develop the next version of its in-house software. Possibility of working from home for a significant portion. Full description below. Cheers, Rasjid. * Senior Software Developer (primarily Python)* /2 year contract/ The Optical Superstore is an innovative Australian optical retailer providing quality eyecare to the Australian public. We are seeking an experienced Software Developer to help create the next version of our in-house Point-of-Sale and Practice Management software. The software will be primarily developed in Python, using a REST style architecture and a PostgreSQL database backend running on Linux. The front-end components will primarily be native Windows applications (mostly using PySide) but some parts of the interface may be best suited as Web based or be tablet based 'apps' (either native or HTML5 based as appropriate). /The role will require the successful applicant to:// / * be involved in all aspects of the software development process, from requirements gathering and architecture planning to development, testing and deployment * work in an Agile setup where features are progressively migrated from the legacy system to the new system in an incremental manner * be able to work both independently without supervision but also cooperatively and with clear communication * be able to work from home and on-site in Melbourne (Notting Hill) as required (at least one day a fortnight on-site) /To be successful for this role you must have the following:// / * Python experience in commercial applications. * Experience with large scale applications - multiple developers, larger code base * Databases: Good understanding of RDBMS (preferably PostgreSQL) * OS environments: Experience developing (pref with Python) under both Windows and Linux is essential /Highly desirable:// / * Accounting: Familiarity with Australian accounting practices, particularly with respect to GST * Retail or Practice Management: Familiarity with Point-of-Sale or Practice Management systems would be advantageous * Familiarity with the open-source ecosystem for Python, both under Linux and Windows * Non-Python development: Experience with various other programming languages particularly in terms of mobile applications. ----- Please conact me for further details or email your CV to (assuming you still have python 2.7 installed) base64.decodestring('cmFzamlkd0BvcHRpY2Fsc3VwZXJzdG9yZS5jb20uYXU=') . -------------- next part -------------- An HTML attachment was scrubbed... URL: From javier at candeira.com Mon Sep 29 10:43:45 2014 From: javier at candeira.com (Javier Candeira) Date: Mon, 29 Sep 2014 18:43:45 +1000 Subject: [melbourne-pug] 6 October, 6pm, MPUG@Inspire9: Message-ID: Dear Melbourne Pythonistas, In a week, Monday 6 October, we'll hold the October meeting of the Melbourne Python Users Group! Time: 6PM Venue: Inspire 9: Level 1, 41 Stewart Street, Richmond. 50m from Richmond Train Station. Program: 25 minute talks * Open Slot -- What's New in Python, October Edition * Oliver Nagy -- Building a Virtual Reality engine in (mostly) Python * John Barham -- Mezzanine, a Django CMS :: As usual, we'll order pizza, with a $10 contribution required. Drinks are BYO, but you're invited to bring a six-pack to share if you want! If you'd like to give the What's New in Python talk in a future session, you have a cool project you want to show, or you want to give a short presentation on a library you've been using lately, please just come forward during the meeting. With many thanks to Python Charmers for sponsoring our use of the venue, The MPUG organisers