Commit d8235699 authored by c24b's avatar c24b

README

parents 4cfc1be2 34d2685e
......@@ -11,7 +11,7 @@ class RISParser(Parser):
# #super(Parser, self).__init__()
# #super(Parser, self).__init__()
# self._languages_cache = LanguagesCache() if language_cache is None else language_cache
_begin = 6
_parameters = {
......@@ -29,13 +29,13 @@ class RISParser(Parser):
}
def parse(self, file):
hyperdata = {}
last_key = None
last_values = []
# browse every line of the file
for line in file:
if len(line) > 2:
if len(line) > 2 :
# extract the parameter key
parameter_key = line[:2]
if parameter_key != b' ' and parameter_key != last_key:
......@@ -60,11 +60,4 @@ class RISParser(Parser):
print(error)
# if a hyperdata object is left in memory, yield it as well
if hyperdata:
# try:
# if hyperdata['date_to_parse']:
# print(hyperdata['date_to_parse'])
# except:
# pass
#
#print(hyperdata['title'])
yield hyperdata
......@@ -3,6 +3,7 @@ import dateutil.parser
import zipfile
import re
import dateparser as date_parser
from gargantext.util.languages import languages
......@@ -50,7 +51,7 @@ class Parser:
default=DEFAULT_DATE
).strftime("%Y-%m-%d %H:%M:%S")
except Exception as error:
print(error, 'Parser Zotero, Date not parsed for:', date_string)
print(error, 'Date not parsed for:', date_string)
hyperdata['publication_date'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
......@@ -75,8 +76,21 @@ class Parser:
date_string += ":" + hyperdata[key]
try:
hyperdata[prefix + "_date"] = dateutil.parser.parse(date_string).strftime("%Y-%m-%d %H:%M:%S")
except:
pass
except Exception as error:
try:
print(error, date_string)
# Date format: 1994 NOV-DEC
hyperdata[prefix + "_date"] = date_parser.parse(str(date_string)[:8]).strftime("%Y-%m-%d %H:%M:%S")
except Exception as error:
try:
print(error)
# FIXME Date format: 1994 SPR
# By default, we take the year only
hyperdata[prefix + "_date"] = date_parser.parse(str(date_string)[:4]).strftime("%Y-%m-%d %H:%M:%S")
except Exception as error:
print(error)
else:
print("WARNING: Date unknown at _Parser level, using now()")
hyperdata['publication_date'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
......
......@@ -72,8 +72,9 @@ def notify_user(username, email, password):
def create_user(username, email, user=None, password=None, active=False, notify=True):
if user is None:
user = User()
user.username = username
user.email = email
user.username = username
user.first_name = username
user.email = email
user.is_active = True
if password is None or password == "":
password = make_random_password()
......
#Gargantext
==========
<<<<<<< HEAD
Install Instructions for Gargantext (CNRS):
1. [SETUP](##SETUP)
......@@ -169,22 +168,44 @@ Enjoy :)
=======
Install Instructions for Gargantext (CNRS).
## Help needed ?
1. [SETUP](##SETUP)
2. [INSTALL](##INSTALL)
3. [RUN](##RUN)
## Support needed ?
See http://gargantext.org/about and tools for the community
## Create user Gargantua
## Setup
Prepare your environnement
Build your OS dependencies inside a docker
<<<<<<< HEAD
Main user of Gargantext is Gargantua (role of Pantagruel soon)!
>>>>>>> constance-docker
=======
>>>>>>> 8eac65c6d225deb05948c583367e8540ad95316d
``` bash
sudo adduser --disabled-password --gecos "" gargantua
cd /srv/gargantext/install/docker/dev
./build
```
<<<<<<< HEAD
<<<<<<< HEAD
=======
## Create the directories you need
=======
## INSTALL
### Enter docker container
``` bash
/srv/gargantext/install/docker/enterGargantextImage
```
### Create the directories you need
>>>>>>> 8eac65c6d225deb05948c583367e8540ad95316d
``` bash
for dir in "/srv/gargantext"
......@@ -197,29 +218,34 @@ for dir in "/srv/gargantext"
done
```
You should see:
```bash
$tree /srv
/srv
├── gargantext
├── gargantext_lib
├── gargantext_media
│   └── srv
│   └── env_3-5
└── gargantext_static
```
## Get the source code of Gargantext
``` bash
```bash
cp ~/.ssh/id_rsa.pub id_rsa.pub
`
git clone ssh://gitolite@delanoe.org:1979/gargantext /srv/gargantext \
&& cd /srv/gargantext \
&& git fetch origin refactoring \
&& git checkout refactoring \
```
### TODO (soon) : git clone https://gogs.iscpif.fr/gargantext.git
## Build your OS dependencies
2 ways, for each you need to install Debian GNU/Linux dependencies.
TODO (soon) : git clone https://gogs.iscpif.fr/gargantext.git
1) [EASY] Docker way (directory install/docker)
2) [EXPERTS] Debian way (directory install/debian)
## Build your docker image
``` bash
cd /srv/gargantext/install/docker/dev
./build
```
## Install Python environment
Inside the docker image, execute as root:
......@@ -234,20 +260,17 @@ Inside the docker image, execute as root:
```
## Get main librairies
Can be long, so be patient :)
``` bash
wget http://dl.gargantext.org/gargantext_lib.tar.bz2 \
&& tar xvjf gargantext_lib.tar.bz2 -o /srv/gargantext_lib \
&& sudo tar xvjf gargantext_lib.tar.bz2 --directory /srv/gargantext_lib \
&& sudo chown -R gargantua:gargantua /srv/gargantext_lib \
&& echo "Libs installed"
```
## Configure && Launch Gargantext
### Enter docker container
``` bash
/srv/gargantext/install/docker/enterGargantextImage
```
### Inside docker container configure the database
``` bash
service postgresql start
......@@ -263,7 +286,9 @@ python /srv/gargantext/init_accounts.py /srv/gargantext/install/init/account.csv
FIXME: dbmigrate need to launched several times since tables are
ordered with alphabetical order (and not dependencies order)
### Inside docker container launch Gargantext
## RUN
Inside docker container launch Gargantext
``` bash
service postgresql start
su gargantua
......@@ -281,5 +306,4 @@ Login : gargantua
Password : autnagrag
Enjoy :)
>>>>>>> constance-docker
......@@ -41,8 +41,10 @@ RUN apt-get update && apt-get install -y \
# ^for numpy, pandas
python3-numexpr \
# ^ for numpy performance
libxml2-dev libxslt-dev
libxml2-dev libxslt-dev \
# ^ for lxml
bzip2
# ^ for the Gargantext librairies
### PROD VERSION OF GARGANTEXT ONLY
#RUN apt-get install -y uwsgi nginx uwsgi-plugin-python rabbitmq-server
......
......@@ -10,7 +10,7 @@
#######################################################################
su postgres -c 'pg_dropcluster 9.4 main --stop'
rm -rf /srv/gargantext_data && mkdir /srv/gargantext_data && chown postgres:postgres /srv/gargantext_data
#rm -rf /srv/gargantext_data && mkdir /srv/gargantext_data && chown postgres:postgres /srv/gargantext_data
su postgres -c '/usr/lib/postgresql/9.5/bin/initdb -D /srv/gargantext_data/'
su postgres -c '/usr/lib/postgresql/9.5/bin/pg_ctl -D /srv/gargantext_data/ -l journal_applicatif start'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment