This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| #-*- mode: python -*- | |
| from subprocess import Popen, PIPE | |
| import sys | |
| syntax_checker = "pyflakes" | |
| def run(command): | |
| p = Popen(command.split(), stdout=PIPE, stderr=PIPE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """A collection of wrappers for API objects in the PennCourseReview API.""" | |
| from api import pcr | |
| class CourseHistory(object): | |
| """A wrapper for coursehistory objects in the PCR API.""" | |
| def __init__(self, raw_coursehistory): | |
| self.raw = raw_coursehistory | |
| self.id = raw_coursehistory['id'] | |
| self.name = raw_coursehistory['name'] | |
| self.aliases = raw_coursehistory['aliases'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def deptartment(request, dept): | |
| dept = dept.upper() | |
| department = Departent(pcr('depts', dept)) | |
| context = {'courses': [course for course in department.courses]} | |
| return render_to_response('department.html', context) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib | |
| import urllib2 | |
| import json | |
| from ..settings import API, TOKEN | |
| def pcr(*args, **kwargs): | |
| kwargs["token"] = TOKEN | |
| path = "".join((API, "/".join([str(arg) for arg in args]), "?", urllib.urlencode(kwargs))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <ul> | |
| {% for course in courses %} | |
| <li>{{course.name}}</li> | |
| {% endfor %} | |
| </ul> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.conf.urls.defaults import * | |
| from views import * | |
| urlpatterns = patterns('', | |
| (r'^$', index), | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.shortcuts import render_to_response | |
| def index(request): | |
| return render_to_response('index.html') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ceasarbautista@hse140:~/Desktop/Statistics/statistics/markov$ ls | |
| README __init__.pyc markov.py matrix2graph.pyc pathfinder.pyc priority_dict.pyc spanning.py | |
| __init__.py graph.py matrix2graph.py pathfinder.py priority_dict.py space.py vector.py | |
| ceasarbautista@hse140:~/Desktop/Statistics/statistics/markov$ ls | column | |
| README graph.py matrix2graph.pyc priority_dict.py spanning.py | |
| __init__.py markov.py pathfinder.py priority_dict.pyc vector.py | |
| __init__.pyc matrix2graph.py pathfinder.pyc space.py | |
| ceasarbautista@hse140:~/Desktop/Statistics/statistics/markov$ ls | column | cat | |
| README pathfinder.py | |
| __init__.py pathfinder.pyc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ceasarbautista@hse140:~/Desktop/Statistics/statistics/markov$ ls | |
| README __init__.pyc markov.py matrix2graph.pyc pathfinder.pyc priority_dict.pyc spanning.py | |
| __init__.py graph.py matrix2graph.py pathfinder.py priority_dict.py space.py vector.py | |
| ceasarbautista@hse140:~/Desktop/Statistics/statistics/markov$ ls | grep -v '\.pyc$' | column | |
| README graph.py matrix2graph.py priority_dict.py spanning.py | |
| __init__.py markov.py pathfinder.py space.py vector.py | |
| ceasarbautista@hse140:~/Desktop/Statistics/statistics/markov$ ls | grep -v '\.pyc$' | column | od -c | |
| 0000000 R E A D M E \t \t m a t r i x 2 g | |
| 0000020 r a p h . p y \t s p a n n i n g | |
| 0000040 . p y \n _ _ i n i t _ _ . p y \t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ceasarbautista@hse140:~/Desktop/Statistics/statistics/markov$ ls | |
| README __init__.pyc markov.py matrix2graph.pyc pathfinder.pyc priority_dict.pyc spanning.py | |
| __init__.py graph.py matrix2graph.py pathfinder.py priority_dict.py space.py vector.py | |
| ceasarbautista@hse140:~/Desktop/Statistics/statistics/markov$ ls | grep -v '\.pyc$' | column | |
| README graph.py matrix2graph.py priority_dict.py spanning.py | |
| __init__.py markov.py pathfinder.py space.py vector.py |