Skip to content

Commit

Permalink
Remove all unnecessary builtins imports
Browse files Browse the repository at this point in the history
  • Loading branch information
sbesson committed Jan 20, 2024
1 parent 80adbba commit 77dc7a5
Show file tree
Hide file tree
Showing 121 changed files with 5 additions and 242 deletions.
3 changes: 1 addition & 2 deletions examples/projection_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
# @param method the method of projecting (maximum, average)
# @return new pixels object containing the projection.
#
from builtins import range
from builtins import object

import sys
import omero
import omero.cli
Expand Down
2 changes: 0 additions & 2 deletions manualtests/populate_roi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#


from builtins import range
from builtins import object
import unittest
import os

Expand Down
1 change: 0 additions & 1 deletion src/omero/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
module for backwards compatibility.
"""

from builtins import str
import Ice
import logging
import threading
Expand Down
7 changes: 1 addition & 6 deletions src/omero/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@
``cmd.Cmd.cmdloop`` method.
"""

from builtins import zip
from builtins import input
from builtins import map
from builtins import str
from builtins import range
from builtins import object

sys = __import__("sys")
cmd = __import__("cmd")

Expand Down
3 changes: 0 additions & 3 deletions src/omero/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
#
#

from builtins import zip
from builtins import range
from builtins import object
__save__ = __name__
__name__ = 'omero'
try:
Expand Down
3 changes: 0 additions & 3 deletions src/omero/columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
to PyTables types.
"""

from builtins import zip
from builtins import range
from builtins import object
import omero
import Ice
import IceImport
Expand Down
1 change: 0 additions & 1 deletion src/omero/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
see ticket:2213 - Replacing Java Preferences API
"""

from builtins import object, str
import os
import time
import logging
Expand Down
2 changes: 0 additions & 2 deletions src/omero/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
Conversion utilities for changing between units.
"""

from builtins import str
from builtins import object
class Conversion(object):
"""
Base-functor like object which can be used for preparing complex
Expand Down
5 changes: 0 additions & 5 deletions src/omero/gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
# [email protected].

# Set up the python include paths
from builtins import chr
from builtins import map
from builtins import str
from builtins import range
from builtins import object
import os

import warnings
Expand Down
3 changes: 1 addition & 2 deletions src/omero/gateway/scripts/dbhelpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from builtins import str
from builtins import object

import sys
sys.path.append('.')

Expand Down
3 changes: 0 additions & 3 deletions src/omero/gateway/scripts/testdb_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
Library for gateway tests
"""

from builtins import str
from builtins import range
from builtins import object
from io import StringIO
from io import BytesIO
import omero
Expand Down
2 changes: 0 additions & 2 deletions src/omero/gateway/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
# Version: 1.0
#

from builtins import str
from builtins import object
import logging
import json

Expand Down
5 changes: 1 addition & 4 deletions src/omero/hdfstorageV2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"""
OMERO HdfStorage Interface
"""
from builtins import str
from builtins import zip
from builtins import range
from builtins import object

import time
import numpy
import logging
Expand Down
2 changes: 0 additions & 2 deletions src/omero/install/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
mark up.
"""

from builtins import str
from builtins import object
class Header(object):
def __init__(self, name, reference=None, description=""):
"""Initialize new configuration property"""
Expand Down
3 changes: 0 additions & 3 deletions src/omero/install/jvmcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
Automatic configuration of memory settings for Java servers.
"""

from builtins import str
from builtins import range
from builtins import object
from shlex import split

import logging
Expand Down
1 change: 0 additions & 1 deletion src/omero/install/logs_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
omero.util.configure_logging.
"""

from builtins import object
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as lines
Expand Down
3 changes: 0 additions & 3 deletions src/omero/install/perf_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# Add: plotting
#

from builtins import str
from builtins import range
from builtins import object
import re
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion src/omero/install/win_set_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
are not supported.
"""

from builtins import str
import sys
from omero_ext.path import path
import fileinput
Expand Down
3 changes: 0 additions & 3 deletions src/omero/plugins/_metadata_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
Metadata plugin
"""

from builtins import str
from builtins import range
from builtins import object
import logging
import mimetypes
import os
Expand Down
2 changes: 0 additions & 2 deletions src/omero/plugins/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
and various other tools needed for administration.
"""

from builtins import str
from builtins import object
import re
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion src/omero/plugins/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
defined here will be added to the Cli class for later use.
"""

