Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.3.0'
Browse files Browse the repository at this point in the history
Conflicts:
	setup.py
  • Loading branch information
whtsky committed Jan 19, 2014
2 parents 648917f + f84a54a commit 37911a7
Show file tree
Hide file tree
Showing 61 changed files with 1,029 additions and 456 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
include = catsup/*
omit =
deploy
server
logger
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ docs/_build/
#Virtualenv
.Python
lib/
include/
include/
htmlcov
tests/site/deploy
2 changes: 0 additions & 2 deletions .pipignore

This file was deleted.

11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
language: python
python:
- 2.7
- 3.2
- 3.3

install: python setup.py install
install:
- python setup.py install
- pip install -r dev-requirements.txt

script: nosetests
script: coverage run setup.py -q nosetests

after_success: coveralls

notifications:
email: false
email: false
19 changes: 14 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
catsup
Catsup
----------------

.. image:: https://pypip.in/d/catsup/badge.png
:target: https://crate.io/packages/catsup/
:target: https://pypi.python.org/pypi/catsup/

.. image:: https://travis-ci.org/whtsky/Catsup.png?branch=develop
:target: https://travis-ci.org/whtsky/Catsup

.. image:: https://coveralls.io/repos/whtsky/catsup/badge.png?branch=develop
:target: https://coveralls.io/r/whtsky/catsup?branch=develop

.. image:: https://badge.waffle.io/whtsky/catsup.png?label=ready
:target: http://waffle.io/whtsky/catsup

Catsup is a lightweight static website generator which aims to be simple and elegant.
Documentation is available at RTFD: https://catsup.readthedocs.org/en/latest/

Quick Start
===============

First, install catsup via pip ::
First, install Catsup via pip ::

$ pip install catsup

Then, craete a new catsup site ::
Then, create a new Catsup site ::

$ mkdir site
$ cd site
Expand All @@ -41,4 +50,4 @@ Build your site and deploy ::

catsup build && catsup deploy

For more information, please read the document: https://catsup.readthedocs.org/en/latest/
For more information, please read the document: https://catsup.readthedocs.org/en/latest/
2 changes: 1 addition & 1 deletion catsup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Catsup, a lightweight static blog generator
"""

__version__ = '0.2.1'
__version__ = '0.3.0'
36 changes: 0 additions & 36 deletions catsup/cache.py

This file was deleted.

53 changes: 23 additions & 30 deletions catsup/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@
g.public_templates_path = os.path.join(g.catsup_path, 'templates')
g.cwdpath = os.path.abspath('.')

try:
import catsup
except ImportError:
import site
site.addsitedir(os.path.dirname(g.catsup_path))
import catsup

doc = """catsup v%s
doc = """Catsup v%s
Usage:
catsup init [<path>]
Expand All @@ -32,8 +28,8 @@
catsup server [-s <file>|--settings=<file>] [-p <port>|--port=<port>]
catsup webhook [-s <file>|--settings=<file>] [-p <port>|--port=<port>]
catsup watch [-s <file>|--settings=<file>]
catsup themes
catsup clean [-s <file>|--settings=<file>]
catsup themes
catsup install <theme>
catsup -h | --help
catsup --version
Expand Down Expand Up @@ -145,8 +141,8 @@ def server(settings, port):
-p --port=<port> specify the server port. [default: 8888]
"""
import catsup.server
server = catsup.server.PreviewServer(settings, port)
server.run()
preview_server = catsup.server.PreviewServer(settings, port)
preview_server.run()


@parguments.command
Expand Down Expand Up @@ -192,51 +188,48 @@ def watch(settings):


@parguments.command
def themes():
def clean(settings):
"""
Usage:
catsup themes
catsup clean [-s <file>|--settings=<file>]
Options:
-h --help Show this screen and exit.
-s --settings=<file> specify a setting file. [default: config.json]
"""
import catsup.parser.themes
catsup.parser.themes.list()
import shutil
import catsup.parser.config
config = catsup.parser.config(settings)

for path in [config.config.static_output, config.config.output]:
if os.path.exists(path):
shutil.rmtree(path)


@parguments.command
def clean(settings):
def themes():
"""
Usage:
catsup clean [-s <file>|--settings=<file>]
catsup themes
Options:
-s --settings=<file> specify a setting file. [default: config.json]
-h --help Show this screen and exit.
"""
import catsup.parser.config
import shutil
config = catsup.parser.config(settings)
if os.path.exists(".catsup-cache"):
shutil.rmtree(".catsup-cache")
logger.info("Removed cache folder.")
output_path = config.config.output
if os.path.exists(output_path):
shutil.rmtree(output_path)
logger.info("Removed output folder.")
from catsup.parser.themes import list_themes
list_themes()


@parguments.command
def install(theme):
def install(name):
"""
Usage:
catsup install <theme>
catsup install <name>
Options:
-h --help Show this screen and exit.
"""
import catsup.parser.themes
catsup.parser.themes.install(path=theme)
from catsup.themes.install import install_theme
install_theme(name=name)


def main():
Expand Down
9 changes: 6 additions & 3 deletions catsup/deploy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import os
import datetime
import shutil

from catsup.logger import logger
from catsup.utils import call


RSYNC_COMMAND = "rsync -avze 'ssh -p {ssh_port}' {args}" \
" {deploy_dir}/ {ssh_user}@{ssh_host}:{document_root}"


def git(config):
logger.info("Deploying your site via git")

Expand All @@ -18,7 +23,6 @@ def _call(*args, **kwargs):
if os.path.exists(dot_git_path) and \
_call('git remote -v | grep %s' % config.deploy.git.repo) == 0:
if os.path.exists(dot_git_path):
import shutil
shutil.rmtree(dot_git_path)
_call('git init', silence=True)
_call('git remote add origin %s' % config.deploy.git.repo)
Expand All @@ -44,8 +48,7 @@ def rsync(config):
args = "--delete"
else:
args = ""
cmd = "rsync -avze 'ssh -p {ssh_port}' {args}" \
" {deploy_dir}/ {ssh_user}@{ssh_host}:{document_root}".format(
cmd = RSYNC_COMMAND.format(
ssh_port=config.deploy.rsync.ssh_port,
args=args,
deploy_dir=config.config.output,
Expand Down
Loading

0 comments on commit 37911a7

Please sign in to comment.