Skip to content

Commit 28c3b5c

Browse files
committed
Merge pull request #2 from cyplp/master
merge from cyplp repo
2 parents 64a1529 + 7340310 commit 28c3b5c

18 files changed

Lines changed: 473 additions & 29 deletions

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: python
2+
python:
3+
- 2.7
4+
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
5+
install:
6+
# - python bootstrap.py
7+
- pip install zc.buildout
8+
- buildout
9+
# command to run tests, e.g. python setup.py test
10+
script:
11+
- bin/coverage run bin/nosetests -sv
12+
13+
#after_sucess:
14+
# - pip install coveralls
15+
# - coveralls
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
paulla.paste
22
============
33

4-
paste make by paulla
4+
paste made by paulla

README.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

bootstrap.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,6 @@ def normalize_to_url(option, opt_str, value, parser):
136136

137137
options, args = parser.parse_args()
138138

139-
# if -c was provided, we push it back into args for buildout's main function
140-
if options.config_file is not None:
141-
args += ['-c', options.config_file]
142-
143139
if options.eggs:
144140
eggs_dir = os.path.abspath(os.path.expanduser(options.eggs))
145141
else:
@@ -152,8 +148,7 @@ def normalize_to_url(option, opt_str, value, parser):
152148
options.setup_source = setuptools_source
153149

154150
if options.accept_buildout_test_releases:
155-
args.append('buildout:accept-buildout-test-releases=true')
156-
args.append('bootstrap')
151+
args.insert(0, 'buildout:accept-buildout-test-releases=true')
157152

158153
try:
159154
import pkg_resources
@@ -170,6 +165,8 @@ def normalize_to_url(option, opt_str, value, parser):
170165
setup_args['download_base'] = options.download_base
171166
if options.use_distribute:
172167
setup_args['no_fake'] = True
168+
if sys.version_info[:2] == (2, 4):
169+
setup_args['version'] = '0.6.32'
173170
ez['use_setuptools'](**setup_args)
174171
if 'pkg_resources' in sys.modules:
175172
reload(sys.modules['pkg_resources'])
@@ -192,6 +189,8 @@ def normalize_to_url(option, opt_str, value, parser):
192189
find_links = options.download_base
193190
if not find_links:
194191
find_links = os.environ.get('bootstrap-testing-find-links')
192+
if not find_links and options.accept_buildout_test_releases:
193+
find_links = 'http://downloads.buildout.org/'
195194
if find_links:
196195
cmd.extend(['-f', quote(find_links)])
197196

@@ -228,6 +227,8 @@ def _final_version(parsed_version):
228227
bestv = None
229228
for dist in index[req.project_name]:
230229
distv = dist.parsed_version
230+
if distv >= pkg_resources.parse_version('2dev'):
231+
continue
231232
if _final_version(distv):
232233
if bestv is None or distv > bestv:
233234
best = [dist]
@@ -237,8 +238,12 @@ def _final_version(parsed_version):
237238
if best:
238239
best.sort()
239240
version = best[-1].version
241+
240242
if version:
241-
requirement = '=='.join((requirement, version))
243+
requirement += '=='+version
244+
else:
245+
requirement += '<2dev'
246+
242247
cmd.append(requirement)
243248

244249
if is_jython:
@@ -257,6 +262,16 @@ def _final_version(parsed_version):
257262
ws.add_entry(eggs_dir)
258263
ws.require(requirement)
259264
import zc.buildout.buildout
265+
266+
# If there isn't already a command in the args, add bootstrap
267+
if not [a for a in args if '=' not in a]:
268+
args.append('bootstrap')
269+
270+
271+
# if -c was provided, we push it back into args for buildout's main function
272+
if options.config_file is not None:
273+
args[0:0] = ['-c', options.config_file]
274+
260275
zc.buildout.buildout.main(args)
261276
if not options.eggs: # clean up temporary egg directory
262277
shutil.rmtree(eggs_dir)