from builtins import str
import sys
import omero
import os
Expand Down
1 change: 0 additions & 1 deletion src/omero/plugins/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Startup plugin for command-line exporter
"""

from builtins import str
import os
import sys

Expand Down
4 changes: 0 additions & 4 deletions src/omero/plugins/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
fs plugin for querying repositories, filesets, and the like.
"""

from builtins import zip
from builtins import str
from builtins import map
from builtins import object
import platform
import sys

Expand Down
1 change: 0 additions & 1 deletion src/omero/plugins/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Group administration plugin
"""

from builtins import str
import sys

from omero.cli import UserGroupControl, CLI, ExceptionHandler, admin_only
Expand Down
2 changes: 0 additions & 2 deletions src/omero/plugins/hql.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
defined here will be added to the Cli class for later use.
"""

from builtins import str
from builtins import range
from omero.cli import BaseControl, CLI
import time
import sys
Expand Down
2 changes: 0 additions & 2 deletions src/omero/plugins/import.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
"""

from builtins import str
from builtins import object
from io import BytesIO
import os
import csv
Expand Down
1 change: 0 additions & 1 deletion src/omero/plugins/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
User administration plugin (LDAP extension)
"""

from builtins import str
import sys

from omero.cli import CLI, ExceptionHandler, admin_only, UserGroupControl
Expand Down
1 change: 0 additions & 1 deletion src/omero/plugins/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
This is a python wrapper around icegridnode.
"""

from builtins import str
from omero.cli import BaseControl, CLI, NonZeroReturnCode
from omero.util import tail_lines
import os
Expand Down
2 changes: 0 additions & 2 deletions src/omero/plugins/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
"""


from builtins import str
from builtins import object
import re
import sys
import shlex
Expand Down
2 changes: 0 additions & 2 deletions src/omero/plugins/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
The pref plugin makes use of prefs.class from the common component.
"""

from builtins import zip
from builtins import str
import sys
import traceback
import os
Expand Down
2 changes: 0 additions & 2 deletions src/omero/plugins/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
on a given platform i.e. invokable by subprocess.call([file,...])
"""

from builtins import str
from builtins import object
import re
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion src/omero/plugins/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""


from builtins import str
import sys
import time

Expand Down
1 change: 0 additions & 1 deletion src/omero/plugins/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
defined here will be added to the Cli class for later use.
"""

from builtins import str
import datetime
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion src/omero/plugins/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
defined here will be added to the Cli class for later use.
"""

from builtins import str
from omero.cli import BaseControl, CLI
import sys

Expand Down
7 changes: 1 addition & 6 deletions src/omero/plugins/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
Tag plugin for command-line tag manipulation
"""

from builtins import input
from builtins import map
from builtins import str
from builtins import object
import builtins
import platform
import subprocess
import sys
Expand Down Expand Up @@ -517,7 +512,7 @@ def create_tag(self, name, description, text="tag"):
(the default). If we were creating a tagset, this could be "tag set".
"""
if name is None:
name = builtins.input("Please enter a name for this %s: " % text)
name = input("Please enter a name for this %s: " % text)

if name is not None and name != '':
tag = TagAnnotationI()
Expand Down
3 changes: 0 additions & 3 deletions src/omero/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
OMERO Grid Processor
"""

from builtins import str
from builtins import range
from builtins import object
import os
import time
import signal
Expand Down
1 change: 0 additions & 1 deletion src/omero/rtypes.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
omero.rtypes as well as the omero/rtypes.{h,cpp} files.
"""

from builtins import str
import omero
import Ice
import IceImport
Expand Down
2 changes: 0 additions & 2 deletions src/omero/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"""
OMERO Grid Processor
"""
from builtins import str
from builtins import range
import Ice
import time
import traceback
Expand Down
3 changes: 0 additions & 3 deletions src/omero/testlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
"""

from builtins import str
from builtins import range
from builtins import object
import os
import platform
import locale
Expand Down
1 change: 0 additions & 1 deletion src/omero/testlib/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


from builtins import object
import pytest

import omero
Expand Down
2 changes: 0 additions & 2 deletions src/omero/util/OmeroPopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# @author Donald MacDonald     
# <a href="mailto:[email protected]">[email protected]</a>

from builtins import range
from builtins import object
import math
import numpy

Expand Down
1 change: 0 additions & 1 deletion src/omero/util/ROIDrawingUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"""


from builtins import object
try:
from PIL import Image, ImageDraw # see ticket:2597
except ImportError:
Expand Down
Loading

0 comments on commit 77dc7a5

Please sign in to comment.