Add: bitshift/codelet.py -add Codelet class with constructor. README.md -add SASS stylesheet documentationtags/v1.0^2
@@ -13,6 +13,11 @@ Branches | |||||
- `feature/*`: individual components of the project with untested, likely | - `feature/*`: individual components of the project with untested, likely | ||||
horribly broken code - branch off from and merge into `develop` when done | horribly broken code - branch off from and merge into `develop` when done | ||||
Style | |||||
----- | |||||
bitshift uses [SASS][SASS] for styling; compile the stylesheets to CSS with | |||||
`sass --watch static/sass/:static/css`. | |||||
Documentation | Documentation | ||||
------------- | ------------- | ||||
@@ -24,3 +29,5 @@ new modules or packages, but *not* when adding functions or changing | |||||
docstrings), run `sphinx-apidoc -fo docs/source/api bitshift` from the project | docstrings), run `sphinx-apidoc -fo docs/source/api bitshift` from the project | ||||
root. Note that this will revert any custom changes made to the files in | root. Note that this will revert any custom changes made to the files in | ||||
`docs/source/api`, so you might want to update them by hand instead. | `docs/source/api`, so you might want to update them by hand instead. | ||||
[SASS]: http://sass-lang.com/guide |
@@ -1,6 +1,5 @@ | |||||
""" | """ | ||||
.. module:: assets | |||||
:synopsis: Helper functions for use inside the project's Jinja templates. | |||||
:synopsis: Helper functions for use inside the project's Jinja templates. | |||||
""" | """ | ||||
from flask import Markup | from flask import Markup | ||||
@@ -1,13 +1,43 @@ | |||||
__all__ = ["Codelet"] | __all__ = ["Codelet"] | ||||
class Codelet(object): | class Codelet(object): | ||||
## object to store the following (it doesn't need to do anything with it): | |||||
## author name, URL, date created/modified, language, source code itself | |||||
## for VCS: project name, file in project | |||||
## also: list of functions, etc (associations data) | |||||
""" | |||||
A source-code object with code metadata and composition analysis. | |||||
## DICTIONARY MAPPING STRINGS REPRESENTING ASSOCIATION TYPE WITH DICTIONARIES | |||||
## MAPPING ASSOCIATION NAMES WITH TUPLES REPRESENTING THEIR PLACE IN THE FILE | |||||
## STORED AS TWO INTEGERS REPRESENTING THE ROW AND THE COLUMN | |||||
:ivar code: (string) A containing the raw source code. | |||||
:ivar language: (string) The inferred language of `code`. | |||||
:ivar author: (string) The | |||||
:ivar url: The url of the (page containing the) source code. | |||||
:ivar date_created: The date the code was published. | |||||
:ivar date_modified: The date the code was last modified. | |||||
""" | |||||
## {"functions": {"foo": (12, 13), "bar": (53, 3)}} | |||||
def __init__(self, code, author, language, code_url, author_url, | |||||
date_created, date_modified): | |||||
""" | |||||
Create a Codelet instance. | |||||
:param code: The raw source code. | |||||
:param author: The author of the code. | |||||
:param language: The inferred language. | |||||
:param code_url: The url of the (page containing the) source code. | |||||
:param author_url: The url of the code author's public profile on the | |||||
framework said code was retrieved from. | |||||
:param date_created: The date the code was published. | |||||
:param date_modified: The date the code was last modified. | |||||
:type code: string | |||||
:type language: string | |||||
:type author: string | |||||
:type url: string | |||||
:type date_created: string | |||||
:type date_modified: string | |||||
""" | |||||
self.code = code | |||||
self.author = author | |||||
self.language = language | |||||
self.code_url = code_url | |||||
self.author_url = author_url | |||||
self.date_created = date_created | |||||
self.date_modified = date_modified |
@@ -0,0 +1,11 @@ | |||||
query Package | |||||
============= | |||||
:mod:`query` Package | |||||
-------------------- | |||||
.. automodule:: bitshift.query | |||||
:members: | |||||
:undoc-members: | |||||
:show-inheritance: | |||||
@@ -1,30 +1,51 @@ | |||||
bitshift package | |||||
bitshift Package | |||||
================ | ================ | ||||
Submodules | |||||
:mod:`bitshift` Package | |||||
----------------------- | |||||
bitshift.assets module | |||||
.. automodule:: bitshift.__init__ | |||||
:members: | |||||
:undoc-members: | |||||
:show-inheritance: | |||||
:mod:`assets` Module | |||||
-------------------- | |||||
.. automodule:: bitshift.assets | .. automodule:: bitshift.assets | ||||
:members: | :members: | ||||
:undoc-members: | :undoc-members: | ||||
:show-inheritance: | :show-inheritance: | ||||
bitshift.config module | |||||
:mod:`codelet` Module | |||||
--------------------- | |||||
.. automodule:: bitshift.config | |||||
.. automodule:: bitshift.codelet | |||||
:members: | :members: | ||||
:undoc-members: | :undoc-members: | ||||
:show-inheritance: | :show-inheritance: | ||||
:mod:`config` Module | |||||
-------------------- | |||||
Module contents | |||||
.. automodule:: bitshift.config | |||||
:members: | |||||
:undoc-members: | |||||
:show-inheritance: | |||||
:mod:`database` Module | |||||
---------------------- | |||||
.. automodule:: bitshift | |||||
.. automodule:: bitshift.database | |||||
:members: | :members: | ||||
:undoc-members: | :undoc-members: | ||||
:show-inheritance: | :show-inheritance: | ||||
Subpackages | |||||
----------- | |||||
.. toctree:: | |||||
bitshift.parser | |||||
bitshift.query | |||||
@@ -4,7 +4,8 @@ setup( | |||||
name = "bitshift", | name = "bitshift", | ||||
version = "0.1", | version = "0.1", | ||||
packages = find_packages(), | packages = find_packages(), | ||||
install_requires = ["Flask>=0.10.1", "pygments>=1.6"], | |||||
install_requires = ["Flask>=0.10.1", "pygments>=1.6", "requests>=2.2.0", | |||||
"BeautifulSoup>=3.2.1"], | |||||
author = "Benjamin Attal, Ben Kurtovic, Severyn Kozak", | author = "Benjamin Attal, Ben Kurtovic, Severyn Kozak", | ||||
license = "MIT", | license = "MIT", | ||||
url = "https://github.com/earwig/bitshift" | url = "https://github.com/earwig/bitshift" | ||||