Browse Source

Consistency fix: Use Codelet.url instead of Codelet.code_url.

tags/v1.0^2
Ben Kurtovic 10 years ago
parent
commit
e64c81f66f
2 changed files with 8 additions and 8 deletions
  1. +6
    -6
      bitshift/codelet.py
  2. +2
    -2
      static/js/index.js

+ 6
- 6
bitshift/codelet.py View File

@@ -13,7 +13,7 @@ class Codelet(object):
:ivar authors: (array of tuples (str, str or None)) An array of tuples :ivar authors: (array of tuples (str, str or None)) An array of tuples
containing an author's name and profile URL (on the service the code containing an author's name and profile URL (on the service the code
was pulled from). was pulled from).
:ivar code_url: (str) The url of the (page containing the) source code.
:ivar url: (str) The url of the (page containing the) source code.
:ivar date_created: (:class:`datetime.datetime`, or None) The date the code :ivar date_created: (:class:`datetime.datetime`, or None) The date the code
was published. was published.
:ivar date_modified: (:class:`datetime.datetime`, or None) The date the :ivar date_modified: (:class:`datetime.datetime`, or None) The date the
@@ -26,7 +26,7 @@ class Codelet(object):
added by the database. added by the database.
""" """


def __init__(self, name, code, filename, language, authors, code_url,
def __init__(self, name, code, filename, language, authors, url,
date_created, date_modified, rank, symbols=None, origin=None): date_created, date_modified, rank, symbols=None, origin=None):
""" """
Create a Codelet instance. Create a Codelet instance.
@@ -36,7 +36,7 @@ class Codelet(object):
:param filename: see :attr:`self.filename` :param filename: see :attr:`self.filename`
:param language: see :attr:`self.language` :param language: see :attr:`self.language`
:param authors: see :attr:`self.authors` :param authors: see :attr:`self.authors`
:param code_url: see :attr:`self.code_url`
:param url: see :attr:`self.url`
:param date_created: see :attr:`self.date_created` :param date_created: see :attr:`self.date_created`
:param date_modified: see :attr:`self.date_modified` :param date_modified: see :attr:`self.date_modified`
:param rank: see :attr:`self.rank` :param rank: see :attr:`self.rank`
@@ -48,7 +48,7 @@ class Codelet(object):
:type filename: see :attr:`self.filename` :type filename: see :attr:`self.filename`
:type language: see :attr:`self.language` :type language: see :attr:`self.language`
:type authors: see :attr:`self.authors` :type authors: see :attr:`self.authors`
:type code_url: see :attr:`self.code_url`
:type url: see :attr:`self.url`
:type date_created: see :attr:`self.date_created` :type date_created: see :attr:`self.date_created`
:type date_modified: see :attr:`self.date_modified` :type date_modified: see :attr:`self.date_modified`
:type rank: see :attr:`self.rank` :type rank: see :attr:`self.rank`
@@ -61,7 +61,7 @@ class Codelet(object):
self.filename = filename self.filename = filename
self.language = language self.language = language
self.authors = authors self.authors = authors
self.code_url = code_url
self.url = url
self.date_created = date_created self.date_created = date_created
self.date_modified = date_modified self.date_modified = date_modified
self.rank = rank self.rank = rank
@@ -77,7 +77,7 @@ class Codelet(object):
""" """
return { return {
"name": self.name, "code": self.code, "lang": LANGS[self.language], "name": self.name, "code": self.code, "lang": LANGS[self.language],
"authors": self.authors, "url": self.code_url,
"authors": self.authors, "url": self.url,
"created": self.date_created.isoformat(), "created": self.date_created.isoformat(),
"modified": self.date_modified.isoformat(), "modified": self.date_modified.isoformat(),
"symbols": self.symbols, "origin": self.origin "symbols": self.symbols, "origin": self.origin


+ 2
- 2
static/js/index.js View File

@@ -30,7 +30,7 @@ var codeExample = '<table class="highlighttable"><tr><td class="linenos"><div cl
searchBar.onkeyup = typingTimer; searchBar.onkeyup = typingTimer;


var testCodelet = { var testCodelet = {
'code_url': 'https://github.com/earwig/bitshift/blob/develop/app.py',
'url': 'https://github.com/earwig/bitshift/blob/develop/app.py',
'filename': 'app.py', 'filename': 'app.py',
'language': 'Python', 'language': 'Python',
'date_created': 'May 10, 2014', 'date_created': 'May 10, 2014',
@@ -165,7 +165,7 @@ function createResult(codelet) {
authors.id = 'authors'; authors.id = 'authors';


//Add the bulk of the html //Add the bulk of the html
title.innerHTML = 'File <a href="' + codelet.code_url + '">'
title.innerHTML = 'File <a href="' + codelet.url + '">'
+ codelet.filename + '</a>'; + codelet.filename + '</a>';
site.innerHTML = 'on <a href="' + codelet.origin[1] + '">' + codelet.origin[0] +'</a>'; site.innerHTML = 'on <a href="' + codelet.origin[1] + '">' + codelet.origin[0] +'</a>';
dateModified.innerHTML = 'Last modified ' + codelet.date_modified; dateModified.innerHTML = 'Last modified ' + codelet.date_modified;


Loading…
Cancel
Save