Browse Source

Add Codelet, crawler dependencies to setup.

Add:
    bitshift/codelet.py
        -add Codelet class with constructor.

    README.md
        -add SASS stylesheet documentation
tags/v1.0^2
Severyn Kozak 10 years ago
parent
commit
6a4ba580ed
6 changed files with 91 additions and 18 deletions
  1. +7
    -0
      README.md
  2. +1
    -2
      bitshift/assets.py
  3. +38
    -8
      bitshift/codelet.py
  4. +11
    -0
      docs/source/api/bitshift.query.rst
  5. +32
    -7
      docs/source/api/bitshift.rst
  6. +2
    -1
      setup.py

+ 7
- 0
README.md View File

@@ -13,6 +13,11 @@ Branches
- `feature/*`: individual components of the project with untested, likely
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
-------------

@@ -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
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.

[SASS]: http://sass-lang.com/guide

+ 1
- 2
bitshift/assets.py View File

@@ -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


+ 38
- 8
bitshift/codelet.py View File

@@ -1,13 +1,43 @@
__all__ = ["Codelet"]

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

+ 11
- 0
docs/source/api/bitshift.query.rst View File

@@ -0,0 +1,11 @@
query Package
=============

:mod:`query` Package
--------------------

.. automodule:: bitshift.query
:members:
:undoc-members:
:show-inheritance:


+ 32
- 7
docs/source/api/bitshift.rst View File

@@ -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
:members:
:undoc-members:
:show-inheritance:

bitshift.config module
:mod:`codelet` Module
---------------------

.. automodule:: bitshift.config
.. automodule:: bitshift.codelet
:members:
:undoc-members:
:show-inheritance:

:mod:`config` Module
--------------------

Module contents
.. automodule:: bitshift.config
:members:
:undoc-members:
:show-inheritance:

:mod:`database` Module
----------------------

.. automodule:: bitshift
.. automodule:: bitshift.database
:members:
:undoc-members:
:show-inheritance:

Subpackages
-----------

.. toctree::

bitshift.parser
bitshift.query


+ 2
- 1
setup.py View File

@@ -4,7 +4,8 @@ setup(
name = "bitshift",
version = "0.1",
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",
license = "MIT",
url = "https://github.com/earwig/bitshift"


Loading…
Cancel
Save