Merge branch 'master' into cleanup

This commit is contained in:
Martin Mahner 2017-01-21 14:45:51 +01:00
commit e1c3d21f38
39 changed files with 588 additions and 372 deletions

View file

@ -6,6 +6,7 @@ omit =
dpaste/south_migrations/* dpaste/south_migrations/*
dpaste/tests/* dpaste/tests/*
dpaste/settings/* dpaste/settings/*
dpaste/wsgi.py
[report] [report]
exclude_lines = exclude_lines =

View file

@ -2,17 +2,20 @@ language: python
python: python:
- 2.7 - 2.7
- 3.4
- 3.5 - 3.5
- 3.6
env: env:
- DJANGO=1.8.* - DJANGO: django>=1.8,<1.9
- DJANGO=1.9.* - DJANGO: django>=1.9,<1.10
- DJANGO: django>=1.10,<1.11
before_install: before_install:
- pip install codecov - pip install codecov
install: install:
- pip install django==$DJANGO - pip install $DJANGO
- pip install -e . - pip install -e .
script: script:

View file

@ -1,13 +1,41 @@
Changelog Changelog
========= =========
2.11 (master) 2.14 (master)
----------------- -------------
* Dropped the Github Gist export function. * Removed "Suspicious" middleware which was never been used, documented,
and also not functional for a while.
* All views are now class based and use the latest generic based views sugar * All views are now class based and use the latest generic based views sugar
provided by Django. provided by Django.
2.13 (2017-01-20)
-----------------
* (Backwards incompatible) Removal of django-mptt and therefor the removal of a
tree based snippet list, due to performance reasons with large snippet counts.
Snippets still have a 'parent' relation if it's an answer of another snippet,
however this is no longer a Nested Set. The UI is simplified too and the user
can now only compare an answer to it's parent snippet. I believe this is the
major use case anyway.
* (Backwards incompatible) Removal of the "Gist" button feature.
* Fixed broken 404 view handler in Django 1.9+.
* Python 3.6 and Django 1.10 compatibility and tests.
2.12 (2016-09-06)
-----------------
* Fixed "Content Type" problem with Django 1.10.
* Development requirements now use a different version scheme to be
compatible with older `pip` versions.
2.11 (2016-09-04)
-----------------
* Django 1.10 Support
* R Lexer is enabled by default
* Minor fixes and improvements.
2.10 (2016-03-23) 2.10 (2016-03-23)
----------------- -----------------

View file

@ -1,4 +1,4 @@
.. image:: https://travis-ci.org/bartTC/dpaste.png?branch=master .. image:: https://travis-ci.org/bartTC/dpaste.svg?branch=master
:target: https://travis-ci.org/bartTC/dpaste :target: https://travis-ci.org/bartTC/dpaste
.. image:: https://codecov.io/github/bartTC/dpaste/coverage.svg?branch=master .. image:: https://codecov.io/github/bartTC/dpaste/coverage.svg?branch=master

View file

@ -10,14 +10,12 @@ necessary dependencies of dpaste as well::
pip install dpaste pip install dpaste
Add ``dpaste`` and ``mptt`` to your ``INSTALLED_APPS``:: Add ``dpaste`` to your ``INSTALLED_APPS``::
INSTALLED_APPS = ( INSTALLED_APPS = (
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
# ... # ...
'mptt',
'dpaste', 'dpaste',
) )

View file

@ -95,16 +95,19 @@ behavior without touching the code:
``3600 * 24 * 30 * 12 * 100`` or simpler: ``DPASTE_EXPIRE_CHOICES[2][0]``. ``3600 * 24 * 30 * 12 * 100`` or simpler: ``DPASTE_EXPIRE_CHOICES[2][0]``.
``DPASTE_ENABLE_GIST`` ``DPASTE_ENABLE_GIST``
**Removed in Version 2.13!**
Boolean. Whether to display the Gist button for re-pasting to GitHub. Boolean. Whether to display the Gist button for re-pasting to GitHub.
Default: ``True`` Default: ``True``
..warning: This feature was removed in v2.11. ..warning: This feature was removed in v2.11.
``DPASTE_DEFAULT_GIST_NAME`` ``DPASTE_DEFAULT_GIST_NAME``
**Removed in Version 2.13!**
String. The filename used when pasting a snippet on Github Gist. String. The filename used when pasting a snippet on Github Gist.
Default: ``dpaste.de_snippet.py`` Default: ``dpaste.de_snippet.py``
``DPASTE_DEFAULT_GIST_DESCRIPTION`` ``DPASTE_DEFAULT_GIST_DESCRIPTION``
**Removed in Version 2.13!**
String. The filename used when pasting a snippet on Github Gist. String. The filename used when pasting a snippet on Github Gist.
Default: ``dpaste.de_snippet.py`` Default: ``dpaste.de_snippet.py``

View file

@ -0,0 +1,8 @@
from django.conf import settings
def dpaste_globals(request):
return {
'site_name': getattr(settings, 'DPASTE_SITE_NAME', 'dpaste.de'),
'jquery_url': getattr(settings, 'DPASTE_JQUERY_URL',
'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js'),
}

View file

@ -84,6 +84,7 @@ LEXER_LIST = getattr(settings, 'DPASTE_LEXER_LIST', (
('properties', 'Properties'), ('properties', 'Properties'),
('puppet', 'Puppet'), ('puppet', 'Puppet'),
('python', 'Python'), ('python', 'Python'),
('r', 'R'),
('rb', 'Ruby'), ('rb', 'Ruby'),
('rst', 'reStructuredText'), ('rst', 'reStructuredText'),
('rust', 'Rust'), ('rust', 'Rust'),

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: dpaste\n" "Project-Id-Version: dpaste\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-12 04:00+0000\n" "POT-Creation-Date: 2016-12-02 14:51+0100\n"
"PO-Revision-Date: 2014-10-28 11:20+0100\n" "PO-Revision-Date: 2014-10-28 11:20+0100\n"
"Last-Translator: Martin Mahner <martin@mahner.org>\n" "Last-Translator: Martin Mahner <martin@mahner.org>\n"
"Language-Team: DE <LL@li.org>\n" "Language-Team: DE <LL@li.org>\n"
@ -18,163 +18,160 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.10\n" "X-Generator: Poedit 1.6.10\n"
#: dpaste/forms.py:11 dpaste/models.py:37 #: forms.py:11 models.py:37 templates/dpaste/snippet_details.html:65
#: dpaste/templates/dpaste/snippet_details.html:59
msgid "One-Time snippet" msgid "One-Time snippet"
msgstr "One-Time snippet" msgstr "One-Time snippet"
#: dpaste/forms.py:12 #: forms.py:12
msgid "In one hour" msgid "In one hour"
msgstr "In einer Stunde" msgstr "In einer Stunde"
#: dpaste/forms.py:13 #: forms.py:13
msgid "In one week" msgid "In one week"
msgstr "In einer Woche" msgstr "In einer Woche"
#: dpaste/forms.py:14 #: forms.py:14
msgid "In one month" msgid "In one month"
msgstr "In einem Monat" msgstr "In einem Monat"
#: dpaste/forms.py:15 #: forms.py:15
msgid "Never" msgid "Never"
msgstr "Niemals" msgstr "Niemals"
#: dpaste/forms.py:36 dpaste/models.py:42 #: forms.py:36 models.py:42
msgid "Content" msgid "Content"
msgstr "Inhalt" msgstr "Inhalt"
#: dpaste/forms.py:37 #: forms.py:37
msgid "Awesome code goes here..." msgid "Awesome code goes here..."
msgstr "Geiler Code hier rein..." msgstr "Geiler Code hier rein..."
#: dpaste/forms.py:42 dpaste/models.py:43 #: forms.py:42 models.py:43
msgid "Lexer" msgid "Lexer"
msgstr "Syntax" msgstr "Syntax"
#: dpaste/forms.py:49 dpaste/models.py:47 #: forms.py:49 models.py:47
msgid "Expires" msgid "Expires"
msgstr "Läuft ab" msgstr "Läuft ab"
#: dpaste/forms.py:57 #: forms.py:57
msgid "Title" msgid "Title"
msgstr "Titel" msgstr "Titel"
#: dpaste/forms.py:85 #: forms.py:85
msgid "This field is required." msgid "This field is required."
msgstr "Dieses Feld ist erforderlich." msgstr "Dieses Feld ist erforderlich."
#: dpaste/highlight.py:33 #: highlight.py:33
msgid "Highlighted" msgid "Highlighted"
msgstr "Markiert" msgstr "Markiert"
#: dpaste/models.py:35 #: models.py:35
msgid "Expire by timestamp" msgid "Expire by timestamp"
msgstr "Nach Zeitstempel auslaufen lassen" msgstr "Nach Zeitstempel auslaufen lassen"
#: dpaste/models.py:36 #: models.py:36
msgid "Keep Forever" msgid "Keep Forever"
msgstr "Für immer behalten" msgstr "Für immer behalten"
#: dpaste/models.py:40 #: models.py:40
msgid "Secret ID" msgid "Secret ID"
msgstr "Geheime ID" msgstr "Geheime ID"
#: dpaste/models.py:44 #: models.py:44
msgid "Published" msgid "Published"
msgstr "Veröffentlicht" msgstr "Veröffentlicht"
#: dpaste/models.py:45 #: models.py:45
msgid "Expire Type" msgid "Expire Type"
msgstr "Auslauftyp" msgstr "Auslauftyp"
#: dpaste/models.py:48 #: models.py:48
msgid "View count" msgid "View count"
msgstr "Anzahl der Besuche" msgstr "Anzahl der Besuche"
#: dpaste/templates/dpaste/about.html:59 #: templates/dpaste/about.html:59
msgid "Statistics" msgid "Statistics"
msgstr "Statistiken" msgstr "Statistiken"
#: dpaste/templates/dpaste/about.html:61 #: templates/dpaste/about.html:61
#, python-format #, python-format
msgid "" msgid ""
"There are %(total)s snippets in the database. The most popular languages are:" "There are %(total)s snippets in the database. The most popular languages are:"
msgstr "Es gibt %(total)s in der Datenbank. Die populärsten Sprachen sind:" msgstr "Es gibt %(total)s in der Datenbank. Die populärsten Sprachen sind:"
#: dpaste/templates/dpaste/base.html:8 dpaste/templates/dpaste/base.html:21 #: templates/dpaste/base.html:7 templates/dpaste/base.html:20
#: dpaste/templates/dpaste/snippet_new.html:6 #: templates/dpaste/snippet_new.html:5 templates/dpaste/snippet_new.html:6
#: dpaste/templates/dpaste/snippet_new.html:7
msgid "New snippet" msgid "New snippet"
msgstr "Neues Snippet" msgstr "Neues Snippet"
#: dpaste/templates/dpaste/base.html:19 #: templates/dpaste/base.html:18
msgid "About" msgid "About"
msgstr "Über" msgstr "Über"
#: dpaste/templates/dpaste/base.html:20 #: templates/dpaste/base.html:19
msgid "History" msgid "History"
msgstr "Verlauf" msgstr "Verlauf"
#: dpaste/templates/dpaste/snippet_details.html:8 #: templates/dpaste/snippet_details.html:7
#: dpaste/templates/dpaste/snippet_details.html:9
msgid "Snippet" msgid "Snippet"
msgstr "Snippet" msgstr "Snippet"
#: dpaste/templates/dpaste/snippet_details.html:41 #: templates/dpaste/snippet_details.html:47
msgid "Compare" msgid "Compare"
msgstr "Vergleichen" msgstr "Vergleichen"
#: dpaste/templates/dpaste/snippet_details.html:55 #: templates/dpaste/snippet_details.html:61
#, python-format #, python-format
msgid "Expires in: %(date)s" msgid "Expires in: %(date)s"
msgstr "Erlischt in: %(date)s" msgstr "Erlischt in: %(date)s"
#: dpaste/templates/dpaste/snippet_details.html:57 #: templates/dpaste/snippet_details.html:63
msgid "Snippet never expires" msgid "Snippet never expires"
msgstr "Snippet erlischt niemals" msgstr "Snippet erlischt niemals"
#: dpaste/templates/dpaste/snippet_details.html:63 #: templates/dpaste/snippet_details.html:69
msgid "Really delete this snippet?" msgid "Really delete this snippet?"
msgstr "Dieses Snippet wirklich löschen?" msgstr "Dieses Snippet wirklich löschen?"
#: dpaste/templates/dpaste/snippet_details.html:63 #: templates/dpaste/snippet_details.html:69
msgid "Delete Now" msgid "Delete Now"
msgstr "Jetzt löschen" msgstr "Jetzt löschen"
#: dpaste/templates/dpaste/snippet_details.html:66 #: templates/dpaste/snippet_details.html:72
msgid "Compare Snippets" msgid "Compare Snippets"
msgstr "Snippets vergleichen" msgstr "Snippets vergleichen"
#: dpaste/templates/dpaste/snippet_details.html:69 #: templates/dpaste/snippet_details.html:75
msgid "View Raw" msgid "View Raw"
msgstr "Unformatiert" msgstr "Unformatiert"
#: dpaste/templates/dpaste/snippet_details.html:73 #: templates/dpaste/snippet_details.html:79
msgid "Gist" msgid "Gist"
msgstr "Gist" msgstr "Gist"
#: dpaste/templates/dpaste/snippet_details.html:82 #: templates/dpaste/snippet_details.html:88
msgid "This is a one-time snippet." msgid "This is a one-time snippet."
msgstr "Dies ist ein One-Time Snippet." msgstr "Dies ist ein One-Time Snippet."
#: dpaste/templates/dpaste/snippet_details.html:84 #: templates/dpaste/snippet_details.html:90
#, python-format #, python-format
msgid "It is automatically removed after %(remaining)s further views." msgid "It is automatically removed after %(remaining)s further views."
msgstr "Es wird automatisch nach %(remaining)s weiteren Ansichten entfernt." msgstr "Es wird automatisch nach %(remaining)s weiteren Ansichten entfernt."
#: dpaste/templates/dpaste/snippet_details.html:86 #: templates/dpaste/snippet_details.html:92
msgid "It is automatically removed after the next view." msgid "It is automatically removed after the next view."
msgstr "Es wird automatisch nach der nächsten Ansicht entfernt." msgstr "Es wird automatisch nach der nächsten Ansicht entfernt."
#: dpaste/templates/dpaste/snippet_details.html:88 #: templates/dpaste/snippet_details.html:94
msgid "It cannot be viewed again." msgid "It cannot be viewed again."
msgstr "Es kann nicht noch einmal angesehen werden." msgstr "Es kann nicht noch einmal angesehen werden."
#: dpaste/templates/dpaste/snippet_details.html:108 #: templates/dpaste/snippet_details.html:114
msgid "Reply to this snippet" msgid "Reply to this snippet"
msgstr "Antworte auf dieses Snippet" msgstr "Antworte auf dieses Snippet"
#: dpaste/templates/dpaste/snippet_diff.html:5 #: templates/dpaste/snippet_diff.html:4
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"
@ -187,28 +184,28 @@ msgstr ""
"href=\"%(fileb_url)s\">#%(fileb_id)s</a>\n" "href=\"%(fileb_url)s\">#%(fileb_id)s</a>\n"
" " " "
#: dpaste/templates/dpaste/snippet_form.html:32 #: templates/dpaste/snippet_form.html:31
msgid "Expire in" msgid "Expire in"
msgstr "Erlischt in" msgstr "Erlischt in"
#: dpaste/templates/dpaste/snippet_form.html:38 #: templates/dpaste/snippet_form.html:37
msgid "Paste it" msgid "Paste it"
msgstr "Paste" msgstr "Paste"
#: dpaste/templates/dpaste/snippet_form.html:39 #: templates/dpaste/snippet_form.html:38
msgid "or" msgid "or"
msgstr "oder" msgstr "oder"
#: dpaste/templates/dpaste/snippet_list.html:16 #: templates/dpaste/snippet_list.html:15
msgid "DATETIME_FORMAT" msgid "DATETIME_FORMAT"
msgstr "DATETIME_FORMAT" msgstr "DATETIME_FORMAT"
#: dpaste/templates/dpaste/snippet_list.html:17 #: templates/dpaste/snippet_list.html:16
#, python-format #, python-format
msgid "%(since)s ago" msgid "%(since)s ago"
msgstr "Vor %(since)s" msgstr "Vor %(since)s"
#: dpaste/templates/dpaste/snippet_list.html:23 #: templates/dpaste/snippet_list.html:22
msgid "" msgid ""
"No snippets saved. Either all your snippets are expired or your cookie has " "No snippets saved. Either all your snippets are expired or your cookie has "
"changed." "changed."
@ -216,7 +213,7 @@ msgstr ""
"Keine Snippets gespeichert. Entweder sind alle deine Snippets erloschen oder " "Keine Snippets gespeichert. Entweder sind alle deine Snippets erloschen oder "
"dein Cookie hat sich geändert." "dein Cookie hat sich geändert."
#: dpaste/views.py:199 #: views.py:180
msgid "No changes were made between this two files." msgid "No changes were made between this two files."
msgstr "Zwischen diesen beiden Dateien wurden keine Änderungen gemacht." msgstr "Zwischen diesen beiden Dateien wurden keine Änderungen gemacht."

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-12 04:00+0000\n" "POT-Creation-Date: 2016-12-02 14:51+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,163 +17,160 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: dpaste/forms.py:11 dpaste/models.py:37 #: forms.py:11 models.py:37 templates/dpaste/snippet_details.html:65
#: dpaste/templates/dpaste/snippet_details.html:59
msgid "One-Time snippet" msgid "One-Time snippet"
msgstr "" msgstr ""
#: dpaste/forms.py:12 #: forms.py:12
msgid "In one hour" msgid "In one hour"
msgstr "" msgstr ""
#: dpaste/forms.py:13 #: forms.py:13
msgid "In one week" msgid "In one week"
msgstr "" msgstr ""
#: dpaste/forms.py:14 #: forms.py:14
msgid "In one month" msgid "In one month"
msgstr "" msgstr ""
#: dpaste/forms.py:15 #: forms.py:15
msgid "Never" msgid "Never"
msgstr "" msgstr ""
#: dpaste/forms.py:36 dpaste/models.py:42 #: forms.py:36 models.py:42
msgid "Content" msgid "Content"
msgstr "" msgstr ""
#: dpaste/forms.py:37 #: forms.py:37
msgid "Awesome code goes here..." msgid "Awesome code goes here..."
msgstr "" msgstr ""
#: dpaste/forms.py:42 dpaste/models.py:43 #: forms.py:42 models.py:43
msgid "Lexer" msgid "Lexer"
msgstr "" msgstr ""
#: dpaste/forms.py:49 dpaste/models.py:47 #: forms.py:49 models.py:47
msgid "Expires" msgid "Expires"
msgstr "" msgstr ""
#: dpaste/forms.py:57 #: forms.py:57
msgid "Title" msgid "Title"
msgstr "" msgstr ""
#: dpaste/forms.py:85 #: forms.py:85
msgid "This field is required." msgid "This field is required."
msgstr "" msgstr ""
#: dpaste/highlight.py:33 #: highlight.py:33
msgid "Highlighted" msgid "Highlighted"
msgstr "" msgstr ""
#: dpaste/models.py:35 #: models.py:35
msgid "Expire by timestamp" msgid "Expire by timestamp"
msgstr "" msgstr ""
#: dpaste/models.py:36 #: models.py:36
msgid "Keep Forever" msgid "Keep Forever"
msgstr "" msgstr ""
#: dpaste/models.py:40 #: models.py:40
msgid "Secret ID" msgid "Secret ID"
msgstr "" msgstr ""
#: dpaste/models.py:44 #: models.py:44
msgid "Published" msgid "Published"
msgstr "" msgstr ""
#: dpaste/models.py:45 #: models.py:45
msgid "Expire Type" msgid "Expire Type"
msgstr "" msgstr ""
#: dpaste/models.py:48 #: models.py:48
msgid "View count" msgid "View count"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/about.html:59 #: templates/dpaste/about.html:59
msgid "Statistics" msgid "Statistics"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/about.html:61 #: templates/dpaste/about.html:61
#, python-format #, python-format
msgid "" msgid ""
"There are %(total)s snippets in the database. The most popular languages are:" "There are %(total)s snippets in the database. The most popular languages are:"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/base.html:8 dpaste/templates/dpaste/base.html:21 #: templates/dpaste/base.html:7 templates/dpaste/base.html:20
#: dpaste/templates/dpaste/snippet_new.html:6 #: templates/dpaste/snippet_new.html:5 templates/dpaste/snippet_new.html:6
#: dpaste/templates/dpaste/snippet_new.html:7
msgid "New snippet" msgid "New snippet"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/base.html:19 #: templates/dpaste/base.html:18
msgid "About" msgid "About"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/base.html:20 #: templates/dpaste/base.html:19
msgid "History" msgid "History"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:8 #: templates/dpaste/snippet_details.html:7
#: dpaste/templates/dpaste/snippet_details.html:9
msgid "Snippet" msgid "Snippet"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:41 #: templates/dpaste/snippet_details.html:47
msgid "Compare" msgid "Compare"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:55 #: templates/dpaste/snippet_details.html:61
#, python-format #, python-format
msgid "Expires in: %(date)s" msgid "Expires in: %(date)s"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:57 #: templates/dpaste/snippet_details.html:63
msgid "Snippet never expires" msgid "Snippet never expires"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:63 #: templates/dpaste/snippet_details.html:69
msgid "Really delete this snippet?" msgid "Really delete this snippet?"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:63 #: templates/dpaste/snippet_details.html:69
msgid "Delete Now" msgid "Delete Now"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:66 #: templates/dpaste/snippet_details.html:72
msgid "Compare Snippets" msgid "Compare Snippets"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:69 #: templates/dpaste/snippet_details.html:75
msgid "View Raw" msgid "View Raw"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:73 #: templates/dpaste/snippet_details.html:79
msgid "Gist" msgid "Gist"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:82 #: templates/dpaste/snippet_details.html:88
msgid "This is a one-time snippet." msgid "This is a one-time snippet."
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:84 #: templates/dpaste/snippet_details.html:90
#, python-format #, python-format
msgid "It is automatically removed after %(remaining)s further views." msgid "It is automatically removed after %(remaining)s further views."
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:86 #: templates/dpaste/snippet_details.html:92
msgid "It is automatically removed after the next view." msgid "It is automatically removed after the next view."
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:88 #: templates/dpaste/snippet_details.html:94
msgid "It cannot be viewed again." msgid "It cannot be viewed again."
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_details.html:108 #: templates/dpaste/snippet_details.html:114
msgid "Reply to this snippet" msgid "Reply to this snippet"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_diff.html:5 #: templates/dpaste/snippet_diff.html:4
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"
@ -182,33 +179,33 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_form.html:32 #: templates/dpaste/snippet_form.html:31
msgid "Expire in" msgid "Expire in"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_form.html:38 #: templates/dpaste/snippet_form.html:37
msgid "Paste it" msgid "Paste it"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_form.html:39 #: templates/dpaste/snippet_form.html:38
msgid "or" msgid "or"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_list.html:16 #: templates/dpaste/snippet_list.html:15
msgid "DATETIME_FORMAT" msgid "DATETIME_FORMAT"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_list.html:17 #: templates/dpaste/snippet_list.html:16
#, python-format #, python-format
msgid "%(since)s ago" msgid "%(since)s ago"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_list.html:23 #: templates/dpaste/snippet_list.html:22
msgid "" msgid ""
"No snippets saved. Either all your snippets are expired or your cookie has " "No snippets saved. Either all your snippets are expired or your cookie has "
"changed." "changed."
msgstr "" msgstr ""
#: dpaste/views.py:199 #: views.py:180
msgid "No changes were made between this two files." msgid "No changes were made between this two files."
msgstr "" msgstr ""

View file

@ -9,7 +9,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: dpaste\n" "Project-Id-Version: dpaste\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-12 04:00+0000\n" "POT-Creation-Date: 2016-12-02 14:51+0100\n"
"PO-Revision-Date: 2014-10-27 17:05+0000\n" "PO-Revision-Date: 2014-10-27 17:05+0000\n"
"Last-Translator: Leonardo J. Caballero G. <leonardocaballero@gmail.com>\n" "Last-Translator: Leonardo J. Caballero G. <leonardocaballero@gmail.com>\n"
"Language-Team: Spanish (http://www.transifex.com/projects/p/dpaste/language/" "Language-Team: Spanish (http://www.transifex.com/projects/p/dpaste/language/"
@ -20,84 +20,83 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: dpaste/forms.py:11 dpaste/models.py:37 #: forms.py:11 models.py:37 templates/dpaste/snippet_details.html:65
#: dpaste/templates/dpaste/snippet_details.html:59
msgid "One-Time snippet" msgid "One-Time snippet"
msgstr "Apenas una visualización" msgstr "Apenas una visualización"
#: dpaste/forms.py:12 #: forms.py:12
msgid "In one hour" msgid "In one hour"
msgstr "En una hora" msgstr "En una hora"
#: dpaste/forms.py:13 #: forms.py:13
msgid "In one week" msgid "In one week"
msgstr "En una semana" msgstr "En una semana"
#: dpaste/forms.py:14 #: forms.py:14
msgid "In one month" msgid "In one month"
msgstr "En un mes" msgstr "En un mes"
#: dpaste/forms.py:15 #: forms.py:15
msgid "Never" msgid "Never"
msgstr "Nunca" msgstr "Nunca"
#: dpaste/forms.py:36 dpaste/models.py:42 #: forms.py:36 models.py:42
msgid "Content" msgid "Content"
msgstr "Contenido" msgstr "Contenido"
#: dpaste/forms.py:37 #: forms.py:37
msgid "Awesome code goes here..." msgid "Awesome code goes here..."
msgstr "Su código increíble va aquí..." msgstr "Su código increíble va aquí..."
#: dpaste/forms.py:42 dpaste/models.py:43 #: forms.py:42 models.py:43
msgid "Lexer" msgid "Lexer"
msgstr "Lexer" msgstr "Lexer"
#: dpaste/forms.py:49 dpaste/models.py:47 #: forms.py:49 models.py:47
msgid "Expires" msgid "Expires"
msgstr "Caduca" msgstr "Caduca"
#: dpaste/forms.py:57 #: forms.py:57
msgid "Title" msgid "Title"
msgstr "Título" msgstr "Título"
#: dpaste/forms.py:85 #: forms.py:85
msgid "This field is required." msgid "This field is required."
msgstr "Este campo es obligatorio." msgstr "Este campo es obligatorio."
#: dpaste/highlight.py:33 #: highlight.py:33
msgid "Highlighted" msgid "Highlighted"
msgstr "Destacado" msgstr "Destacado"
#: dpaste/models.py:35 #: models.py:35
msgid "Expire by timestamp" msgid "Expire by timestamp"
msgstr "Caduca por fecha y hora" msgstr "Caduca por fecha y hora"
#: dpaste/models.py:36 #: models.py:36
msgid "Keep Forever" msgid "Keep Forever"
msgstr "Guarde por siempre" msgstr "Guarde por siempre"
#: dpaste/models.py:40 #: models.py:40
msgid "Secret ID" msgid "Secret ID"
msgstr "ID secreto" msgstr "ID secreto"
#: dpaste/models.py:44 #: models.py:44
msgid "Published" msgid "Published"
msgstr "Publicado" msgstr "Publicado"
#: dpaste/models.py:45 #: models.py:45
msgid "Expire Type" msgid "Expire Type"
msgstr "Tipo de Caducidad " msgstr "Tipo de Caducidad "
#: dpaste/models.py:48 #: models.py:48
msgid "View count" msgid "View count"
msgstr "Visualizaciones" msgstr "Visualizaciones"
#: dpaste/templates/dpaste/about.html:59 #: templates/dpaste/about.html:59
msgid "Statistics" msgid "Statistics"
msgstr " Estadísticas" msgstr " Estadísticas"
#: dpaste/templates/dpaste/about.html:61 #: templates/dpaste/about.html:61
#, python-format #, python-format
msgid "" msgid ""
"There are %(total)s snippets in the database. The most popular languages are:" "There are %(total)s snippets in the database. The most popular languages are:"
@ -105,81 +104,79 @@ msgstr ""
"Hay %(total)s fragmentos en la base de datos. Los lenguajes más populares " "Hay %(total)s fragmentos en la base de datos. Los lenguajes más populares "
"son:" "son:"
#: dpaste/templates/dpaste/base.html:8 dpaste/templates/dpaste/base.html:21 #: templates/dpaste/base.html:7 templates/dpaste/base.html:20
#: dpaste/templates/dpaste/snippet_new.html:6 #: templates/dpaste/snippet_new.html:5 templates/dpaste/snippet_new.html:6
#: dpaste/templates/dpaste/snippet_new.html:7
msgid "New snippet" msgid "New snippet"
msgstr "Nuevo fragmento" msgstr "Nuevo fragmento"
#: dpaste/templates/dpaste/base.html:19 #: templates/dpaste/base.html:18
msgid "About" msgid "About"
msgstr "Acerca" msgstr "Acerca"
#: dpaste/templates/dpaste/base.html:20 #: templates/dpaste/base.html:19
msgid "History" msgid "History"
msgstr "Histórico" msgstr "Histórico"
#: dpaste/templates/dpaste/snippet_details.html:8 #: templates/dpaste/snippet_details.html:7
#: dpaste/templates/dpaste/snippet_details.html:9
msgid "Snippet" msgid "Snippet"
msgstr "Fragmento" msgstr "Fragmento"
#: dpaste/templates/dpaste/snippet_details.html:41 #: templates/dpaste/snippet_details.html:47
msgid "Compare" msgid "Compare"
msgstr "Comparar" msgstr "Comparar"
#: dpaste/templates/dpaste/snippet_details.html:55 #: templates/dpaste/snippet_details.html:61
#, python-format #, python-format
msgid "Expires in: %(date)s" msgid "Expires in: %(date)s"
msgstr "Caduca en: %(date)s" msgstr "Caduca en: %(date)s"
#: dpaste/templates/dpaste/snippet_details.html:57 #: templates/dpaste/snippet_details.html:63
msgid "Snippet never expires" msgid "Snippet never expires"
msgstr "El fragmento nunca caduca" msgstr "El fragmento nunca caduca"
#: dpaste/templates/dpaste/snippet_details.html:63 #: templates/dpaste/snippet_details.html:69
msgid "Really delete this snippet?" msgid "Really delete this snippet?"
msgstr "¿Realmente desea eliminar este fragmento?" msgstr "¿Realmente desea eliminar este fragmento?"
#: dpaste/templates/dpaste/snippet_details.html:63 #: templates/dpaste/snippet_details.html:69
msgid "Delete Now" msgid "Delete Now"
msgstr "Eliminar ahora" msgstr "Eliminar ahora"
#: dpaste/templates/dpaste/snippet_details.html:66 #: templates/dpaste/snippet_details.html:72
msgid "Compare Snippets" msgid "Compare Snippets"
msgstr "Comparar Snippets" msgstr "Comparar Snippets"
#: dpaste/templates/dpaste/snippet_details.html:69 #: templates/dpaste/snippet_details.html:75
msgid "View Raw" msgid "View Raw"
msgstr "Ver en crudo" msgstr "Ver en crudo"
#: dpaste/templates/dpaste/snippet_details.html:73 #: templates/dpaste/snippet_details.html:79
msgid "Gist" msgid "Gist"
msgstr "Gist" msgstr "Gist"
#: dpaste/templates/dpaste/snippet_details.html:82 #: templates/dpaste/snippet_details.html:88
msgid "This is a one-time snippet." msgid "This is a one-time snippet."
msgstr "Este fragmento podrá ser visualizado apenas sólo una vez." msgstr "Este fragmento podrá ser visualizado apenas sólo una vez."
#: dpaste/templates/dpaste/snippet_details.html:84 #: templates/dpaste/snippet_details.html:90
#, python-format #, python-format
msgid "It is automatically removed after %(remaining)s further views." msgid "It is automatically removed after %(remaining)s further views."
msgstr "" msgstr ""
"Automáticamente eliminado después de más %(remaining)s visualizaciones." "Automáticamente eliminado después de más %(remaining)s visualizaciones."
#: dpaste/templates/dpaste/snippet_details.html:86 #: templates/dpaste/snippet_details.html:92
msgid "It is automatically removed after the next view." msgid "It is automatically removed after the next view."
msgstr "Automáticamente eliminado después de la próxima visualización." msgstr "Automáticamente eliminado después de la próxima visualización."
#: dpaste/templates/dpaste/snippet_details.html:88 #: templates/dpaste/snippet_details.html:94
msgid "It cannot be viewed again." msgid "It cannot be viewed again."
msgstr "No puede sera más visualizado." msgstr "No puede sera más visualizado."
#: dpaste/templates/dpaste/snippet_details.html:108 #: templates/dpaste/snippet_details.html:114
msgid "Reply to this snippet" msgid "Reply to this snippet"
msgstr "Responder fragmento" msgstr "Responder fragmento"
#: dpaste/templates/dpaste/snippet_diff.html:5 #: templates/dpaste/snippet_diff.html:4
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"
@ -191,28 +188,28 @@ msgstr ""
"Comparar entre <a href=\"%(filea_url)s\">#%(filea_id)s</a> y <a href=" "Comparar entre <a href=\"%(filea_url)s\">#%(filea_id)s</a> y <a href="
"\"%(fileb_url)s\">#%(fileb_id)s</a>" "\"%(fileb_url)s\">#%(fileb_id)s</a>"
#: dpaste/templates/dpaste/snippet_form.html:32 #: templates/dpaste/snippet_form.html:31
msgid "Expire in" msgid "Expire in"
msgstr "Caduca en" msgstr "Caduca en"
#: dpaste/templates/dpaste/snippet_form.html:38 #: templates/dpaste/snippet_form.html:37
msgid "Paste it" msgid "Paste it"
msgstr "Pegarlo" msgstr "Pegarlo"
#: dpaste/templates/dpaste/snippet_form.html:39 #: templates/dpaste/snippet_form.html:38
msgid "or" msgid "or"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_list.html:16 #: templates/dpaste/snippet_list.html:15
msgid "DATETIME_FORMAT" msgid "DATETIME_FORMAT"
msgstr "DATETIME_FORMAT" msgstr "DATETIME_FORMAT"
#: dpaste/templates/dpaste/snippet_list.html:17 #: templates/dpaste/snippet_list.html:16
#, python-format #, python-format
msgid "%(since)s ago" msgid "%(since)s ago"
msgstr "%(since)s atrás" msgstr "%(since)s atrás"
#: dpaste/templates/dpaste/snippet_list.html:23 #: templates/dpaste/snippet_list.html:22
msgid "" msgid ""
"No snippets saved. Either all your snippets are expired or your cookie has " "No snippets saved. Either all your snippets are expired or your cookie has "
"changed." "changed."
@ -220,6 +217,6 @@ msgstr ""
"No hay fragmentos guardados. O sus fragmentos han caducado o su cookie " "No hay fragmentos guardados. O sus fragmentos han caducado o su cookie "
"cambió." "cambió."
#: dpaste/views.py:199 #: views.py:180
msgid "No changes were made between this two files." msgid "No changes were made between this two files."
msgstr "No hay cambios entre estos dos archivos." msgstr "No hay cambios entre estos dos archivos."

Binary file not shown.

View file

@ -0,0 +1,214 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# GenghisKhan <genghiskhan@gmx.ca>, 2016.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-02 14:51+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: GenghisKhan <genghiskhan@gmx.ca>\n"
"Language-Team: Hebrew <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Language: he\n"
"X-Source-Language: en\n"
#: forms.py:11 models.py:37 templates/dpaste/snippet_details.html:65
msgid "One-Time snippet"
msgstr "חתיכה חד-פעמית"
#: forms.py:12
msgid "In one hour"
msgstr "בתוך שעה אחת"
#: forms.py:13
msgid "In one week"
msgstr "בתוך שבוע אחד"
#: forms.py:14
msgid "In one month"
msgstr "בתוך חודש אחד"
#: forms.py:15
msgid "Never"
msgstr "לעולם לא"
#: forms.py:36 models.py:42
msgid "Content"
msgstr "תוכן"
#: forms.py:37
msgid "Awesome code goes here..."
msgstr "קוד מגניב הולך לכאן..."
#: forms.py:42 models.py:43
msgid "Lexer"
msgstr "Lexer"
#: forms.py:49 models.py:47
msgid "Expires"
msgstr "פג"
#: forms.py:57
msgid "Title"
msgstr "כותרת"
#: forms.py:85
msgid "This field is required."
msgstr "שדה זה הינו נדרש."
#: highlight.py:33
msgid "Highlighted"
msgstr "מודגשים"
#: models.py:35
msgid "Expire by timestamp"
msgstr "פוקע לפי חותמת זמן"
#: models.py:36
msgid "Keep Forever"
msgstr "שמור לנצח"
#: models.py:40
msgid "Secret ID"
msgstr "מזהה סודי"
#: models.py:44
msgid "Published"
msgstr "פורסם"
#: models.py:45
msgid "Expire Type"
msgstr "טיפוס תפוגה"
#: models.py:48
msgid "View count"
msgstr "מונה צפיות"
#: templates/dpaste/about.html:59
msgid "Statistics"
msgstr "סטטיסטיקות"
#: templates/dpaste/about.html:61
#, python-format
msgid ""
"There are %(total)s snippets in the database. The most popular languages are:"
msgstr "ישנן %(total)s חתיכות במסד נתונים. השפות השכיחות ביותר הן:"
#: templates/dpaste/base.html:7 templates/dpaste/base.html:20
#: templates/dpaste/snippet_new.html:5 templates/dpaste/snippet_new.html:6
msgid "New snippet"
msgstr "חתיכה חדשה"
#: templates/dpaste/base.html:18
msgid "About"
msgstr "אודות"
#: templates/dpaste/base.html:19
msgid "History"
msgstr "היסטוריה"
#: templates/dpaste/snippet_details.html:7
msgid "Snippet"
msgstr "חתיכה"
#: templates/dpaste/snippet_details.html:47
msgid "Compare"
msgstr "השווה"
#: templates/dpaste/snippet_details.html:61
#, python-format
msgid "Expires in: %(date)s"
msgstr "פג ביום: %(date)s"
#: templates/dpaste/snippet_details.html:63
msgid "Snippet never expires"
msgstr "חתיכה לעלום לא פוקעת"
#: templates/dpaste/snippet_details.html:69
msgid "Really delete this snippet?"
msgstr "באמת למחוק את חתיכה זו?"
#: templates/dpaste/snippet_details.html:69
msgid "Delete Now"
msgstr "מחק עכשיו"
#: templates/dpaste/snippet_details.html:72
msgid "Compare Snippets"
msgstr "השווה חתיכות"
#: templates/dpaste/snippet_details.html:75
msgid "View Raw"
msgstr "הצג גולמי"
#: templates/dpaste/snippet_details.html:79
msgid "Gist"
msgstr "Gist"
#: templates/dpaste/snippet_details.html:88
msgid "This is a one-time snippet."
msgstr "זןהי חתיכה חד-פעמית."
#: templates/dpaste/snippet_details.html:90
#, python-format
msgid "It is automatically removed after %(remaining)s further views."
msgstr "זה יוסר אוטומטית לאחר %(remaining)s צפיות נוספות."
#: templates/dpaste/snippet_details.html:92
msgid "It is automatically removed after the next view."
msgstr "זה יוסר אוטומטית לאחר הצפיה הבאה."
#: templates/dpaste/snippet_details.html:94
msgid "It cannot be viewed again."
msgstr "אין אפשרות לצפות בזה שוב."
#: templates/dpaste/snippet_details.html:114
msgid "Reply to this snippet"
msgstr "השב לחתיכה זו"
#: templates/dpaste/snippet_diff.html:4
#, python-format
msgid ""
" Diff between <a href=\"%(filea_url)s\">#%(filea_id)s</a> and <a href="
"\"%(fileb_url)s\">#%(fileb_id)s</a>\n"
msgstr ""
" הבדל בין <a href=\"%(filea_url)s\">#%(filea_id)s</a> לנגד <a href="
"\"%(fileb_url)s\">#%(fileb_id)s</a>\n"
#: templates/dpaste/snippet_form.html:31
msgid "Expire in"
msgstr "פג בתוך"
#: templates/dpaste/snippet_form.html:37
msgid "Paste it"
msgstr "הדבק זאת"
#: templates/dpaste/snippet_form.html:38
msgid "or"
msgstr "או"
#: templates/dpaste/snippet_list.html:15
msgid "DATETIME_FORMAT"
msgstr ""
#: templates/dpaste/snippet_list.html:16
#, python-format
msgid "%(since)s ago"
msgstr "לפני %(since)s"
#: templates/dpaste/snippet_list.html:22
msgid ""
"No snippets saved. Either all your snippets are expired or your cookie has "
"changed."
msgstr "לא נשמרו חתיכות. או שכל החתיכות שלך פקעו או שהעוגיות שלך שונו."
#: views.py:180
msgid "No changes were made between this two files."
msgstr "לא נערכו שינויים בין שני קבצים אלה."

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: dpaste\n" "Project-Id-Version: dpaste\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-12 04:00+0000\n" "POT-Creation-Date: 2016-12-02 14:51+0100\n"
"PO-Revision-Date: 2014-10-25 14:25+0000\n" "PO-Revision-Date: 2014-10-25 14:25+0000\n"
"Last-Translator: Sergio Oliveira <seocam@seocam.com>\n" "Last-Translator: Sergio Oliveira <seocam@seocam.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/"
@ -19,163 +19,160 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: dpaste/forms.py:11 dpaste/models.py:37 #: forms.py:11 models.py:37 templates/dpaste/snippet_details.html:65
#: dpaste/templates/dpaste/snippet_details.html:59
msgid "One-Time snippet" msgid "One-Time snippet"
msgstr "Uma única visualização" msgstr "Uma única visualização"
#: dpaste/forms.py:12 #: forms.py:12
msgid "In one hour" msgid "In one hour"
msgstr "Em uma hora" msgstr "Em uma hora"
#: dpaste/forms.py:13 #: forms.py:13
msgid "In one week" msgid "In one week"
msgstr "Em uma semana" msgstr "Em uma semana"
#: dpaste/forms.py:14 #: forms.py:14
msgid "In one month" msgid "In one month"
msgstr "Em um mês" msgstr "Em um mês"
#: dpaste/forms.py:15 #: forms.py:15
msgid "Never" msgid "Never"
msgstr "Nunca expira" msgstr "Nunca expira"
#: dpaste/forms.py:36 dpaste/models.py:42 #: forms.py:36 models.py:42
msgid "Content" msgid "Content"
msgstr "Conteúdo" msgstr "Conteúdo"
#: dpaste/forms.py:37 #: forms.py:37
msgid "Awesome code goes here..." msgid "Awesome code goes here..."
msgstr "Cole seu texto ou código aqui..." msgstr "Cole seu texto ou código aqui..."
#: dpaste/forms.py:42 dpaste/models.py:43 #: forms.py:42 models.py:43
msgid "Lexer" msgid "Lexer"
msgstr "Lexer" msgstr "Lexer"
#: dpaste/forms.py:49 dpaste/models.py:47 #: forms.py:49 models.py:47
msgid "Expires" msgid "Expires"
msgstr "Validade" msgstr "Validade"
#: dpaste/forms.py:57 #: forms.py:57
msgid "Title" msgid "Title"
msgstr "Título" msgstr "Título"
#: dpaste/forms.py:85 #: forms.py:85
msgid "This field is required." msgid "This field is required."
msgstr "Campo obrigatório." msgstr "Campo obrigatório."
#: dpaste/highlight.py:33 #: highlight.py:33
msgid "Highlighted" msgid "Highlighted"
msgstr "Highlighted" msgstr "Highlighted"
#: dpaste/models.py:35 #: models.py:35
msgid "Expire by timestamp" msgid "Expire by timestamp"
msgstr "Expira por tempo" msgstr "Expira por tempo"
#: dpaste/models.py:36 #: models.py:36
msgid "Keep Forever" msgid "Keep Forever"
msgstr "Não expira" msgstr "Não expira"
#: dpaste/models.py:40 #: models.py:40
msgid "Secret ID" msgid "Secret ID"
msgstr "ID secreto" msgstr "ID secreto"
#: dpaste/models.py:44 #: models.py:44
msgid "Published" msgid "Published"
msgstr "Publicado" msgstr "Publicado"
#: dpaste/models.py:45 #: models.py:45
msgid "Expire Type" msgid "Expire Type"
msgstr "Tipo de validade" msgstr "Tipo de validade"
#: dpaste/models.py:48 #: models.py:48
msgid "View count" msgid "View count"
msgstr "Visualizações" msgstr "Visualizações"
#: dpaste/templates/dpaste/about.html:59 #: templates/dpaste/about.html:59
msgid "Statistics" msgid "Statistics"
msgstr "Estatísticas" msgstr "Estatísticas"
#: dpaste/templates/dpaste/about.html:61 #: templates/dpaste/about.html:61
#, python-format #, python-format
msgid "" msgid ""
"There are %(total)s snippets in the database. The most popular languages are:" "There are %(total)s snippets in the database. The most popular languages are:"
msgstr "Existem %(total)s pastes no banco de dados. A linguagem mais popular é" msgstr "Existem %(total)s pastes no banco de dados. A linguagem mais popular é"
#: dpaste/templates/dpaste/base.html:8 dpaste/templates/dpaste/base.html:21 #: templates/dpaste/base.html:7 templates/dpaste/base.html:20
#: dpaste/templates/dpaste/snippet_new.html:6 #: templates/dpaste/snippet_new.html:5 templates/dpaste/snippet_new.html:6
#: dpaste/templates/dpaste/snippet_new.html:7
msgid "New snippet" msgid "New snippet"
msgstr "Novo paste" msgstr "Novo paste"
#: dpaste/templates/dpaste/base.html:19 #: templates/dpaste/base.html:18
msgid "About" msgid "About"
msgstr "Sobre" msgstr "Sobre"
#: dpaste/templates/dpaste/base.html:20 #: templates/dpaste/base.html:19
msgid "History" msgid "History"
msgstr "Histórico" msgstr "Histórico"
#: dpaste/templates/dpaste/snippet_details.html:8 #: templates/dpaste/snippet_details.html:7
#: dpaste/templates/dpaste/snippet_details.html:9
msgid "Snippet" msgid "Snippet"
msgstr "Paste" msgstr "Paste"
#: dpaste/templates/dpaste/snippet_details.html:41 #: templates/dpaste/snippet_details.html:47
msgid "Compare" msgid "Compare"
msgstr "Comparar" msgstr "Comparar"
#: dpaste/templates/dpaste/snippet_details.html:55 #: templates/dpaste/snippet_details.html:61
#, python-format #, python-format
msgid "Expires in: %(date)s" msgid "Expires in: %(date)s"
msgstr "Expira em: %(date)s" msgstr "Expira em: %(date)s"
#: dpaste/templates/dpaste/snippet_details.html:57 #: templates/dpaste/snippet_details.html:63
msgid "Snippet never expires" msgid "Snippet never expires"
msgstr "Paste nunca expira" msgstr "Paste nunca expira"
#: dpaste/templates/dpaste/snippet_details.html:63 #: templates/dpaste/snippet_details.html:69
msgid "Really delete this snippet?" msgid "Really delete this snippet?"
msgstr "Deseja realmente remover esse paste?" msgstr "Deseja realmente remover esse paste?"
#: dpaste/templates/dpaste/snippet_details.html:63 #: templates/dpaste/snippet_details.html:69
msgid "Delete Now" msgid "Delete Now"
msgstr "Remover agora" msgstr "Remover agora"
#: dpaste/templates/dpaste/snippet_details.html:66 #: templates/dpaste/snippet_details.html:72
msgid "Compare Snippets" msgid "Compare Snippets"
msgstr "Comparar pastes" msgstr "Comparar pastes"
#: dpaste/templates/dpaste/snippet_details.html:69 #: templates/dpaste/snippet_details.html:75
msgid "View Raw" msgid "View Raw"
msgstr "Visualizar sem formatação" msgstr "Visualizar sem formatação"
#: dpaste/templates/dpaste/snippet_details.html:73 #: templates/dpaste/snippet_details.html:79
msgid "Gist" msgid "Gist"
msgstr "Gist" msgstr "Gist"
#: dpaste/templates/dpaste/snippet_details.html:82 #: templates/dpaste/snippet_details.html:88
msgid "This is a one-time snippet." msgid "This is a one-time snippet."
msgstr "Este paste só pode ser visualizado uma vez." msgstr "Este paste só pode ser visualizado uma vez."
#: dpaste/templates/dpaste/snippet_details.html:84 #: templates/dpaste/snippet_details.html:90
#, python-format #, python-format
msgid "It is automatically removed after %(remaining)s further views." msgid "It is automatically removed after %(remaining)s further views."
msgstr "Automaticamente deletado depois de %(remaining)s visualizações" msgstr "Automaticamente deletado depois de %(remaining)s visualizações"
#: dpaste/templates/dpaste/snippet_details.html:86 #: templates/dpaste/snippet_details.html:92
msgid "It is automatically removed after the next view." msgid "It is automatically removed after the next view."
msgstr "Automaticamente deletado após a próxima visualização." msgstr "Automaticamente deletado após a próxima visualização."
#: dpaste/templates/dpaste/snippet_details.html:88 #: templates/dpaste/snippet_details.html:94
msgid "It cannot be viewed again." msgid "It cannot be viewed again."
msgstr "Não pode ser visto novamente." msgstr "Não pode ser visto novamente."
#: dpaste/templates/dpaste/snippet_details.html:108 #: templates/dpaste/snippet_details.html:114
msgid "Reply to this snippet" msgid "Reply to this snippet"
msgstr "Responder paste" msgstr "Responder paste"
#: dpaste/templates/dpaste/snippet_diff.html:5 #: templates/dpaste/snippet_diff.html:4
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"
@ -188,28 +185,28 @@ msgstr ""
"\"%(fileb_url)s\">#%(fileb_id)s</a>\n" "\"%(fileb_url)s\">#%(fileb_id)s</a>\n"
" " " "
#: dpaste/templates/dpaste/snippet_form.html:32 #: templates/dpaste/snippet_form.html:31
msgid "Expire in" msgid "Expire in"
msgstr "Expira em" msgstr "Expira em"
#: dpaste/templates/dpaste/snippet_form.html:38 #: templates/dpaste/snippet_form.html:37
msgid "Paste it" msgid "Paste it"
msgstr "Criar paste" msgstr "Criar paste"
#: dpaste/templates/dpaste/snippet_form.html:39 #: templates/dpaste/snippet_form.html:38
msgid "or" msgid "or"
msgstr "" msgstr ""
#: dpaste/templates/dpaste/snippet_list.html:16 #: templates/dpaste/snippet_list.html:15
msgid "DATETIME_FORMAT" msgid "DATETIME_FORMAT"
msgstr "DATETIME_FORMAT" msgstr "DATETIME_FORMAT"
#: dpaste/templates/dpaste/snippet_list.html:17 #: templates/dpaste/snippet_list.html:16
#, python-format #, python-format
msgid "%(since)s ago" msgid "%(since)s ago"
msgstr "%(since)s atrás" msgstr "%(since)s atrás"
#: dpaste/templates/dpaste/snippet_list.html:23 #: templates/dpaste/snippet_list.html:22
msgid "" msgid ""
"No snippets saved. Either all your snippets are expired or your cookie has " "No snippets saved. Either all your snippets are expired or your cookie has "
"changed." "changed."
@ -217,6 +214,6 @@ msgstr ""
"Nenhum paste salvo. Ou todos os seus pastes expiraram ou seu cookie foi " "Nenhum paste salvo. Ou todos os seus pastes expiraram ou seu cookie foi "
"alterado." "alterado."
#: dpaste/views.py:199 #: views.py:180
msgid "No changes were made between this two files." msgid "No changes were made between this two files."
msgstr "Nenhuma alterção feita entre esses dois arquivos." msgstr "Nenhuma alterção feita entre esses dois arquivos."

View file

@ -1,29 +1,32 @@
import sys import sys
from optparse import make_option from optparse import make_option
from django.core.management.base import LabelCommand from django.core.management.base import BaseCommand
from django.utils import timezone from django.utils import timezone
from dpaste.models import Snippet from dpaste.models import Snippet
class Command(LabelCommand): class Command(BaseCommand):
option_list = LabelCommand.option_list + (
make_option('--dry-run', '-d', action='store_true', dest='dry_run',
help='Don\'t do anything.'),
)
help = "Purges snippets that are expired" help = "Purges snippets that are expired"
def add_arguments(self, parser):
parser.add_argument('--dry-run', action='store_true', dest='dry_run',
help='Don\'t do anything.'),
def handle(self, *args, **options): def handle(self, *args, **options):
deleteable_snippets = Snippet.objects.filter( deleteable_snippets = Snippet.objects.filter(
expires__isnull=False, expires__isnull=False,
expire_type=Snippet.EXPIRE_TIME, expire_type=Snippet.EXPIRE_TIME,
expires__lte=timezone.now() expires__lte=timezone.now()
) )
sys.stdout.write(u"%s snippets gets deleted:\n" % deleteable_snippets.count()) if len(deleteable_snippets) == 0:
self.stdout.write(u"No snippets to delete.")
return None
self.stdout.write(u"Will delete %s snippet(s):\n" % deleteable_snippets.count())
for d in deleteable_snippets: for d in deleteable_snippets:
sys.stdout.write(u"- %s (%s)\n" % (d.secret_id, d.expires)) self.stdout.write(u"- %s (%s)\n" % (d.secret_id, d.expires))
if options.get('dry_run'): if options.get('dry_run'):
sys.stdout.write(u'Dry run - Not actually deleting snippets!\n') self.stdout.write(u'Dry run - Not actually deleting snippets!\n')
else: else:
deleteable_snippets.delete() deleteable_snippets.delete()

View file

@ -1,62 +0,0 @@
import socket
from django.http import HttpResponseBadRequest
tor_bl = (
'{remote_addr}.{server_port}.{server_ip}'
'.ip-port.exitlist.torproject.org')
open_proxy_bl = ('{remote_addr}.dnsbl.proxybl.org')
rev_ip = lambda ip: '.'.join(reversed(ip.split('.'))) # pragma: no cover
response = """<html><body><h1>Access denied</h1>
<p>It appears you're requesting this page from an open proxy or
the TOR network. These networks are blocked due to numerous
statutory violation related posts in the past.</p>
<p>If you think this is wrong, <a href="https://github.com/bartTC/dpaste">file
a bug on Github please</a>.</p></body></html>"""
def in_blacklist(request, bl, ip=None): # pragma: no cover
ip = ip or request.META['REMOTE_ADDR']
try:
server_ip = socket.gethostbyname(request.META['SERVER_NAME'])
except socket.gaierror:
return
bl_name = bl.format(
remote_addr=rev_ip(ip),
server_port=request.META['SERVER_PORT'],
server_ip=rev_ip(server_ip)
)
try:
lookup = socket.gethostbyname(bl_name)
except socket.gaierror as s:
if s.errno == -5:
return False
return
except Exception:
return
return lookup == '127.0.0.2'
class SuspiciousIPMiddleware(object): # pragma: no cover
def process_request(self, request):
def check_tor():
if not hasattr(request, '_is_tor_exit_node'):
request._is_tor_exit_node = in_blacklist(request, tor_bl)
return request._is_tor_exit_node
request.is_tor_exit_node = check_tor
def check_open_proxy():
if not hasattr(request, '_is_open_proxy'):
request._is_open_proxy = in_blacklist(
request, open_proxy_bl)
return request._is_open_proxy
request.is_open_proxy = check_open_proxy
def check_suspicious():
return request.is_tor_exit_node() or request.is_open_proxy()
request.is_suspicious = check_suspicious
if request.method == 'POST' and request.is_suspicious():
return HttpResponseBadRequest(response)

View file

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-19 10:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dpaste', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='snippet',
name='level',
),
migrations.RemoveField(
model_name='snippet',
name='lft',
),
migrations.RemoveField(
model_name='snippet',
name='rght',
),
migrations.RemoveField(
model_name='snippet',
name='tree_id',
),
]

View file

@ -1,6 +1,5 @@
from random import SystemRandom from random import SystemRandom
import mptt
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db import models from django.db import models
@ -59,10 +58,6 @@ class Snippet(models.Model):
return remaining > 0 and remaining or 0 return remaining > 0 and remaining or 0
return None return None
@property
def is_single(self):
return self.is_root_node() and not self.get_children()
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
if not self.secret_id: if not self.secret_id:
self.secret_id = generate_secret_id() self.secret_id = generate_secret_id()
@ -73,5 +68,3 @@ class Snippet(models.Model):
def __unicode__(self): def __unicode__(self):
return self.secret_id return self.secret_id
mptt.register(Snippet, order_insertion_by=['content'])

View file

@ -105,6 +105,7 @@ TEMPLATES = [
'django.template.context_processors.debug', 'django.template.context_processors.debug',
'django.template.context_processors.request', 'django.template.context_processors.request',
'django.template.context_processors.i18n', 'django.template.context_processors.i18n',
'dpaste.context_processors.dpaste_globals',
], ],
}, },
}, },
@ -113,7 +114,6 @@ TEMPLATES = [
INSTALLED_APPS = ( INSTALLED_APPS = (
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django.contrib.sessions', 'django.contrib.sessions',
'mptt',
'gunicorn', 'gunicorn',
'dpaste', 'dpaste',
) )

View file

@ -1,7 +1,6 @@
from dpaste.settings.base import * from dpaste.settings.base import *
DEBUG = True DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = ( ADMINS = (
#('Your Name', 'name@example.com'), #('Your Name', 'name@example.com'),
@ -10,9 +9,9 @@ MANAGERS = ADMINS
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.mysql', 'ENGINE': 'django.db.backends.postgresql',
'NAME': 'dpaste', 'NAME': 'dpaste',
'USER': 'root', 'USER': '',
'PASSWORD': '', 'PASSWORD': '',
} }
} }

File diff suppressed because one or more lines are too long

View file

@ -63,6 +63,20 @@ tt strong {
color: #5393b4; color: #5393b4;
} }
input.headline-url {
font-size: 20px;
height: 40px;
width: 210px;
color: #5393b4;
border: none;
box-shadow: none;
}
button.btn.headline-url-copy {
margin-top: -4px;
padding: 5px 10px 3px 10px;
}
h1, h2, h3, h4 { h1, h2, h3, h4 {
font-weight: 300; font-weight: 300;
} }

View file

@ -53,6 +53,7 @@
<li><a href="https://github.com/bartTC/dpasteGUI/wiki">dpasteGUI</a>, a OS X interface</li> <li><a href="https://github.com/bartTC/dpasteGUI/wiki">dpasteGUI</a>, a OS X interface</li>
<li><a href="https://github.com/bartTC/SubDpaste">a dpaste Sublime 2 plugin</a></li> <li><a href="https://github.com/bartTC/SubDpaste">a dpaste Sublime 2 plugin</a></li>
<li><a href="http://marmalade-repo.org/packages/dpaste_de">Marmalade</a>, a Emacs plugin</li> <li><a href="http://marmalade-repo.org/packages/dpaste_de">Marmalade</a>, a Emacs plugin</li>
<li><a href="https://atom.io/packages/atom-dpaste">atom-dpaste</a>, a Atom editor plugin</li>
</ul> </ul>
<h3>{% trans "Statistics" %}</h3> <h3>{% trans "Statistics" %}</h3>

View file

@ -19,7 +19,9 @@
<li class="{% block dpaste_nav_history %}{% endblock %}"><a href="{% url "snippet_history" %}">{% trans "History" %}</a></li> <li class="{% block dpaste_nav_history %}{% endblock %}"><a href="{% url "snippet_history" %}">{% trans "History" %}</a></li>
<li class="{% block dpaste_nav_new %}{% endblock %}"><a href="{% url "snippet_new" %}">{% trans "New snippet" %} &rarr;</a></li> <li class="{% block dpaste_nav_new %}{% endblock %}"><a href="{% url "snippet_new" %}">{% trans "New snippet" %} &rarr;</a></li>
</ul> </ul>
<h3 class="headline"><a href="/">{% block headline %}{% endblock %}</a></h3> {% block headline_wrapper %}
<h3 class="headline"><a href="{% url "snippet_new" %}">{% block headline %}{% endblock %}</a></h3>
{% endblock %}
</header> </header>
{% block page %} {% block page %}
PAGE MISSING PAGE MISSING
@ -28,8 +30,10 @@
{% block script_footer %} {% block script_footer %}
<script src="{{ jquery_url }}"></script> <script src="{{ jquery_url }}"></script>
<script src="{% static "dpaste/clipboardjs.min.js" %}"></script>
<script> <script>
jQuery(function($) { jQuery(function($) {
new Clipboard('.clip-button');
$('.autofocus textarea:first').focus(); $('.autofocus textarea:first').focus();
$('.superenter textarea').on('keydown', function(e){ $('.superenter textarea').on('keydown', function(e){
var metaKey; var metaKey;

View file

@ -1,11 +1,17 @@
{% extends "dpaste/base.html" %} {% extends "dpaste/base.html" %}
{% load mptt_tags %}
{% load i18n %} {% load i18n %}
{% load dpaste_tags %} {% load dpaste_tags %}
{% block title %}{% trans "Snippet" %} #{{ snippet.pk }}{% endblock %} {% block title %}{% trans "Snippet" %} #{{ snippet.pk }}{% endblock %}
{% block headline %}{% trans "Snippet" %} #{{ snippet.pk }}{% endblock %} {% block headline_wrapper %}
<input id="headline-url" class="headline-url" type="text" value="{{ request.build_absolute_uri }}"/>
<button class="btn clip-button headline-url-copy" data-clipboard-target="#headline-url">
<svg width="18" height="24" viewBox="0 0 1024 896" xmlns="http://www.w3.org/2000/svg">
<path d="M128 768h256v64H128v-64z m320-384H128v64h320v-64z m128 192V448L384 640l192 192V704h320V576H576z m-288-64H128v64h160v-64zM128 704h160v-64H128v64z m576 64h64v128c-1 18-7 33-19 45s-27 18-45 19H64c-35 0-64-29-64-64V192c0-35 29-64 64-64h192C256 57 313 0 384 0s128 57 128 128h192c35 0 64 29 64 64v320h-64V320H64v576h640V768zM128 256h512c0-35-29-64-64-64h-64c-35 0-64-29-64-64s-29-64-64-64-64 29-64 64-29 64-64 64h-64c-35 0-64 29-64 64z" />
</svg>
</button>
{% endblock %}
{% block page %} {% block page %}
@ -14,34 +20,9 @@
======================================================================= --> ======================================================================= -->
<div id="snippet-diff" class="snippet-diff container-fluid"> <div id="snippet-diff" class="snippet-diff container-fluid">
<div class="row-fluid" style="width: auto; padding: 30px 0"> <div class="row-fluid" style="width: auto; padding: 30px 0">
<div class="span9"> <div class="span12">
<div id="diff" style="display:none;"></div> <div id="diff" style="display:none;"></div>
</div> </div>
<div class="span3">
<form method="get" id="diffform" action="{% url "snippet_diff" %}">
{% csrf_token %}
<div class="tree">
{% for tree_item,structure in tree|tree_info %}
{% if structure.new_level %}<ul><li>{% else %}</li><li>{% endif %}
<div>
<span class="diff">
<input type="radio" name="a" value="{{ tree_item.id }}" {% ifequal tree_item.id snippet.parent_id %}checked="checked"{% endifequal %}>
<input type="radio" name="b" value="{{ tree_item.id }}" {% ifequal snippet tree_item %}checked="checked"{% endifequal %}>
</span>
{% ifequal snippet tree_item %}
<strong>#{{ tree_item.id }}</strong>
{% else %}
<a href="{{ tree_item.get_absolute_url }}">#{{ tree_item.id }}</a>
{% endifequal %}
</div>
{% for level in structure.closed_levels %}</li></ul>{% endfor %}
{% endfor %}
<div class="submit">
<input type="submit" value="{% trans "Compare" %}">
</div>
</div>
</form>
</div>
</div> </div>
</div> </div>
@ -61,8 +42,8 @@
{% if snippet.pk|in_list:request.session.snippet_list %} {% if snippet.pk|in_list:request.session.snippet_list %}
<a class="btn" href="{% url "snippet_delete" snippet.secret_id %}" onclick="return confirm('{% trans "Really delete this snippet?" %}');"><i class="icon-trash"></i> {% trans "Delete Now" %}</a> <a class="btn" href="{% url "snippet_delete" snippet.secret_id %}" onclick="return confirm('{% trans "Really delete this snippet?" %}');"><i class="icon-trash"></i> {% trans "Delete Now" %}</a>
{% endif %} {% endif %}
{% if not snippet.is_single %} {% if snippet.parent %}
<a class="btn snippet-diff-trigger" href="#snippet-diff"><i class="icon-search"></i> {% trans "Compare Snippets" %}</a> <a class="btn snippet-diff-trigger" href="#snippet-diff"><i class="icon-search"></i> {% trans "Compare this Answer" %}</a>
{% endif %} {% endif %}
{% if snippet.expire_type != 3 %} {% if snippet.expire_type != 3 %}
<a class="btn" href="{% url "snippet_details_raw" snippet.secret_id %}"><i class="icon-align-left"></i> {% trans "View Raw" %}</a> <a class="btn" href="{% url "snippet_details_raw" snippet.secret_id %}"><i class="icon-align-left"></i> {% trans "View Raw" %}</a>
@ -114,21 +95,15 @@ jQuery(function($) {
$(this).removeClass('snippet-reply-hidden'); $(this).removeClass('snippet-reply-hidden');
}); });
var curLine = document.location.hash;
{% if snippet.parent %}
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
Diff Ajax Call Diff Ajax Call
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
var diffReq; function fetchDiff() {
var a = {{ snippet.parent.pk }},
$('.snippet-diff-trigger').click(function(e) { b = {{ snippet.pk }};
e.preventDefault();
$('#snippet-diff').slideDown('fast');
$('#snippet-diff form').submit();
});
$('#diffform').submit(function() {
var a = $('input[name="a"]:checked').val(),
b = $('input[name="b"]:checked').val();
window.location.hash = 'D' + a + ',' + b; window.location.hash = 'D' + a + ',' + b;
@ -145,23 +120,20 @@ jQuery(function($) {
}).complete(function() { }).complete(function() {
diffReq = null; diffReq = null;
}); });
}
return false; var diffReq;
$('.snippet-diff-trigger').click(function(e) {
e.preventDefault();
fetchDiff();
$('#snippet-diff').slideDown('fast');
}); });
var curLine = document.location.hash,
hashlist;
if (curLine.substring(0, 2) === '#D') { if (curLine.substring(0, 2) === '#D') {
hashlist = curLine.substring(2).split(','); fetchDiff();
if (hashlist.length === 2) {
console.log(hashlist);
$('#diffform input[name="a"][value="' + hashlist[0] + '"]').prop('checked', true);
$('#diffform input[name="b"][value="' + hashlist[1] + '"]').prop('checked', true);
$('#snippet-diff').slideDown('fast'); $('#snippet-diff').slideDown('fast');
$('#snippet-diff form').submit();
}
} }
{% endif %}
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
Line Highlighting Line Highlighting
@ -190,7 +162,7 @@ jQuery(function($) {
}); });
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
Line Highlighting Wordwrap
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
$('#toggleWordwrap').click(function(e){ $('#toggleWordwrap').click(function(e){
e.preventDefault(); e.preventDefault();

View file

@ -2,7 +2,8 @@
<h4> <h4>
{% blocktrans with fileA.get_absolute_url as filea_url and fileB.get_absolute_url as fileb_url and fileA.id as filea_id and fileB.id as fileb_id %} {% blocktrans with fileA.get_absolute_url as filea_url and fileB.get_absolute_url as fileb_url and fileA.id as filea_id and fileB.id as fileb_id %}
Diff between <a href="{{ filea_url }}">#{{ filea_id }}</a> and <a href="{{ fileb_url }}">#{{ fileb_id }}</a> Difference between this answer <a href="{{ fileb_url }}">#{{ fileb_id }}</a>
and the parent snippet <a href="{{ filea_url }}">#{{ filea_id }}</a>
{% endblocktrans %} {% endblocktrans %}
</h4> </h4>

View file

@ -131,6 +131,12 @@ class SnippetTestCase(TestCase):
self.assertEqual(response.status_code, 404) self.assertEqual(response.status_code, 404)
self.assertEqual(Snippet.objects.count(), 0) self.assertEqual(Snippet.objects.count(), 0)
def test_snippet_notfound(self):
url = reverse('snippet_details', kwargs={'snippet_id': 'abcd'})
response = self.client.get(url, follow=True)
self.assertEqual(response.status_code, 404)
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Reply # Reply
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------

View file

@ -1,4 +1,4 @@
from django.conf.urls import patterns, url from django.conf.urls import url
from ..views import APIView from ..views import APIView

View file

@ -3,6 +3,7 @@ import difflib
import json import json
from django.conf import settings from django.conf import settings
from django import get_version
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db.models import Count from django.db.models import Count
@ -357,8 +358,10 @@ class APIView(View):
# handle them here. # handle them here.
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
def page_not_found(request, template_name='dpaste/404.html'): def page_not_found(request, exception=None, template_name='dpaste/404.html'):
return django_page_not_found(request, template_name) # pragma: no cover if not exception: # Django <1.8
return django_page_not_found(request, template_name=template_name)
return django_page_not_found(request, exception, template_name=template_name)
def server_error(request, template_name='dpaste/500.html'): def server_error(request, template_name='dpaste/500.html'):
return django_server_error(request, template_name) # pragma: no cover return django_server_error(request, template_name=template_name) # pragma: no cover

View file

@ -5,8 +5,7 @@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Project dependencies # Project dependencies
django==1.9.* django>=1.10
django-mptt
django-markup django-markup
pygments pygments
requests requests
@ -19,7 +18,5 @@ sphinx
sphinx_rtd_theme sphinx_rtd_theme
# Deployment specific # Deployment specific
django-redis==3.8.0 gunicorn
gunicorn==19.1.1 psycopg2
south==1.0.2

View file

@ -25,6 +25,8 @@ SETTINGS = {
'context_processors': [ 'context_processors': [
'django.template.context_processors.debug', 'django.template.context_processors.debug',
'django.template.context_processors.request', 'django.template.context_processors.request',
'django.template.context_processors.i18n',
'dpaste.context_processors.dpaste_globals',
], ],
}, },
}, },
@ -32,7 +34,6 @@ SETTINGS = {
'INSTALLED_APPS': [ 'INSTALLED_APPS': [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'mptt',
'dpaste', 'dpaste',
], ],
'MIDDLEWARE_CLASSES': ( 'MIDDLEWARE_CLASSES': (
@ -40,7 +41,9 @@ SETTINGS = {
), ),
'STATIC_ROOT': '/tmp/dpaste_test_static/', 'STATIC_ROOT': '/tmp/dpaste_test_static/',
'STATIC_URL': '/static/', 'STATIC_URL': '/static/',
'ROOT_URLCONF': 'dpaste.urls' 'ROOT_URLCONF': 'dpaste.urls',
'LANGUAGE_CODE': 'en',
'LANGUAGES': (('en', 'English'),),
} }
def runtests(*test_args): def runtests(*test_args):

View file

@ -83,8 +83,8 @@ server {
rewrite ^/(.*)$ https://dpaste.de/$1 permanent; rewrite ^/(.*)$ https://dpaste.de/$1 permanent;
} }
access_log /srv/dpaste.de/var/nginx.access.log combined_port; access_log /var/log/nginx/dpaste.access.log combined_port;
error_log /srv/dpaste.de/var/nginx.error.log; error_log /var/log/nginx/dpaste.error.log;
keepalive_timeout 5; keepalive_timeout 5;
client_max_body_size 10M; client_max_body_size 10M;

View file

@ -26,7 +26,7 @@
# (bzip2 compressed file), it will be decompressed on the fly as it # (bzip2 compressed file), it will be decompressed on the fly as it
# is being read. # is being read.
LogFile /srv/dpaste.de/var/nginx.access.log LogFile /var/log/nginx/dpaste.access.log.1
# LogType defines the log type being processed. Normally, the Webalizer # LogType defines the log type being processed. Normally, the Webalizer
# expects a CLF or Combined web server log as input. Using this option, # expects a CLF or Combined web server log as input. Using this option,
@ -64,7 +64,7 @@ OutputDir /srv/dpaste.de/var/webalizer
# with the IncrementalName option below). Please read at least the section # with the IncrementalName option below). Please read at least the section
# on Incremental processing in the README file before you enable this option. # on Incremental processing in the README file before you enable this option.
#Incremental no Incremental yes
# IncrementalName allows you to specify the filename for saving the # IncrementalName allows you to specify the filename for saving the
# incremental data in. It is similar to the HistoryName option where the # incremental data in. It is similar to the HistoryName option where the
@ -73,7 +73,7 @@ OutputDir /srv/dpaste.de/var/webalizer
# kept in the normal output directory. If you don't specify "Incremental" # kept in the normal output directory. If you don't specify "Incremental"
# as 'yes' then this option has no meaning. # as 'yes' then this option has no meaning.
#IncrementalName webalizer.current IncrementalName webalizer.current
# ReportTitle is the text to display as the title. The hostname # ReportTitle is the text to display as the title. The hostname
# (unless blank) is appended to the end of this string (separated with # (unless blank) is appended to the end of this string (separated with

View file

@ -24,7 +24,7 @@ long_description = u'\n\n'.join((
setup( setup(
name='dpaste', name='dpaste',
version='2.10', version='2.13',
description='dpaste is a Django based pastebin. It\'s intended to run ' description='dpaste is a Django based pastebin. It\'s intended to run '
'separately but its also possible to be installed into an ' 'separately but its also possible to be installed into an '
'existing Django project like a regular app.', 'existing Django project like a regular app.',
@ -50,9 +50,7 @@ setup(
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=[
'django>=1.8', 'django>=1.8',
'django-mptt>=0.8.3',
'pygments>=1.6', 'pygments>=1.6',
'requests>=2.0.0',
'django-markup>=1.0', 'django-markup>=1.0',
], ],
tests_require=[ tests_require=[

View file

@ -1,7 +1,8 @@
[tox] [tox]
toxworkdir=/tmp/tox/dpaste toxworkdir=/tmp/tox/dpaste
skip_missing_interpreters=True
envlist= envlist=
py{27,35}-django-{18,19} py{27,34,35,36}-django-{18,19,110}
[testenv] [testenv]
install_command = install_command =
@ -12,5 +13,6 @@ commands=
deps= deps=
# Django versions # Django versions
django-18: django==1.8.* django-18: django>=1.8,<1.9
django-19: django==1.9.* django-19: django>=1.9,<1.10
django-110: django>=1.10,<1.11