Permalink
Browse files

Merge pull request #2 from cyplp/master

merge from cyplp repo
  • Loading branch information...
cyplp committed Jul 21, 2013
2 parents 64a1529 + 7340310 commit 28c3b5c6f14b42cb1f7e044702689dab06114a64
@@ -0,0 +1,15 @@
language: python
python:
- 2.7
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install:
# - python bootstrap.py
- pip install zc.buildout
- buildout
# command to run tests, e.g. python setup.py test
script:
- bin/coverage run bin/nosetests -sv

#after_sucess:
# - pip install coveralls
# - coveralls
@@ -1,4 +1,4 @@
paulla.paste
============

paste make by paulla
paste made by paulla

This file was deleted.

Oops, something went wrong.
@@ -136,10 +136,6 @@ def normalize_to_url(option, opt_str, value, parser):

options, args = parser.parse_args()

# if -c was provided, we push it back into args for buildout's main function
if options.config_file is not None:
args += ['-c', options.config_file]

if options.eggs:
eggs_dir = os.path.abspath(os.path.expanduser(options.eggs))
else:
@@ -152,8 +148,7 @@ def normalize_to_url(option, opt_str, value, parser):
options.setup_source = setuptools_source

if options.accept_buildout_test_releases:
args.append('buildout:accept-buildout-test-releases=true')
args.append('bootstrap')
args.insert(0, 'buildout:accept-buildout-test-releases=true')

try:
import pkg_resources
@@ -170,6 +165,8 @@ def normalize_to_url(option, opt_str, value, parser):
setup_args['download_base'] = options.download_base
if options.use_distribute:
setup_args['no_fake'] = True
if sys.version_info[:2] == (2, 4):
setup_args['version'] = '0.6.32'
ez['use_setuptools'](**setup_args)
if 'pkg_resources' in sys.modules:
reload(sys.modules['pkg_resources'])
@@ -192,6 +189,8 @@ def normalize_to_url(option, opt_str, value, parser):
find_links = options.download_base
if not find_links:
find_links = os.environ.get('bootstrap-testing-find-links')
if not find_links and options.accept_buildout_test_releases:
find_links = 'http://downloads.buildout.org/'
if find_links:
cmd.extend(['-f', quote(find_links)])

@@ -228,6 +227,8 @@ def _final_version(parsed_version):
bestv = None
for dist in index[req.project_name]:
distv = dist.parsed_version
if distv >= pkg_resources.parse_version('2dev'):
continue
if _final_version(distv):
if bestv is None or distv > bestv:
best = [dist]
@@ -237,8 +238,12 @@ def _final_version(parsed_version):
if best:
best.sort()
version = best[-1].version

if version:
requirement = '=='.join((requirement, version))
requirement += '=='+version
else:
requirement += '<2dev'

cmd.append(requirement)

if is_jython:
@@ -257,6 +262,16 @@ def _final_version(parsed_version):
ws.add_entry(eggs_dir)
ws.require(requirement)
import zc.buildout.buildout

# If there isn't already a command in the args, add bootstrap
if not [a for a in args if '=' not in a]:
args.append('bootstrap')


# if -c was provided, we push it back into args for buildout's main function
if options.config_file is not None:
args[0:0] = ['-c', options.config_file]

zc.buildout.buildout.main(args)
if not options.eggs: # clean up temporary egg directory
shutil.rmtree(eggs_dir)
@@ -12,5 +12,7 @@ eggs =
js.bootstrap
rpdb
paulla.paste
nose
coverage
interpreter = python

@@ -36,6 +36,8 @@ resources = js.bootstrap.bootstrap
couchdb.url = http://127.0.0.1:5984
couchdb.db = paste

salt = edrftgyhujiko

[server:main]
use = egg:waitress#main
host = 0.0.0.0
@@ -0,0 +1,40 @@
# French translations for PROJECT.
# Copyright (C) 2013 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2013-07-20 09:39+0200\n"
"PO-Revision-Date: 2013-07-18 22:38+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: fr <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"

#: paulla/paste/templates/home.pt:8
msgid "Add your content"
msgstr ""

#: paulla/paste/templates/home.pt:11
msgid "Title"
msgstr ""

#: paulla/paste/templates/home.pt:17
msgid "Content :"
msgstr ""

#: paulla/paste/templates/home.pt:24
msgid "type source"
msgstr ""

#: paulla/paste/templates/layout.pt:32
msgid "new"
msgstr ""

@@ -0,0 +1,39 @@
# Translations template for paulla.paste.
# Copyright (C) 2013 ORGANIZATION
# This file is distributed under the same license as the paulla.paste project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: paulla.paste 0.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2013-07-20 09:39+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"

