Kotti software -- adds a software project listing to your site
Project description
This is an extension to the Kotti CMS that adds a system for presenting a list of software projects on your site.
Setting up kotti_software
This Addon adds two new Content Types to your Kotti site. To set up the content types add kotti_software.kotti_configure to the kotti.configurators setting in your ini file:
kotti.configurators = kotti_software.kotti_configure
Now you can create a software collection and add software projects.
There are different settings to adjust the behavior of the software.
You can select if the software projects in the collection overview should be batched. If you set kotti_software.collection_settings.use_batching to true (the default value) the software projects will be shown on separate pages. If you set it to false all software projects are shown all together on one page:
kotti_software.collection_settings.use_batching = false
If you use batching you can choose how many software projects are shown on one page. The default value for kotti_software.collection_settings.pagesize is 5:
kotti_software.collection_settings.pagesize = 10
You can use auto batching where the next page of the software projects is automatically loaded when scrolling down the overview page instead of showing links to switch the pages. The default for kotti_software.collection_settings.use_auto_batching is true:
kotti_software.collection_settings.use_auto_batching = false
With kotti_software.collection_settings.link_headline_overview you can control whether the headline of a software project in the collection overview is linked to the software project or not. This setting defaults to true:
kotti_software.collection_settings.link_headline_overview = false
Parts of kotti_software can be overridden with the setting kotti_software.asset_overrides. Have a look to the Kotti documentation about the asset_overrides setting, which is the same as in kotti_software.
Be warned: This addon is in alpha state. Use it at your own risk.
Using kotti_software
Add a software collection to your site, then to that add software projects. Here are ways to enter software projects:
Enter the pypi JSON URL only
Enter the pypi JSON URL, along with the Github repo info for fetching the Github repo information, such as most recent push date and time.
Enter only the Github repo info
Enter the title, description, date and any of: home_page, docs_url, package_url, bugtrack_url (manual entry)
Enter the date only (bare-bones entry, with just date and title, description, and whatever you wish in body – useful for defunct projects)
Enter the JSON URL of an alternative source
There are date-handling and description-handling select properties to set according to the usage above, and whether the entered values are to be used, or if the values are to be fetched from pypi or Github or another JSON source.
There are also boolean override properties for using a combination of manually entered values for home_page, docs_url, package_url, and bugtrack_url and the fetching of these values from pypi.
Instructions for JSON sources:
pypi
Enter the url of the form “http://pypi.python.org/pypi/{project name}/json”, where {project name} is the case-sensitive name of the project on pypi. For example, for Kotti the url is “http://pypi.python.org/pypi/Kotti/json”.
See http://pypi.python.org/pypi/Kotti/json to see the JSON that is parsed.
Github
Enter the Github user and repo, which will be used to build a Github API call of the form: https://api.github.com/repos/{user}/{repo}, as in https://api.github.com/repos/geojeff/kotti_software. You may enter this Github info along with the pypi URL, or use the Github info only.
Hosting Elsewhere
As an alternative to pypi, if your project is not posted there, you may put a JSON file somewhere in your github, bitbucket, or other repo, and access it with an appropriate url. For instance, for a file in a github repo, the RAW url should be used, e.g.:
json_url = “https://raw.github.com/geojeff/kotti_fruits_example/master/json”
You will need to follow the format of the pypi JSON data in such a file.
Work in progress
kotti_software is considered alpha software, not yet suitable for use in production environments. The current state of the project is in no way feature complete nor API stable. If you really want to use it in your project(s), make sure to pin the exact version in your requirements. Not doing so will likely break your project when future releases become available.
Development
Contributions to kotti_software are very welcome. Just clone its Github repository and submit your contributions as pull requests.
Note that all development is done on the develop branch. master is reserved for “production-ready state”. Therefore, make sure to always base development work on the current state of the develop branch.
This follows the highly recommended A successful Git branching model pattern, which is implemented by the excellent gitflow git extension.
Testing
kotti_software has 100% test coverage. Please make sure that you add tests for new features and that all tests pass before submitting pull requests. Running the test suite is as easy as running py.test from the source directory (you might need to run python setup.py dev to have all the test requirements installed in your virtualenv).
TODO
add i18n
add a sort_order property, ASC or DESC
add tests for sorting that work on items with dates set by the different methods available
add navpill-style and table-style list views for projects; make list style selectable in edit menu [Can/should this be punted to Kotti folder view?]
sort out and document metadata items available in setup.py vs. those requiring manual entry on pypi or in kotti_software. See what happens when bugtrack_url, home_page, and download_url are added to setup.py. What is download_url vs. package_url? Does url in setup.py map to home_page? [Home page, Download URL, and Bugtrack URL are editable on pypi. If they are not available in setup.py, then if set manually on pypi, are they overwritten by new release pushes to pypi, or do they stick?]
check on need for required testing dependencies copied from kotti_media
add support for using tags to categorize by group with an example, or add a “sub-collection” property if the tags route is not workable.
Presently, the view for SoftwareCollection does a site-wide search for all SoftwareProject items. Should this be changed to context.children? [Ties in with tags and/or categorization question.]
change use of all-jambed-up softwarecollection to software-collection and software_collection; same for softwareproject
add better visual separation between items in default list view (the only list view style available now; see above todo item)
Are on-load refreshes from pypi and github too expensive? What are alternatives? Nightly cron job? More frequent cron job? Refreshing on a timer? Every 5 minutes? Every hour? Manual trigger by admin?
Add an explicit handling for a mercurial JSON source, as for github?
CHANGES
0.1.2
Added support for sorting in either ascending or descending order (default is still descending).
Added github repo API call as an alternate or sole JSON source.
Cleaned up sorting code.
0.1.1
Added missing TODO.txt.
Changed test urls to hit pypi/Kotti/json.
Prepared MANIFEST.in.
Updated README following pattern of kotti_media.
0.1
Initial release.
Started with copy of kotti_blog.
During development referred to kotti_media for adding url properties, for setting up view classes, and for preparation of tests and use of travis-ci.org.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file kotti_software-0.1.2.tar.gz
.
File metadata
- Download URL: kotti_software-0.1.2.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4a3f39fb27f30eb8d12f26dc86fa226f30fb824e3af8905805176215340d1eb |
|
MD5 | e4b2ea68a82ba1b3509c4cc59b04904b |
|
BLAKE2b-256 | 5a3f71907a30452fc53107bc4801d7ebc5dc18da59a1bebeaca0651383223c4e |