[pybliographer] gnomeui: pyflakes on Pyblio/GnomeUI



commit d53859db3c9c1ac97e12ee5e34a94bef0bcd3b87
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Wed Mar 28 11:03:09 2018 -0300

    gnomeui: pyflakes on Pyblio/GnomeUI

 Pyblio/GnomeUI/Common.py        |   38 ++++++++++++++--------------
 Pyblio/GnomeUI/Config.py        |   12 +++++---
 Pyblio/GnomeUI/Document.py      |   17 +++++++-----
 Pyblio/GnomeUI/Editor.py        |   36 +++++++++++++++------------
 Pyblio/GnomeUI/Entry.py         |   52 +++++++++++++++++++-------------------
 Pyblio/GnomeUI/Fields.py        |   16 ++++++-----
 Pyblio/GnomeUI/FileSelector.py  |   24 ++++++++---------
 Pyblio/GnomeUI/Format.py        |    4 +--
 Pyblio/GnomeUI/Index.py         |   24 +++++++++++------
 Pyblio/GnomeUI/OpenURL.py       |    1 -
 Pyblio/GnomeUI/Pybliographic.py |   30 +++++++++++-----------
 Pyblio/GnomeUI/Search.py        |   13 ++++-----
 Pyblio/GnomeUI/Sort.py          |    9 +++---
 Pyblio/GnomeUI/__init__.py      |   49 ++++++++++++++++++++----------------
 14 files changed, 171 insertions(+), 154 deletions(-)
---
diff --git a/Pyblio/GnomeUI/Common.py b/Pyblio/GnomeUI/Common.py
index 83971b9..ae00b4e 100644
--- a/Pyblio/GnomeUI/Common.py
+++ b/Pyblio/GnomeUI/Common.py
@@ -1,22 +1,23 @@
+# -*- coding: utf-8 -*-
 # This file is part of pybliographer
-# 
-# Copyright (C) 2005 Peter Schulte-Stracke
-# Email : mail schulte-stracke de
-#         
+#
+# Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 2005 Peter Schulte-Stracke <mail schulte-stracke de>
+#
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2 
+# as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-#   
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details. 
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-# 
+#
 
 """
  
@@ -28,18 +29,21 @@ Class fileschooserbutton implements a widget similar to
 Class filechooserdialog subclasses gtk.FileChooserDialog and
       adds some fields to enter additional information for an URL.
 
-      
-     -- 
+
+     --
 
 
 """
-RESPONSE_COPY = 1
-RESPONSE_VIEW = 2
+import gtk
+import gtk.gdk
+import pango
 
-import gobject, gtk, gtk.gdk, pango, sys
 
 from  Pyblio import Fields, Resource
 
+RESPONSE_COPY = 1
+RESPONSE_VIEW = 2
+
 
 def get_icon_theme (widget):
 
@@ -52,8 +56,7 @@ class filechooserbutton (gtk.Button):
     def __init__ (self, URL=None, action='enter/edit', parent=None):
        gtk.Button.__init__ (self)
 
-       g_error = gobject.GError ()
-       self.parent_widget = parent 
+       self.parent_widget = parent
        self.url = URL or Fields.URL ()
        self.newuri = None
        assert isinstance (URL, Fields.URL)
@@ -119,7 +122,6 @@ class filechooserbutton (gtk.Button):
 
 
 class filechooserdialog (gtk.FileChooserDialog):