#: paulla/paste/templates/home.pt:8
msgid "Add your content"
msgstr ""

#: paulla/paste/templates/home.pt:11
msgid "Title"
msgstr ""

#: paulla/paste/templates/home.pt:17
msgid "Content :"
msgstr ""

#: paulla/paste/templates/home.pt:24
msgid "type source"
msgstr ""

#: paulla/paste/templates/layout.pt:32
msgid "new"
msgstr ""

@@ -17,10 +17,18 @@ def main(global_config, **settings):
get_current_registry().settings = settings

config.add_static_view('static', 'static', cache_max_age=3600)

config.add_route('home', '/')
config.add_route('addContent', '/add')
config.add_route('oneContent', '/{idContent}')
config.add_route('oneContentRaw', '/{idContent}/raw')
config.add_route('update', '/{idContent}/update')
config.add_route('edit', '/{idContent}/edit')
config.add_route('deleteConfirm', '/{idContent}/deleteConfirm')
config.add_route('delete', '/{idContent}/delete')

config.add_route('rss2', '/feeds/rss2')

config.add_fanstatic_resources([resource.strip() for resource in settings['resources'].split(',')]
, r'.*\.pt')

@@ -1,6 +1,11 @@
import couchdbkit


class Paste(couchdbkit.Document):
title = couchdbkit.StringProperty()
content = couchdbkit.StringProperty()
created = couchdbkit.DateTimeProperty()
expire = couchdbkit.DateTimeProperty()
username = couchdbkit.StringProperty()
password = couchdbkit.StringProperty()
typeContent = couchdbkit.StringProperty()
@@ -1,6 +1,32 @@
<metal:main use-macro="load: layout.pt">
<div metal:fill-slot="content">
<h1>${paste.title}</h1>
<metal:main
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"

use-macro="load: layout.pt">
<div metal:fill-slot="content" class="row">
<h1 class="row">${paste.title}</h1>
<div class="row">
${structure: content}
</div>

<div tal:condition="paste.username and paste.password" class="row">

<label for="author" class="span3" i18n:translate=''>
Author :
</label>
<span class="span5" id='author'>
${paste.username}
</span>
</div>

<a class="row" tal:condition="paste.username and paste.password" href="${request.route_path('edit', idContent=paste._id)}" i18n:translate=''>
Edit
</a>

<a class="row" tal:condition="paste.username and paste.password" href="${request.route_path('deleteConfirm', idContent=paste._id)}" i18n:translate=''>
Delete
</a>
</div>

</metal:main>
@@ -0,0 +1,27 @@
<metal:main
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"

use-macro="load: layout.pt">
<div metal:fill-slot="content" class="row">
<h1 i18n:translate=''>Delete this paste ?</h1>
<h2 class="row">${paste.title}</h2>
<div class="row">
${structure: content}
</div>

<form action="${request.route_path('delete',idContent=paste._id)}" method="POST">
<div class="row">
<lablel class="span3" for="title" i18n:translate=''>
password
</lablel>
<input type="text" id="password" name="password" />
</div>
<div class="row">
<input class="span3" type="submit" />
</div>
</form>

</div>
</metal:main>
@@ -0,0 +1,45 @@
<metal:main
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
use-macro="load: layout.pt">

<div metal:fill-slot="content">
<h1 i18n:translate=''>Edit your content</h1>
<form action="${request.route_path('update',idContent=paste._id)}" method="POST">
<div class="row">
<lablel class="span3" for="title" i18n:translate=''>
Title
</lablel>
<input type="text" id="title" name="title" value='${paste.title}'/>
</div>
<div class="row">
<label class="span3" for="content" i18n:translate=''>
Content :
</label>
<textarea name='content' id='content'>${paste.content}</textarea>
</div>
<div class="row">
<label class="span3" for="type" i18n:translate=''>type source</label>
<select class="span4" name="type" id='type'>
<option tal:repeat="lexer lexers" value="${lexer[1]}">${lexer[0]}</option>
</select>
</div>
<div class="row">
<label class="span3" for="username" i18n:translate=''>
Username
</label>
<span id="username" name="username" class='span3'>${paste.username}</span>
</div>
<div class="row">
<label class="span3" for="password" i18n:translate=''>
Password
</label>
<input type="text" id="password" name="password" />
</div>
<div class='row'>
<input type="submit" value="submit" /> <!-- TODO: translation -->
</div>
</form>
</div>
</metal:main>
Oops, something went wrong.

0 comments on commit 28c3b5c

Please sign in to comment.