This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Para a má-formação das referências bibliográficas, o céu é o limite. Além de | |
não seguirem as normas à risca, os autores ainda muitas vezes produzem | |
referências que carecem dos elementos fundamentais, como por exemplo a URL | |
em uma referência à página de internet. | |
Na SciELO, documentos individuais não podem ser impedidos de ingressar por | |
problemas de má-formação ou falta de metadados essenciais. Suspensões ou | |
outras medidas punitivas se dão no nível do periódico, por meio de processos | |
formais, e não individualmente no nível do documento. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import os | |
from os.path import join, getsize | |
import re | |
IMG_PATTERN = re.compile(r'^\w{4}-\w{4}-') | |
def lista_tifs(top): | |
for dirpath, dirnames, filenames in os.walk(top): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<front> | |
... | |
<article-meta> | |
... | |
<funding-group> | |
<award-group> | |
<funding-source rid="01">CNPq</funding-source> | |
<award-id rid="02">16362 2010/2011</award-id> | |
</award-group> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_xpath(element): | |
"""Get the XPath string to element. | |
This code is a port of a C# snippet published at | |
http://stackoverflow.com/a/9221904 | |
""" | |
path = '/' + element.tag | |
parent = element.getparent() | |
if parent is not None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
>>> rsp = models.Journal.objects.create(title=u'Revista de saúde pública') | |
(0.002) INSERT INTO "journalmanager_journal" ("title") VALUES (Revista de saúde pública); args=[u'Revista de sa\xfade p\xfablica'] | |
>>> | |
>>> brasil = models.Collection.objects.create(name=u'Brasil') | |
(0.001) INSERT INTO "journalmanager_collection" ("name") VALUES (Brasil); args=[u'Brasil'] | |
>>> | |
>>> rsp.join(brasil) | |
(0.001) INSERT INTO "journalmanager_membership" ("journal_id", "collection_id", "publication_status", "publication_status_since") VALUES (1, 1, c, 2014-03-22 22:47:59.174742); args=[1, 1, 'c', u'2014-03-22 22:47:59.174742'] | |
(0.001) INSERT INTO "journalmanager_journaltimeline" ("journal_id", "collection_id", "publication_status", "publication_status_since") VALUES (1, 1, c, 2014-03-22 22:47:59.174742); args=[1, 1, 'c', u'2014-03-22 22:47:59.174742'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
#coding: utf-8 | |
import tablib | |
def get_dataset(filepath): | |
skipped_rows = 0 | |
valid_rows = 0 | |
ds = tablib.Dataset(headers=['title', 'pubdate', 'volume', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Copyright (c) 2013 Python Software Foundation; All Rights Reserved | |
Adds capabilities for encoding generator objects as JSON arrays. | |
""" | |
import json | |
import types | |
INFINITY = json.encoder.INFINITY | |
FLOAT_REPR = json.encoder.FLOAT_REPR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import copy | |
class MementoMixin(object): | |
def __init__(self, *args, **kwargs): | |
self._history = [] | |
def commit(self): | |
self._history.append(copy.deepcopy(vars(self))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
""" | |
Exemplo prático do design pattern ``Visitor`` | |
Dúvidas | |
------- | |
* Como fazer quando utilizamos Descritores? | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@property | |
def resource_id(self): | |
cleaned = [seg for seg in self.resource_uri.split('/') if seg] | |
return cleaned[-1] |