paulcronk / psinsights Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/psinsights
License: Apache License 2.0
Automatically exported from code.google.com/p/psinsights
License: Apache License 2.0
`psinsights` is a set of python bindings for Google's PageSpeed Insights API. The PageSpeed Insights API helps "developers optimize their web pages by applying web performance best practices" to their web pages. You can find out more about the PageSpeed Insights API here: https://developers.google.com/speed/docs/insights/ `psinsights` was written by the software engineers at FastSoft. You can find more information about FastSoft here: http://www.fastsoft.com/
What steps will reproduce the problem?
1. Try access rule.score property
an = service.analyze("http://code.google.com/")
for rule in analysis.results.rules.itervalues():
print rule.localized_name, rule.score, rule.impact
What is the expected output?
valid numbers, like:
Minify HTML 96 0.0483
What do you see instead?
Exception:
Minify HTMLTraceback (most recent call last):
File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev_2.8.2.2013090511/pysrc/pydevd_comm.py", line 773, in doIt
result = pydevd_vars.evaluateExpression(self.thread_id, self.frame_id, self.expression, self.doExec)
File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev_2.8.2.2013090511/pysrc/pydevd_vars.py", line 374, in evaluateExpression
Exec(expression, updated_globals, frame.f_locals)
File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev_2.8.2.2013090511/pysrc/pydevd_exec.py", line 2, in Exec
exec exp in global_vars, local_vars
File "<string>", line 2, in <module>
File "/usr/lib/python2.7/site-packages/psinsights/rule.py", line 41, in score
return self.__data["ruleScore"]
KeyError: 'ruleScore'
What version of the product are you using? On what operating system?
$ pip freeze| grep psinsights
psinsights==0.1
$ uname -a; cat /etc/fedora-release
Linux mulder 3.11.4-201.fc19.x86_64 #1 SMP Thu Oct 10 14:11:18 UTC 2013 x86_64
x86_64 x86_64 GNU/Linux
Fedora release 19 (Schrödinger’s Cat)
Please provide any additional information below.
The Score key has disappeared from the properties:
rule._Rule__data.keys()
[u'localizedRuleName', u'urlBlocks', u'ruleImpact']
Original issue reported on code.google.com by [email protected]
on 21 Nov 2013 at 3:20
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.