buildout.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ eggs =
1212
js.bootstrap
1313
rpdb
1414
paulla.paste
15+
nose
16+
coverage
1517
interpreter = python
1618

development.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ resources = js.bootstrap.bootstrap
3636
couchdb.url = http://127.0.0.1:5984
3737
couchdb.db = paste
3838

39+
salt = edrftgyhujiko
40+
3941
[server:main]
4042
use = egg:waitress#main
4143
host = 0.0.0.0

i18n/fr/LC_MESSAGES/mydomain.po

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# French translations for PROJECT.
2+
# Copyright (C) 2013 ORGANIZATION
3+
# This file is distributed under the same license as the PROJECT project.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PROJECT VERSION\n"
10+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11+
"POT-Creation-Date: 2013-07-20 09:39+0200\n"
12+
"PO-Revision-Date: 2013-07-18 22:38+0200\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: fr <LL@li.org>\n"
15+
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=utf-8\n"
18+
"Content-Transfer-Encoding: 8bit\n"
19+
"Generated-By: Babel 0.9.6\n"
20+
21+
#: paulla/paste/templates/home.pt:8
22+
msgid "Add your content"
23+
msgstr ""
24+
25+
#: paulla/paste/templates/home.pt:11
26+
msgid "Title"
27+
msgstr ""
28+
29+
#: paulla/paste/templates/home.pt:17
30+
msgid "Content :"
31+
msgstr ""
32+
33+
#: paulla/paste/templates/home.pt:24
34+
msgid "type source"
35+
msgstr ""
36+
37+
#: paulla/paste/templates/layout.pt:32
38+
msgid "new"
39+
msgstr ""
40+

i18n/mydomain.pot

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Translations template for paulla.paste.
2+
# Copyright (C) 2013 ORGANIZATION
3+
# This file is distributed under the same license as the paulla.paste project.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: paulla.paste 0.0\n"
10+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11+
"POT-Creation-Date: 2013-07-20 09:39+0200\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=utf-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
"Generated-By: Babel 0.9.6\n"
19+
20+
#: paulla/paste/templates/home.pt:8
21+
msgid "Add your content"
22+
msgstr ""
23+
24+
#: paulla/paste/templates/home.pt:11
25+
msgid "Title"
26+
msgstr ""
27+
28+
#: paulla/paste/templates/home.pt:17
29+
msgid "Content :"
30+
msgstr ""
31+
32+
#: paulla/paste/templates/home.pt:24
33+
msgid "type source"
34+
msgstr ""
35+
36+
#: paulla/paste/templates/layout.pt:32
37+
msgid "new"
38+
msgstr ""
39+

paulla/paste/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ def main(global_config, **settings):
1717
get_current_registry().settings = settings
1818

1919
config.add_static_view('static', 'static', cache_max_age=3600)
20+
2021
config.add_route('home', '/')
2122
config.add_route('addContent', '/add')
2223
config.add_route('oneContent', '/{idContent}')
2324
config.add_route('oneContentRaw', '/{idContent}/raw')
25+
config.add_route('update', '/{idContent}/update')
26+
config.add_route('edit', '/{idContent}/edit')
27+
config.add_route('deleteConfirm', '/{idContent}/deleteConfirm')
28+
config.add_route('delete', '/{idContent}/delete')
29+
30+
config.add_route('rss2', '/feeds/rss2')
31+
2432
config.add_fanstatic_resources([resource.strip() for resource in settings['resources'].split(',')]
2533
, r'.*\.pt')
2634

paulla/paste/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import couchdbkit
2+
3+
24
class Paste(couchdbkit.Document):
35
title = couchdbkit.StringProperty()
46
content = couchdbkit.StringProperty()
57
created = couchdbkit.DateTimeProperty()
8+
expire = couchdbkit.DateTimeProperty()
9+
username = couchdbkit.StringProperty()
10+
password = couchdbkit.StringProperty()
611
typeContent = couchdbkit.StringProperty()

0 commit comments

Comments
 (0)