From baef81d25b9a7a67301c9d4cccd383c98c86bbb4 Mon Sep 17 00:00:00 2001 From: Devin Ceartas Date: Sun, 13 Jul 2014 19:51:46 +0000 Subject: [PATCH 01/10] Update installation.rst --- docs/intro/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/intro/installation.rst b/docs/intro/installation.rst index 0d228893f8..c1cbb6b056 100644 --- a/docs/intro/installation.rst +++ b/docs/intro/installation.rst @@ -38,7 +38,7 @@ correctly you should see the login screen and panel showing a randomly generated Production use -------------- -To create a custom settings file for **Mayan EDMS**, create your a Python (.py) file +To create a custom settings file for **Mayan EDMS**, create a Python (.py) file in the directory: venv/mayan/settings/ with the following basic content:: # my_settings.py From 11e24d840172678a8a61678dd96b86340d54a01e Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sun, 13 Jul 2014 16:22:26 -0400 Subject: [PATCH 02/10] Update example settings path --- docs/intro/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/intro/installation.rst b/docs/intro/installation.rst index c1cbb6b056..9a99bd2f04 100644 --- a/docs/intro/installation.rst +++ b/docs/intro/installation.rst @@ -39,7 +39,7 @@ Production use -------------- To create a custom settings file for **Mayan EDMS**, create a Python (.py) file -in the directory: venv/mayan/settings/ with the following basic content:: +in the directory: venv/lib/python2.7/site-packages/mayan/settings/ with the following basic content:: # my_settings.py From e90a60efe36252cc0dafe2c1076c93aa7be52710 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 14 Jul 2014 14:21:21 +0200 Subject: [PATCH 03/10] Adding missing argument to german language correction file. --- mayan/apps/ocr/lang/deu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mayan/apps/ocr/lang/deu.py b/mayan/apps/ocr/lang/deu.py index df20573b09..6291843844 100644 --- a/mayan/apps/ocr/lang/deu.py +++ b/mayan/apps/ocr/lang/deu.py @@ -7,7 +7,7 @@ from . import BackendBase class LanguageBackend(BackendBase): - def check_word(word): + def check_word(self, word): ALL_ALPHANUM = re.compile('([0-9a-zäöüß])', re.I) NON_ALPHANUM = re.compile('([^0-9a-zäöüß])', re.I) ALL_ALPHANUM = re.compile('([0-9a-z])', re.I) From 79f03d9907f58cbf143f085502a73554b8467db1 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 14 Jul 2014 14:48:12 +0200 Subject: [PATCH 04/10] Removing double variable definition. --- mayan/apps/ocr/lang/deu.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/mayan/apps/ocr/lang/deu.py b/mayan/apps/ocr/lang/deu.py index 6291843844..be01ed2643 100644 --- a/mayan/apps/ocr/lang/deu.py +++ b/mayan/apps/ocr/lang/deu.py @@ -10,8 +10,6 @@ class LanguageBackend(BackendBase): def check_word(self, word): ALL_ALPHANUM = re.compile('([0-9a-zäöüß])', re.I) NON_ALPHANUM = re.compile('([^0-9a-zäöüß])', re.I) - ALL_ALPHANUM = re.compile('([0-9a-z])', re.I) - NON_ALPHANUM = re.compile('([^0-9a-z])', re.I) TOO_MANY_VOWELS = re.compile('[aäeioöuü]{4}', re.I) TOO_MANY_CONSONANTS = re.compile('[bcdfghjklmnpqrstvwxyz]{4}', re.I) From 8bae4648415f9a45ba0afdec055fd2036f06a529 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 14 Jul 2014 14:49:56 +0200 Subject: [PATCH 05/10] Re-adding migrated french language correction file, --- mayan/apps/ocr/lang/fra.py | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 mayan/apps/ocr/lang/fra.py diff --git a/mayan/apps/ocr/lang/fra.py b/mayan/apps/ocr/lang/fra.py new file mode 100644 index 0000000000..d4bff61c96 --- /dev/null +++ b/mayan/apps/ocr/lang/fra.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import + +import re + +from . import BackendBase + + +class LanguageBackend(BackendBase): + def check_word(self, word): + ALL_ALPHANUM = re.compile('([0-9a-záéíóúüñ])', re.I) + NON_ALPHANUM = re.compile('([^0-9a-záéíóúüñ])', re.I) + + TOO_MANY_VOWELS = re.compile('[aáeéiíoóuúü]{3}', re.I) + TOO_MANY_CONSONANTS = re.compile('[bcdfghjklmnñpqrstvwxyz]{5}', re.I) + ALL_ALPHA = re.compile('^[a-z]+$', re.I) + SINGLE_LETTER_WORDS = re.compile('^[aeoóuy]$', re.I) + + #(L) If a string is longer than 20 characters, it is garbage + if len(word) > 20: + return None + + #(A) If a string’s ratio of alphanumeric characters to total + #characters is less than 50%, the string is garbage + if len(ALL_ALPHANUM.findall(word)) < len(word) / 2: + return None + + #Remove word if all the letters in the word are non alphanumeric + if len(NON_ALPHANUM.findall(word)) == len(word): + return None + + #Removed words with too many consecutie vowels + if TOO_MANY_VOWELS.findall(word): + return None + + #Removed words with too many consecutie consonants + if TOO_MANY_CONSONANTS.findall(word): + return None + + #Only allow specific single letter words + if len(word) == 1 and not SINGLE_LETTER_WORDS.findall(word): + return None + + return word From f67176aa9f4b4724c3f9c4c8ec6751aa48503a7d Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 14 Jul 2014 14:57:03 +0200 Subject: [PATCH 06/10] Removing unused variable from language correction files. --- mayan/apps/ocr/lang/deu.py | 1 - mayan/apps/ocr/lang/eng.py | 1 - mayan/apps/ocr/lang/fra.py | 1 - mayan/apps/ocr/lang/rus.py | 1 - mayan/apps/ocr/lang/spa.py | 1 - 5 files changed, 5 deletions(-) diff --git a/mayan/apps/ocr/lang/deu.py b/mayan/apps/ocr/lang/deu.py index be01ed2643..9a9b89549e 100644 --- a/mayan/apps/ocr/lang/deu.py +++ b/mayan/apps/ocr/lang/deu.py @@ -13,7 +13,6 @@ class LanguageBackend(BackendBase): TOO_MANY_VOWELS = re.compile('[aäeioöuü]{4}', re.I) TOO_MANY_CONSONANTS = re.compile('[bcdfghjklmnpqrstvwxyz]{4}', re.I) - ALL_ALPHA = re.compile('^[a-z]+$', re.I) # SINGLE_LETTER_WORDS = re.compile('^$', re.I) #(L) If a string is longer than 40 characters, it is considered as garbage diff --git a/mayan/apps/ocr/lang/eng.py b/mayan/apps/ocr/lang/eng.py index c402bba9f9..29dc3384e8 100644 --- a/mayan/apps/ocr/lang/eng.py +++ b/mayan/apps/ocr/lang/eng.py @@ -12,7 +12,6 @@ class LanguageBackend(BackendBase): TOO_MANY_VOWELS = re.compile('[aeiou]{3}', re.I) TOO_MANY_CONSONANTS = re.compile('[bcdfghjklmnpqrstvwxyz]{5}', re.I) - ALL_ALPHA = re.compile('^[a-z]+$', re.I) SINGLE_LETTER_WORDS = re.compile('^[ai]$', re.I) # (L) If a string is longer than 20 characters, it is garbage diff --git a/mayan/apps/ocr/lang/fra.py b/mayan/apps/ocr/lang/fra.py index d4bff61c96..937551bc9c 100644 --- a/mayan/apps/ocr/lang/fra.py +++ b/mayan/apps/ocr/lang/fra.py @@ -13,7 +13,6 @@ class LanguageBackend(BackendBase): TOO_MANY_VOWELS = re.compile('[aáeéiíoóuúü]{3}', re.I) TOO_MANY_CONSONANTS = re.compile('[bcdfghjklmnñpqrstvwxyz]{5}', re.I) - ALL_ALPHA = re.compile('^[a-z]+$', re.I) SINGLE_LETTER_WORDS = re.compile('^[aeoóuy]$', re.I) #(L) If a string is longer than 20 characters, it is garbage diff --git a/mayan/apps/ocr/lang/rus.py b/mayan/apps/ocr/lang/rus.py index 28b8644062..05ce0e1ab1 100644 --- a/mayan/apps/ocr/lang/rus.py +++ b/mayan/apps/ocr/lang/rus.py @@ -13,7 +13,6 @@ class LanguageBackend(BackendBase): TOO_MANY_VOWELS = re.compile('[ёуеыаоэяию]{3}', re.I) TOO_MANY_CONSONANTS = re.compile('[йцкнгшщзхъфвпрлджчсмтьб{5}', re.I) - ALL_ALPHA = re.compile('^[ёйцукенгшщзхъфывапролджэячсмитьбю]+$', re.I) SINGLE_LETTER_WORDS = re.compile('^[уквояси]$', re.I) # (L) If a string is longer than 25 characters, it is garbage diff --git a/mayan/apps/ocr/lang/spa.py b/mayan/apps/ocr/lang/spa.py index 677aed73f6..eb4d9ead45 100644 --- a/mayan/apps/ocr/lang/spa.py +++ b/mayan/apps/ocr/lang/spa.py @@ -13,7 +13,6 @@ class LanguageBackend(BackendBase): TOO_MANY_VOWELS = re.compile('[aáeéiíoóuúü]{3}', re.I) TOO_MANY_CONSONANTS = re.compile('[bcdfghjklmnñpqrstvwxyz]{5}', re.I) - ALL_ALPHA = re.compile('^[a-z]+$', re.I) SINGLE_LETTER_WORDS = re.compile('^[aeoóuy]$', re.I) # (L) If a string is longer than 20 characters, it is garbage From a1868d6dd962de0e6f9d17ae3294b233fd468e23 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 14 Jul 2014 17:40:40 +0200 Subject: [PATCH 07/10] Some minor doc fixes. --- docs/intro/installation.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/intro/installation.rst b/docs/intro/installation.rst index 9a99bd2f04..4576eefa44 100644 --- a/docs/intro/installation.rst +++ b/docs/intro/installation.rst @@ -23,15 +23,15 @@ Initialize a ``virtualenv`` to deploy the project: $ source venv/bin/activate $ pip install mayan-edms==1.0.rc1 -By default **Mayan EDMS** will create a single file SQLite_ database which makes -is very easy to start using **Mayan EDMS**. Populate the database with the project's schema doing: +By default **Mayan EDMS** will create a single file SQLite_ database, which makes +it very easy to start using **Mayan EDMS**. Populate the database with the project's schema doing: .. code-block:: bash $ mayan-edms.py syncdb --migrate --noinput $ mayan-edms.py runserver -Point your browser to http://127:0.0.1:8000, if everything was installed +Point your browser to http://127.0.0.1:8000. If everything was installed correctly you should see the login screen and panel showing a randomly generated admin password. @@ -49,7 +49,7 @@ in the directory: venv/lib/python2.7/site-packages/mayan/settings/ with the foll -Then test your settings launch **Mayan EDMS** use:: +To test your settings launch **Mayan EDMS** using:: $ mayan-edms runserver --settings=mayan.settings.my_settings @@ -63,8 +63,8 @@ Other database managers ----------------------- If you want to use a database manager other than SQLite_ install any -corresponding python database drivers and create a settings_local.py file -with the corresponding database settings as shown here: https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-DATABASES +corresponding python database drivers and add the corresponding database settings +to your settings file (see above) as shown here: https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-DATABASES .. _`vendor lock-in`: https://secure.wikimedia.org/wikipedia/en/wiki/Vendor_lock-in From 53f4619a9c1f5e42189a19094c0f7787dcc236da Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 16 Jul 2014 13:47:32 -0400 Subject: [PATCH 08/10] Check for the correct exception --- mayan/apps/installation/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mayan/apps/installation/models.py b/mayan/apps/installation/models.py index 317e8108ea..99a19a723a 100644 --- a/mayan/apps/installation/models.py +++ b/mayan/apps/installation/models.py @@ -13,7 +13,7 @@ import sh try: from sh import lsb_release, uname -except sh.CommandNotFound: +except ImportError: LSB = False else: LSB = True From 923176217d4f93dd4b811cbf80ae1b3b4757f898 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 16 Jul 2014 13:53:41 -0400 Subject: [PATCH 09/10] Fix LICENSE file path for the license view --- mayan/apps/common/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mayan/apps/common/forms.py b/mayan/apps/common/forms.py index f74bc11ff9..206b032cca 100644 --- a/mayan/apps/common/forms.py +++ b/mayan/apps/common/forms.py @@ -165,4 +165,4 @@ class FileDisplayForm(forms.Form): class LicenseForm(FileDisplayForm): FILENAME = u'LICENSE' - DIRECTORY = [u'..'] + DIRECTORY = [] From 5cf836053404ba32dc39a808022944d4e0eae9fa Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 16 Jul 2014 18:39:01 -0400 Subject: [PATCH 10/10] Point the wsgi to the same autogenerated settings file --- mayan/wsgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mayan/wsgi.py b/mayan/wsgi.py index 2af45e7f63..c0aa85f7b1 100644 --- a/mayan/wsgi.py +++ b/mayan/wsgi.py @@ -8,7 +8,7 @@ https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mayan.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mayan.settings.local") from django.core.wsgi import get_wsgi_application application = get_wsgi_application()