-    
     def __init__ (self, url, title):
 
        gtk.FileChooserDialog.__init__ (
@@ -202,14 +204,12 @@ class filechooserdialog (gtk.FileChooserDialog):
        note = self.note_w.get_text ()
        #print 'DIALOG RUN:', uri, invalid, inexact, date, note
 
-
        return response, Fields.URL (
            uri, invalid=invalid, inexact=inexact,
            date=date, note=note)
 
 
-
 # Local Variables:
-# coding: "latin-1"
+# coding: "utf-8"
 # py-master-file: "ut_common.py"
 # End:
diff --git a/Pyblio/GnomeUI/Config.py b/Pyblio/GnomeUI/Config.py
index 21dd650..822d368 100644
--- a/Pyblio/GnomeUI/Config.py
+++ b/Pyblio/GnomeUI/Config.py
@@ -23,17 +23,19 @@
 # TO DO:
 # List view troubles
 
-import gobject, gtk
-
-import copy, os.path, re, string
+import copy
+import re
+import string
+import gobject
+import gtk
 
 from Pyblio.GnomeUI import Utils
-from Pyblio import Config, version
-from Pyblio.Utils import format
+from Pyblio import Config
 
 _map = string.maketrans ('\t\n', '  ')
 _cpt = re.compile ('\s+')
 
+
 class ConfigDialog (Utils.Builder):
     gladeinfo = {
         'file': 'config.ui',
diff --git a/Pyblio/GnomeUI/Document.py b/Pyblio/GnomeUI/Document.py
index 4d89bfa..4819cc8 100644
--- a/Pyblio/GnomeUI/Document.py
+++ b/Pyblio/GnomeUI/Document.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 #
 # This file is part of pybliographer
-# 
+#
 # Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
 # Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer org>
 #         
@@ -23,8 +23,14 @@
 
 ''' This module defines a Document class '''
 
+import os
+import string
+import types
+import sys
+import traceback
+import stat
+import cPickle as pickle
 import gobject
-
 import gtk
 
 from Pyblio.GnomeUI import Editor, Entry, FileSelector, Format
@@ -32,15 +38,12 @@ from Pyblio.GnomeUI import Index, OpenURL, Search, Utils
 from Pyblio.GnomeUI.Sort import SortDialog
 from Pyblio.GnomeUI.Medline import MedlineUI
 
-from Pyblio import Base, Config, Connector, Exceptions, Fields, Open
-from Pyblio import Query, Resource, Selection, Sort, Types, version
+from Pyblio import Config, Connector, Exceptions, Fields, Open
+from Pyblio import Query, Resource, Selection, Sort, version
 from Pyblio import Search as SearchCls
 
 import Pyblio.Style.Utils
 
-import os, string, copy, types, sys, traceback, stat
-
-import cPickle as pickle
 
 printable = string.lowercase + string.uppercase + string.digits
 
diff --git a/Pyblio/GnomeUI/Editor.py b/Pyblio/GnomeUI/Editor.py
index 5bafefa..5603044 100644
--- a/Pyblio/GnomeUI/Editor.py
+++ b/Pyblio/GnomeUI/Editor.py
@@ -1,33 +1,37 @@
 # -*- coding: utf-8 -*-
 # This file is part of pybliographer
-# 
-# Copyright (C) 1998-2004 Frederic GOBRY
-# Email : gobry pybliographer org
-#         
+#
+# Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer org>
+#
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2 
+# as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-#   
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details. 
-# 
+# GNU General Public License for more details.
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-# 
-# 
+#
+#
 
 # TO FIX
 #   entry editor for more than 50 chars
 # added: Note taking widget
 
-import copy, gobject, gtk, re, string
+import copy
+import re
+import string
+import gobject
+import gtk
 
-from Pyblio import Base, Config, Connector, Exceptions, Fields, Key, Types
-from Pyblio.GnomeUI import Common, FieldsInfo, FileSelector, Mime, Utils
+from Pyblio import Config, Connector, Exceptions, Fields, Key, Types
+from Pyblio.GnomeUI import FieldsInfo, FileSelector, Mime, Utils
 
 key_re = re.compile("^[\w:_+-.()/]+$")
 
@@ -359,7 +363,7 @@ class Date (BaseField):
         text = string.strip (self.month.get_chars (0, -1)).encode ('latin-1')
         if text != '':
             try: month = int (text)
-            except ValueError, err:
+            except ValueError:
                 Utils.error_dialog_s(self.day.get_toplevel(),
                                     ("Invalid day field in date"))
                 return -1
@@ -1151,7 +1155,7 @@ class Editor(Connector.Publisher):
         if self.native_mode:
             return
         n = self.editor.notebook
-        box = n.get_nth_page(n.get_current_page())
+        n.get_nth_page(n.get_current_page())
 
     def save_size(self):
         if not self.editor:
@@ -1297,7 +1301,7 @@ class LT_Widget_2:
             self.hidden = False
             self.notebook.insert_page (
                 self.page, self.label, self.position)
-        pos = self.notebook.page_num (self.page)
+        self.notebook.page_num (self.page)
         self.notebook.set_current_page (self.position)
 
     def update (self):
diff --git a/Pyblio/GnomeUI/Entry.py b/Pyblio/GnomeUI/Entry.py
index 9cc0cba..63198b8 100644
--- a/Pyblio/GnomeUI/Entry.py
+++ b/Pyblio/GnomeUI/Entry.py
@@ -1,33 +1,33 @@
+# -*- coding: utf-8 -*-
+#
 # This file is part of pybliographer
-# 
-# Copyright (C) 1998-2004 Frederic GOBRY
-# Email : gobry pybliographer org
-#         
+#
+# Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer orgg
+#
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2 
+# as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-#   
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details. 
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-# 
-# 
+#
+#
 
-from gtk import *
+import string
+import gobject
 import gtk
+import pango
 
-import pango, gobject
-
-import string
 
-from Pyblio.GnomeUI import Utils
-from Pyblio import Config, recode, Fields
+from Pyblio import Fields
 
 
 class Entry:
@@ -36,7 +36,7 @@ class Entry:
     def __init__ (self):
         ''' Create the graphical widget '''
         
-        self.text = TextView ()
+        self.text = gtk.TextView ()
         self.buff = self.text.get_buffer ()
 
         self.tag = {}
@@ -52,13 +52,13 @@ class Entry:
                  self.buff.create_tag ('body',
                                        left_margin = 20)
 
-        self.w = ScrolledWindow ()
-        self.w.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC)
+        self.w = gtk.ScrolledWindow ()
+        self.w.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
         self.w.add (self.text)
 
         self.text.set_editable (False)
         self.text.set_cursor_visible (False)
-        self.text.set_wrap_mode (WRAP_WORD)
+        self.text.set_wrap_mode (gtk.WRAP_WORD)
         self.text.set_left_margin (5)
         self.text.set_right_margin (5)
         
@@ -97,7 +97,7 @@ class Entry:
 
             anchor = self.buff.create_child_anchor (iter)
             
-            button = Button ('...')
+            button = gtk.Button ('...')
             button.show ()
 
             def url_open (w, url):
@@ -106,12 +106,12 @@ class Entry:
                     
                 except gobject.GError, msg:
 
-                    d = MessageDialog (None,
-                                       DIALOG_MODAL |
-                                       DIALOG_DESTROY_WITH_PARENT,
-                                       MESSAGE_ERROR,
-                                       BUTTONS_CLOSE,
-                                       _('Cannot open URL:\n%s') % msg)
+                    d = gtk.MessageDialog (None,
+                                           gtk.DIALOG_MODAL |
+                                           gtk.DIALOG_DESTROY_WITH_PARENT,
+                                           gtk.MESSAGE_ERROR,
+                                           gtk.BUTTONS_CLOSE,
+                                           _('Cannot open URL:\n%s') % msg)
                     d.run ()
                     d.destroy ()
                     
diff --git a/Pyblio/GnomeUI/Fields.py b/Pyblio/GnomeUI/Fields.py
index 64c886c..aa51633 100644
--- a/Pyblio/GnomeUI/Fields.py
+++ b/Pyblio/GnomeUI/Fields.py
@@ -27,14 +27,15 @@ bibliography '''
 # adapt menu item for this dialog
 # cleaning up
 
+import copy
+import string
+import gtk
 
-import gobject, gtk
 
-import copy, os, re, string
-
-from Pyblio import Config, Fields, Types, version
+from Pyblio import Config, Fields, Types
 from Pyblio.GnomeUI import Utils
 
+
 _typename = {
     Fields.AuthorGroup : _('Authors'),
     Fields.Text        : _('Text'),
@@ -44,6 +45,7 @@ _typename = {
     Fields.Date        : _('Date')
     }
 
+
 class FieldsDialog (Utils.Builder):
     gladeinfo = {
         'file': 'fields1.ui',
@@ -183,11 +185,11 @@ class FieldsDialog (Utils.Builder):
         if iter:
             p = self.sfm.convert_iter_to_child_iter(None, iter)
             data = self.fm[p]
-            self.name1.set_text(self.fm[p][0])
+            self.name1.set_text(data[0])
             try:
-                self.menu1.set_active(self.menu_items.index(self.fm[p][3].type))
+                self.menu1.set_active(self.menu_items.index(data[3].type))
             except ValueError:
-                print(self.menu_items, self.fm[p][0], self.fm[p][2])
+                print(self.menu_items, data[0], data[2])
 
     def on_name1_changed (self, *args):
         sel = self.fields1.get_selection()
diff --git a/Pyblio/GnomeUI/FileSelector.py b/Pyblio/GnomeUI/FileSelector.py
index fa555fd..a366510 100644
--- a/Pyblio/GnomeUI/FileSelector.py
+++ b/Pyblio/GnomeUI/FileSelector.py
@@ -1,32 +1,30 @@
 # -*- coding: utf-8 -*-
 # This file is part of pybliographer
-# 
-# Copyright (C) 1998-2004 Frederic GOBRY
-# Email : gobry pybliographer org
-#         
+#
+# Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer org>
+#
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2 
+# as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-#   
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details. 
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-# 
-# 
-
-import string, os, urlparse
+#
+#
 
+import os
 import gtk
 
-from Pyblio import Open, Types, Base, Fields, Config, Autoload
 
-from Pyblio.GnomeUI import Utils
+from Pyblio import Autoload
 
 
 class URLFileSelection (gtk.FileChooserDialog):
diff --git a/Pyblio/GnomeUI/Format.py b/Pyblio/GnomeUI/Format.py
index 5b80b1d..7ca73f5 100644
--- a/Pyblio/GnomeUI/Format.py
+++ b/Pyblio/GnomeUI/Format.py
@@ -22,10 +22,8 @@
 
 ''' Defines a Dialog to format a subset of entries as a bibliography '''
 
+import os
 import gtk
-import gobject
-
-import string, os
 
 from Pyblio import Connector, version, Autoload
 from Pyblio.GnomeUI import Utils
diff --git a/Pyblio/GnomeUI/Index.py b/Pyblio/GnomeUI/Index.py
index 364ed36..c31a4a7 100644
--- a/Pyblio/GnomeUI/Index.py
+++ b/Pyblio/GnomeUI/Index.py
@@ -1,7 +1,9 @@
+# -*- coding: utf-8 -*-
+#
 # This file is part of pybliographer
 #
-# Copyright (C) 1998-2004 Frederic GOBRY
-# Email : gobry pybliographer org
+# Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer or
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -30,16 +32,19 @@
 
 ''' Main index containing the columned view of the entries '''
 
-from Pyblio import Config, Connector, Fields, Resource
-from Pyblio import Types, Sort, userformat, version
-
-import gobject, gtk, gtk.gdk, os.path, pango
+import os.path
+import cPickle
+import gobject
+import gtk
+import gtk.gdk
+import pango
 
-from Pyblio.GnomeUI import FieldsInfo, Mime, Utils
+from string import ascii_letters, lower, join, digits
 
-from string import *
+from Pyblio import Config, Connector, Fields, Resource
+from Pyblio import Types, Sort, userformat, version
+from Pyblio.GnomeUI import Mime, Utils
 
-import cPickle
 
 pickle = cPickle
 del cPickle
@@ -50,6 +55,7 @@ for c in ascii_letters + digits:
 
 _safechar = ''.join (_safechar)
 
+
 class Index (Connector.Publisher):
     ''' Graphical index of an iterator '''
 
diff --git a/Pyblio/GnomeUI/OpenURL.py b/Pyblio/GnomeUI/OpenURL.py
index 688039e..958776b 100644
--- a/Pyblio/GnomeUI/OpenURL.py
+++ b/Pyblio/GnomeUI/OpenURL.py
@@ -25,7 +25,6 @@
 import gobject
 import gtk
 
-import string, os
 
 from Pyblio import Connector, Autoload
 from Pyblio.GnomeUI import Utils
diff --git a/Pyblio/GnomeUI/Pybliographic.py b/Pyblio/GnomeUI/Pybliographic.py
index 89286d7..40b7235 100644
--- a/Pyblio/GnomeUI/Pybliographic.py
+++ b/Pyblio/GnomeUI/Pybliographic.py
@@ -1,33 +1,35 @@
+# -*- coding: utf-8 -*-
 # This file is part of pybliographer
-# 
-# Copyright (C) 1998-2004 Frederic GOBRY
-# Email : gobry pybliographer org
-#         
+#
+# Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer org>
+#
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2 
+# as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-#   
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details. 
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-# 
-# 
+#
+#
 
 ''' Main Module holding all the documents '''
 
-import copy, os, stat
+import copy
+import os
+import stat
+import gtk
 
 from Pyblio.GnomeUI import Document, Utils
 from Pyblio import Base, Config
 
-from gtk import *
-
 class Pybliographic:
     ''' Main class holding all the documents and performing
     general tasks '''
@@ -139,6 +141,4 @@ class Pybliographic:
             doc.w.destroy ()
             self.documents.remove (doc)
 
-        main_quit ()
-        return
-    
+        gtk.main_quit()
diff --git a/Pyblio/GnomeUI/Search.py b/Pyblio/GnomeUI/Search.py
index e300ed0..ef2cb43 100644
--- a/Pyblio/GnomeUI/Search.py
+++ b/Pyblio/GnomeUI/Search.py
@@ -23,15 +23,14 @@
 
 """ This module implements the Search dialog """
 
-import os
+import string
+import re
+import sys
+import traceback
+import gtk
 
-import gtk, gobject
-
-import string, re, sys, traceback, copy
-
-from Pyblio import Types, Search, Config, \
-     Connector, TextUI, version
 
+from Pyblio import Types, Search, Config, Connector, TextUI
 from Pyblio.GnomeUI import Utils
 
 
diff --git a/Pyblio/GnomeUI/Sort.py b/Pyblio/GnomeUI/Sort.py
index 694254c..42504d8 100644
--- a/Pyblio/GnomeUI/Sort.py
+++ b/Pyblio/GnomeUI/Sort.py
@@ -22,14 +22,15 @@
 
 ''' This module implements a Dialog to define Sort criterions '''
 
-import os, string
+import cPickle
+
+import gtk
+import gobject
 
-import gtk, gobject
 
-from Pyblio import Connector, Sort, Config, version
+from Pyblio import Connector, Sort, Config
 from Pyblio.GnomeUI import Utils
 
-import cPickle
 
 pickle = cPickle
 del cPickle
diff --git a/Pyblio/GnomeUI/__init__.py b/Pyblio/GnomeUI/__init__.py
index b53be83..31c7d7b 100644
--- a/Pyblio/GnomeUI/__init__.py
+++ b/Pyblio/GnomeUI/__init__.py
@@ -1,49 +1,54 @@
+# -*- coding: utf-8 -*-
+#
 # This file is part of pybliographer
-# 
-# Copyright (C) 1998-2004 Frederic GOBRY
-# Email : gobry pybliographer org
-#         
+#
+# Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer org
+#
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2 
+# as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-#   
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details. 
-# 
+# GNU General Public License for more details.
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-# 
-# 
+#
+#
 
-# Perform the first initialisation of Gnome, so that the options passed to the script
-# are not passed to Gnome
+# Perform the first initialisation of Gnome, so that the options passed to
+# the script are not passed to Gnome
 
-import sys, string
+import sys
+import string
 
-files    = sys.argv [2:]
-sys.argv = sys.argv [:2] + ['--'] + files
 
 # correctly identify the program
 import pygtk
-pygtk.require ('2.0')
+pygtk.require('2.0')
 
 import gtk
 
 from Pyblio import version
 
+files = sys.argv[2:]
+sys.argv = sys.argv[:2] + ['--'] + files
+
+
+def _vnum(t):
+    return string.join(map(str, t), '.')
 
-def _vnum (t):
-    return string.join (map (str, t), '.')
 
 ui_version = _("This is Pybliographic %s [Python %s, Gtk %s, PyGTK %s]") % (
-    version.version, _vnum (sys.version_info [:3]),
-    _vnum (gtk.gtk_version), _vnum (gtk.pygtk_version))
-    
+    version.version, _vnum(sys.version_info[:3]),
+    _vnum(gtk.gtk_version), _vnum(gtk.pygtk_version))
+
 # clean up our garbage
-sys.argv = sys.argv [:2] + files
+sys.argv = sys.argv[:2] + files
 
 del sys, files


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]