Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
6cd09846
Commit
6cd09846
authored
Jan 13, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPDATE] bugfix for europress (text None)
parent
69e5fb9d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
25 deletions
+13
-25
api.py
gargantext_web/api.py
+0
-2
models.py
node/models.py
+0
-4
EuropressFileParser.py
parsing/FileParsers/EuropressFileParser.py
+13
-11
subcorpus.html
templates/subcorpus.html
+0
-8
No files found.
gargantext_web/api.py
View file @
6cd09846
...
@@ -214,8 +214,6 @@ class NodesChildrenDuplicates(APIView):
...
@@ -214,8 +214,6 @@ class NodesChildrenDuplicates(APIView):
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
total
=
duplicates
.
count
()
total
=
duplicates
.
count
()
# response building
# response building
for
duplicate
in
duplicates
[
offset
:
offset
+
limit
]:
print
(
duplicate
)
return
JsonHttpResponse
({
return
JsonHttpResponse
({
'pagination'
:
{
'pagination'
:
{
'offset'
:
offset
,
'offset'
:
offset
,
...
...
node/models.py
View file @
6cd09846
...
@@ -130,13 +130,9 @@ class Node(CTENode):
...
@@ -130,13 +130,9 @@ class Node(CTENode):
def
add_resource
(
self
,
**
kwargs
):
def
add_resource
(
self
,
**
kwargs
):
print
(
"printing arguments for add_resource():"
)
print
(
"printing arguments for add_resource():"
)
print
(
kwargs
)
print
(
kwargs
)
from
django.core.files.storage
import
default_storage
from
django.core.files.storage
import
default_storage
from
django.core.files.base
import
ContentFile
from
django.core.files.base
import
ContentFile
import
os
import
os
...
...
parsing/FileParsers/EuropressFileParser.py
View file @
6cd09846
...
@@ -70,18 +70,20 @@ class EuropressFileParser(FileParser):
...
@@ -70,18 +70,20 @@ class EuropressFileParser(FileParser):
if
isinstance
(
text
,
bytes
):
if
isinstance
(
text
,
bytes
):
text
=
text
.
decode
(
encoding
)
text
=
text
.
decode
(
encoding
)
format_date_fr
=
re
.
compile
(
'
\
d*
\
s*
\
w+
\
s+
\
d{4}'
,
re
.
UNICODE
)
format_date_fr
=
re
.
compile
(
'
\
d*
\
s*
\
w+
\
s+
\
d{4}'
,
re
.
UNICODE
)
test_date_fr
=
format_date_fr
.
match
(
text
)
if
text
is
not
None
:
test_date_fr
=
format_date_fr
.
match
(
text
)
format_date_en
=
re
.
compile
(
'
\
w+
\
s+
\
d+,
\
s+
\
d{4}'
,
re
.
UNICODE
)
format_date_en
=
re
.
compile
(
'
\
w+
\
s+
\
d+,
\
s+
\
d{4}'
,
re
.
UNICODE
)
test_date_en
=
format_date_en
.
match
(
text
)
test_date_en
=
format_date_en
.
match
(
text
)
format_sect
=
re
.
compile
(
'(
\
D+),'
,
re
.
UNICODE
)
format_sect
=
re
.
compile
(
'(
\
D+),'
,
re
.
UNICODE
)
test_sect
=
format_sect
.
match
(
text
)
test_sect
=
format_sect
.
match
(
text
)
format_page
=
re
.
compile
(
', p. (
\
w+)'
,
re
.
UNICODE
)
test_page
=
format_page
.
match
(
text
)
format_page
=
re
.
compile
(
', p. (
\
w+)'
,
re
.
UNICODE
)
else
:
test_page
=
format_page
.
match
(
text
)
test_date_fr
=
None
test_date_en
=
None
test_sect
=
None
test_page
=
None
if
test_date_fr
is
not
None
:
if
test_date_fr
is
not
None
:
self
.
localeEncoding
=
"fr_FR"
self
.
localeEncoding
=
"fr_FR"
...
...
templates/subcorpus.html
View file @
6cd09846
...
@@ -44,14 +44,6 @@ function getCookie(name) {
...
@@ -44,14 +44,6 @@ function getCookie(name) {
return
cookieValue
;
return
cookieValue
;
}
}
$
.
ajaxSetup
({
beforeSend
:
function
(
xhr
,
settings
)
{
if
(
!
(
/^http:.*/
.
test
(
settings
.
url
)
||
/^https:.*/
.
test
(
settings
.
url
)))
{
// Only send the token to relative URLs i.e. locally.
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
'csrftoken'
));
}
}
});
function
deleteNode
(
node_id
)
{
function
deleteNode
(
node_id
)
{
$
.
ajax
({
$
.
ajax
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment