Просмотр исходного кода

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

tags/v1.0^2
Ben Kurtovic 10 лет назад
Родитель
Сommit
e64c81f66f
2 измененных файлов: 8 добавлений и 8 удалений
  1. +6
    -6
      bitshift/codelet.py
  2. +2
    -2
      static/js/index.js

+ 6
- 6
bitshift/codelet.py Просмотреть файл

@@ -13,7 +13,7 @@ class Codelet(object):
: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
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
was published.
:ivar date_modified: (:class:`datetime.datetime`, or None) The date the
@@ -26,7 +26,7 @@ class Codelet(object):
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):
"""
Create a Codelet instance.
@@ -36,7 +36,7 @@ class Codelet(object):
:param filename: see :attr:`self.filename`
:param language: see :attr:`self.language`
: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_modified: see :attr:`self.date_modified`
:param rank: see :attr:`self.rank`
@@ -48,7 +48,7 @@ class Codelet(object):
:type filename: see :attr:`self.filename`
:type language: see :attr:`self.language`
: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_modified: see :attr:`self.date_modified`
:type rank: see :attr:`self.rank`
@@ -61,7 +61,7 @@ class Codelet(object):
self.filename = filename
self.language = language
self.authors = authors
self.code_url = code_url
self.url = url
self.date_created = date_created
self.date_modified = date_modified
self.rank = rank
@@ -77,7 +77,7 @@ class Codelet(object):
"""
return {
"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(),
"modified": self.date_modified.isoformat(),
"symbols": self.symbols, "origin": self.origin


+ 2
- 2
static/js/index.js Просмотреть файл

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

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',
'language': 'Python',
'date_created': 'May 10, 2014',
@@ -165,7 +165,7 @@ function createResult(codelet) {
authors.id = 'authors';

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


Загрузка…
Отмена
Сохранить