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

Commit 37911a7

Browse files
committed
Merge branch 'release/v0.3.0'
Conflicts: setup.py
2 parents 648917f + f84a54a commit 37911a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1029
-456
lines changed

.coveragerc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[run]
2+
include = catsup/*
3+
omit =
4+
deploy
5+
server
6+
logger

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ docs/_build/
4343
#Virtualenv
4444
.Python
4545
lib/
46-
include/
46+
include/
47+
htmlcov
48+
tests/site/deploy

.pipignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.travis.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
language: python
22
python:
33
- 2.7
4-
- 3.2
54
- 3.3
65

7-
install: python setup.py install
6+
install:
7+
- python setup.py install
8+
- pip install -r dev-requirements.txt
89

9-
script: nosetests
10+
script: coverage run setup.py -q nosetests
11+
12+
after_success: coveralls
1013

1114
notifications:
12-
email: false
15+
email: false

README.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1-
catsup
1+
Catsup
22
----------------
33

44
.. image:: https://pypip.in/d/catsup/badge.png
5-
:target: https://crate.io/packages/catsup/
5+
:target: https://pypi.python.org/pypi/catsup/
6+
7+
.. image:: https://travis-ci.org/whtsky/Catsup.png?branch=develop
8+
:target: https://travis-ci.org/whtsky/Catsup
9+
10+
.. image:: https://coveralls.io/repos/whtsky/catsup/badge.png?branch=develop
11+
:target: https://coveralls.io/r/whtsky/catsup?branch=develop
12+
13+
.. image:: https://badge.waffle.io/whtsky/catsup.png?label=ready
14+
:target: http://waffle.io/whtsky/catsup
615

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

1019
Quick Start
1120
===============
1221

13-
First, install catsup via pip ::
22+
First, install Catsup via pip ::
1423

1524
$ pip install catsup
1625

17-
Then, craete a new catsup site ::
26+
Then, create a new Catsup site ::
1827

1928
$ mkdir site
2029
$ cd site
@@ -41,4 +50,4 @@ Build your site and deploy ::
4150

4251
catsup build && catsup deploy
4352

44-
For more information, please read the document: https://catsup.readthedocs.org/en/latest/
53+
For more information, please read the document: https://catsup.readthedocs.org/en/latest/

catsup/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Catsup, a lightweight static blog generator
33
"""
44

5-
__version__ = '0.2.1'
5+
__version__ = '0.3.0'

catsup/cache.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

catsup/cli.py

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,9 @@
1515
g.public_templates_path = os.path.join(g.catsup_path, 'templates')
1616
g.cwdpath = os.path.abspath('.')
1717

18-
try:
19-
import catsup
20-
except ImportError:
21-
import site
22-
site.addsitedir(os.path.dirname(g.catsup_path))
18+
import catsup
2319

24-
doc = """catsup v%s
20+
doc = """Catsup v%s
2521
2622
Usage:
2723
catsup init [<path>]
@@ -32,8 +28,8 @@
3228
catsup server [-s <file>|--settings=<file>] [-p <port>|--port=<port>]
3329
catsup webhook [-s <file>|--settings=<file>] [-p <port>|--port=<port>]
3430
catsup watch [-s <file>|--settings=<file>]
35-
catsup themes
3631
catsup clean [-s <file>|--settings=<file>]
32+
catsup themes
3733
catsup install <theme>
3834
catsup -h | --help
3935
catsup --version
@@ -145,8 +141,8 @@ def server(settings, port):
145141
-p --port=<port> specify the server port. [default: 8888]
146142
"""
147143
import catsup.server
148-
server = catsup.server.PreviewServer(settings, port)
149-
server.run()
144+
preview_server = catsup.server.PreviewServer(settings, port)
145+
preview_server.run()
150146

151147

152148
@parguments.command
@@ -192,51 +188,48 @@ def watch(settings):
192188

193189

194190
@parguments.command
195-
def themes():
191+
def clean(settings):
196192
"""
197193
Usage:
198-
catsup themes
194+
catsup clean [-s <file>|--settings=<file>]
199195
200196
Options:
201197
-h --help Show this screen and exit.
198+
-s --settings=<file> specify a setting file. [default: config.json]
202199
"""
203-
import catsup.parser.themes
204-
catsup.parser.themes.list()
200+
import shutil
201+
import catsup.parser.config
202+
config = catsup.parser.config(settings)
203+
204+
for path in [config.config.static_output, config.config.output]:
205+
if os.path.exists(path):
206+
shutil.rmtree(path)
205207

206208

207209
@parguments.command
208-
def clean(settings):
210+
def themes():
209211
"""
210212
Usage:
211-
catsup clean [-s <file>|--settings=<file>]
213+
catsup themes
212214
213215
Options:
214-
-s --settings=<file> specify a setting file. [default: config.json]
215216
-h --help Show this screen and exit.
216217
"""
217-
import catsup.parser.config
218-
import shutil
219-
config = catsup.parser.config(settings)
220-
if os.path.exists(".catsup-cache"):
221-
shutil.rmtree(".catsup-cache")
222-
logger.info("Removed cache folder.")
223-
output_path = config.config.output
224-
if os.path.exists(output_path):
225-
shutil.rmtree(output_path)
226-
logger.info("Removed output folder.")
218+
from catsup.parser.themes import list_themes
219+
list_themes()
227220

228221

229222
@parguments.command
230-
def install(theme):
223+
def install(name):
231224
"""
232225
Usage:
233-
catsup install <theme>
226+
catsup install <name>
234227
235228
Options:
236229
-h --help Show this screen and exit.
237230
"""
238-
import catsup.parser.themes
239-
catsup.parser.themes.install(path=theme)
231+
from catsup.themes.install import install_theme
232+
install_theme(name=name)
240233

241234

242235
def main():

catsup/deploy.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import os
22
import datetime
3+
import shutil
34

45
from catsup.logger import logger
56
from catsup.utils import call
67

78

9+
RSYNC_COMMAND = "rsync -avze 'ssh -p {ssh_port}' {args}" \
10+
" {deploy_dir}/ {ssh_user}@{ssh_host}:{document_root}"
11+
12+
813
def git(config):
914
logger.info("Deploying your site via git")
1015

@@ -18,7 +23,6 @@ def _call(*args, **kwargs):
1823
if os.path.exists(dot_git_path) and \
1924
_call('git remote -v | grep %s' % config.deploy.git.repo) == 0:
2025
if os.path.exists(dot_git_path):
21-
import shutil
2226
shutil.rmtree(dot_git_path)
2327
_call('git init', silence=True)
2428
_call('git remote add origin %s' % config.deploy.git.repo)
@@ -44,8 +48,7 @@ def rsync(config):
4448
args = "--delete"
4549
else:
4650
args = ""
47-
cmd = "rsync -avze 'ssh -p {ssh_port}' {args}" \
48-
" {deploy_dir}/ {ssh_user}@{ssh_host}:{document_root}".format(
51+
cmd = RSYNC_COMMAND.format(
4952
ssh_port=config.deploy.rsync.ssh_port,
5053
args=args,
5154
deploy_dir=config.config.output,

0 commit comments

Comments
 (0)