[pybliographer/wip/gtk3] format: pyflakes
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pybliographer/wip/gtk3] format: pyflakes
- Date: Tue, 10 Oct 2017 18:06:46 +0000 (UTC)
commit 01297d328df3b87680162b2d63142eafb141d2eb
Author: Germán Poo-Caamaño <gpoo gnome org>
Date: Tue Oct 10 14:24:33 2017 -0300
format: pyflakes
Pyblio/Format/BibTeX.py | 10 ++++++----
Pyblio/Format/Medline.py | 3 ++-
Pyblio/Format/Ovid.py | 3 +--
Pyblio/Format/OvidLike.py | 5 +++--
Pyblio/Format/isifile.py | 2 --
Pyblio/Format/ut_Isi.py | 10 ++--------
Pyblio/Format/ut_Ovidlike.py | 2 +-
7 files changed, 15 insertions(+), 20 deletions(-)
---
diff --git a/Pyblio/Format/BibTeX.py b/Pyblio/Format/BibTeX.py
index 35005ce..c8b833a 100644
--- a/Pyblio/Format/BibTeX.py
+++ b/Pyblio/Format/BibTeX.py
@@ -22,13 +22,16 @@
# Extension module for BibTeX files
import _bibtex
-import os, sys, tempfile, pwd, time, traceback, re, string, copy
+import re, string, copy
-from types import *
-from Pyblio.Fields import *
+from gettext import gettext as _
+from Pyblio.Fields import Author, AuthorGroup, Date, LongText
+from Pyblio.Fields import Reference, Text, URL
from Pyblio import Base, Config, Autoload, Types
from Pyblio import Open, Key, Utils, Iterator, Exceptions
+# from types import LongText, Text
+
# this database is shared between all the unpickled entries
_unpickle_db = _bibtex.open_string ("<unpickled>", '', 0);
@@ -325,7 +328,6 @@ class DataBase(Base.DataBase):
_bibtex.reverse(_base_fieldtype[Text],
Config.get('bibtex+/braces').data,
user [k][0]))
- finished = 0
errors = []
# Creer la base de cles
diff --git a/Pyblio/Format/Medline.py b/Pyblio/Format/Medline.py
index 198f82f..a57ca69 100644
--- a/Pyblio/Format/Medline.py
+++ b/Pyblio/Format/Medline.py
@@ -24,7 +24,8 @@
from Pyblio import Base, Fields, Types, Autoload, Open, Iterator, Utils, Config
-import re, string,sys
+import re, string
+
header = re.compile ('^(\w\w[\w ][\w ])- (.*)$')
contin = re.compile ('^ (.*)$')
diff --git a/Pyblio/Format/Ovid.py b/Pyblio/Format/Ovid.py
index 8315fa6..3b3c3e1 100644
--- a/Pyblio/Format/Ovid.py
+++ b/Pyblio/Format/Ovid.py
@@ -24,9 +24,8 @@
""" Extension module for Ovid files """
from Pyblio.Format import OvidLike
-from Pyblio import Base, Open, Config, Types, Autoload
+from Pyblio import Base, Open, Config, Autoload
-import string
class Ovid (Base.DataBase):
diff --git a/Pyblio/Format/OvidLike.py b/Pyblio/Format/OvidLike.py
index 98375b4..1da0967 100644
--- a/Pyblio/Format/OvidLike.py
+++ b/Pyblio/Format/OvidLike.py
@@ -23,9 +23,10 @@
""" Parser for files having an Ovid-like structure """
-import sys, re, string
+import re, string
+
+from Pyblio import Base, Fields, Iterator, Types
-from Pyblio import Base, Exceptions, Fields, Iterator, Types, Utils
SimpleField = 0
AuthorField = 1
diff --git a/Pyblio/Format/isifile.py b/Pyblio/Format/isifile.py
index 4bbf463..a1177dc 100644
--- a/Pyblio/Format/isifile.py
+++ b/Pyblio/Format/isifile.py
@@ -160,7 +160,6 @@ class IsifileIterator(Iterator.Iterator):
for key in ( 'AU', 'ED'):
if lines.has_key(key):
- field = Types.get_field('author')
group = Fields.AuthorGroup()
for item in lines[key]:
if string.strip(item) =='[Anon]' :
@@ -271,7 +270,6 @@ def writer (iter, output_stream, preamble=None, postamble = None):
optional pre- and postamble, onto an output stream.'''
remaining = {}
- text = []
global field_map, output
output = output_stream
field_map = field_map or reverse_mapping(key_map)
diff --git a/Pyblio/Format/ut_Isi.py b/Pyblio/Format/ut_Isi.py
index ab24d3a..e73ab38 100644
--- a/Pyblio/Format/ut_Isi.py
+++ b/Pyblio/Format/ut_Isi.py
@@ -1,18 +1,14 @@
-# -*- coding: iso8859-1 -*-
-
+# -*- coding: utf-8 -*-
import cStringIO, os, sys, unittest
sys.path.append (os.path.abspath('../..'))
print os.path.abspath('../..')
-
-
from Pyblio.Format import isifile
from Pyblio import Base, Config, Fields
-
example_1 = """AU Bogin, B
TI Evolutionary hypotheses for human childhood
SO YEARBOOK OF PHYSICAL ANTHROPOLOGY, VOL 40 - 1997
@@ -166,14 +162,12 @@ def main ():
if __name__ == '__main__':
-
main()
-
### Local Variables:
### Mode: python
-### encoding: iso-8859-1
+### encoding: utf-8
### End:
diff --git a/Pyblio/Format/ut_Ovidlike.py b/Pyblio/Format/ut_Ovidlike.py
index db5de22..95fff2a 100644
--- a/Pyblio/Format/ut_Ovidlike.py
+++ b/Pyblio/Format/ut_Ovidlike.py
@@ -121,7 +121,7 @@ from Pyblio import Config
from Pyblio.Key import Key
from Pyblio.Types import get_entry
from Pyblio.Format.OvidLike import OvidLike, writer, write_source_field
-from Pyblio.Fields import Author, AuthorGroup, Date
+from Pyblio.Fields import Date
class WriterCase (unittest.TestCase):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]