spacepaste

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
>>> import github3
>>> r = github3.repository('esacteksab',)

>>> list(r)
[<Repository [esacteksab/AutobahnPython]>, <Repository [esacteksab/barrymorrison.com-theme]>, <Repository [esacteksab/diveintohtml5]>, <Repository [esacteksab/django-deployment-workshop]>, <Repository [esacteksab/django-fabric]>, <Repository [esacteksab/django-jquery-file-upload]>, <Repository [esacteksab/fabric4pelican]>, <Repository [esacteksab/git-hooks]>, <Repository [esacteksab/github-watcher]>, <Repository [esacteksab/homework]>, <Repository [esacteksab/HTML5-boilerplate-CSS-Stylus]>, <Repository [esacteksab/learning-salt]>, <Repository [esacteksab/misc-scripts]>, <Repository [esacteksab/Myosotis]>, <Repository [esacteksab/one_second_django_deployment]>, <Repository [esacteksab/PowerShell]>, <Repository [esacteksab/PyLadiesBYOBlog]>, <Repository [esacteksab/reddit]>, <Repository [esacteksab/salt-django-example]>, <Repository [esacteksab/salt-states]>, <Repository [esacteksab/states]>, <Repository [esacteksab/web-trafficlight]>, <Repository [esacteksab/WindowsFirewallScripts]>]
>>> 
>>> for repo in list(r):
...     print repo.language
...     
... 
Python
None
JavaScript
Python
None
JavaScript
None
None
Python
Python
None
None
Python
Python
JavaScript
PowerShell
JavaScript
Python
Python
Python
Scheme
Python
None

>>> repolanguage
[u'Python', u'JavaScript', u'Python', u'JavaScript', u'Python', u'Python', None, u'Python', u'Python', u'JavaScript', u'PowerShell', u'JavaScript', u'Python', u'Python', u'Python', u'Scheme', u'Python', None]
>>> for l in repolanguage:
...     if l == None:
...         repolanguage.remove(None)
...         
...     
... 
>>> 
>>> repolanguage
[u'Python', u'JavaScript', u'Python', u'JavaScript', u'Python', u'Python', u'Python', u'Python', u'JavaScript', u'PowerShell', u'JavaScript', u'Python', u'Python', u'Python', u'Scheme', u'Python']


>>> for l in repolanguage:
...     print '{0} - {1}'.format(l, repolanguage.count(l))
...     
... 
Python - 10
JavaScript - 4
Python - 10
JavaScript - 4
Python - 10
Python - 10
Python - 10
Python - 10
JavaScript - 4
PowerShell - 1
JavaScript - 4
Python - 10
Python - 10
Python - 10
Scheme - 1
Python - 10


>>> from sets import Set

>>> languages = Set([])
>>> for i in repolanguage:
...     languages.add(i)
...     
... 
>>> languages
Set([u'Python', u'JavaScript', u'Scheme', u'PowerShell'])