Skip to content

Commit

Permalink
Merge pull request #123 from joshmoore/omero_ext.path
Browse files Browse the repository at this point in the history
Move path.py to omero_ext
  • Loading branch information
sbesson authored Nov 26, 2019
2 parents 1ba7db9 + ddd8ad8 commit 5b7dd96
Show file tree
Hide file tree
Showing 37 changed files with 38 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/omero/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import shlex
import errno
from threading import Lock
from path import path
from contextlib import contextmanager
from functools import wraps

Expand All @@ -63,6 +62,7 @@
# Help text
from omero_ext.argparse import RawTextHelpFormatter
from omero_ext.argparse import SUPPRESS
from omero_ext.path import path

from omero.util.concurrency import get_event

Expand Down
2 changes: 1 addition & 1 deletion src/omero/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ def upload(self, filename, name=None, path=None, type=None, ofile=None,
if not os.path.exists(filename):
raise omero.ClientError("File does not exist: " + filename)

from path import path as __path__
from omero_ext.path import path as __path__
filepath = __path__(filename)
file = open(filename, 'rb')
try:
Expand Down
2 changes: 1 addition & 1 deletion src/omero/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from builtins import object, str
import os
import path
import time
import logging

Expand All @@ -33,6 +32,7 @@
from xml.etree.ElementTree import (
XML, Element, ElementTree, SubElement, Comment, tostring
)
import omero_ext.path as path
from omero_ext import portalocker
import json

Expand Down
2 changes: 1 addition & 1 deletion src/omero/gateway/scripts/dbhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
except ImportError:
StringTypes = str

from path import path
from omero_ext.path import path

BASEPATH = os.path.dirname(os.path.abspath(__file__))
TESTIMG_URL = 'https://downloads.openmicroscopy.org/images/gateway_tests/'
Expand Down
2 changes: 1 addition & 1 deletion src/omero/hdfstorageV1.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import traceback

from os import W_OK
from path import path

import omero # Do we need both??
import omero.clients
Expand All @@ -27,6 +26,7 @@
from omero.columns import columns2definition
from omero.rtypes import rfloat, rint, rlong, rstring, unwrap
from omero.util.decorators import locked
from omero_ext.path import path
from omero_ext import portalocker
from functools import wraps

Expand Down
2 changes: 1 addition & 1 deletion src/omero/hdfstorageV2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import traceback

from os import W_OK
from path import path

import omero # Do we need both??
import omero.clients
Expand All @@ -29,6 +28,7 @@
from omero.columns import columns2definition
from omero.rtypes import rfloat, rlong, rstring, unwrap
from omero.util.decorators import locked
from omero_ext.path import path
from omero_ext import portalocker
from functools import wraps

Expand Down
2 changes: 1 addition & 1 deletion src/omero/install/perf_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
import re
import os
import sys
import path
import time
import omero
import logging

import omero.cli
import omero.util
import omero.util.temp_files
import omero_ext.path as path
import uuid

command_pattern = r"^\s*(\w+)(\((.*)\))?(:(.*))?$"
Expand Down
2 changes: 1 addition & 1 deletion src/omero/install/win_set_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from builtins import str
import sys
from path import path
from omero_ext.path import path
import fileinput

dummy = object()
Expand Down
2 changes: 1 addition & 1 deletion src/omero/plugins/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

from glob import glob
from math import ceil
from path import path

import omero
import omero.config
Expand All @@ -50,6 +49,7 @@
from omero.install.windows_warning import windows_warning, WINDOWS_WARNING

from omero_ext import portalocker
from omero_ext.path import path
from omero_ext.which import whichall
from omero_ext.argparse import FileType
from omero_version import ice_compatibility
Expand Down
2 changes: 1 addition & 1 deletion src/omero/plugins/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

from omero.install.windows_warning import windows_warning, WINDOWS_WARNING

from path import path
from omero_ext.path import path

import omero.java
import platform
Expand Down
2 changes: 1 addition & 1 deletion src/omero/plugins/import.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from omero.cli import BaseControl, CLI
import omero.java
from omero_ext.argparse import SUPPRESS
from path import path
from omero_ext.path import path

START_CLASS = "ome.formats.importer.cli.CommandLineImporter"
TEST_CLASS = "ome.formats.test.util.TestEngine"
Expand Down
2 changes: 1 addition & 1 deletion src/omero/plugins/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import sys
import signal
import platform
from path import path
from omero_ext.path import path

from omero.install.windows_warning import windows_warning, WINDOWS_WARNING

Expand Down
2 changes: 1 addition & 1 deletion src/omero/plugins/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import sys
import traceback

from path import path
from omero.cli import CLI
from omero.cli import BaseControl
from omero.cli import ExistingFile
Expand All @@ -31,6 +30,7 @@
from omero.util.upgrade_check import UpgradeCheck
from omero_ext import portalocker
from omero_ext.argparse import SUPPRESS
from omero_ext.path import path

import omero.java

Expand Down
2 changes: 1 addition & 1 deletion src/omero/plugins/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

from omero.util.sessions import SessionsStore

from path import path
from omero_ext.path import path

MIMETYPE = "text/x-python"

Expand Down
2 changes: 1 addition & 1 deletion src/omero/plugins/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def store(self, args):
# Read sessions directory from OMERO_SESSIONDIR envvar
session_dir = None
if base_dir:
from path import path
from omero_ext.path import path
session_dir = path(base_dir) / "omero" / "sessions"
sessions_dir = os.environ.get('OMERO_SESSIONDIR', session_dir)

Expand Down
2 changes: 1 addition & 1 deletion src/omero/plugins/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

import sys
import re
import path
import os
import warnings
import mimetypes

from omero.cli import BaseControl, CLI
import omero_ext.path as path

try:
import hashlib
Expand Down
2 changes: 1 addition & 1 deletion src/omero/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import uuid
from omero_ext import killableprocess as subprocess

from path import path

import Ice
import omero
Expand All @@ -31,6 +30,7 @@
from omero.util.temp_files import create_path, remove_path
from omero.util.decorators import remoted, perf, locked, wraps
from omero.rtypes import rint, rlong
from omero_ext.path import path

sys = __import__("sys")

Expand Down
2 changes: 1 addition & 1 deletion src/omero/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def parse_file(filename):
WARNING: This method calls "exec" on the given file's contents.
Do NOT use this on data you don't trust.
"""
from path import path
from omero_ext.path import path
scriptText = path(filename).text()
return parse_text(scriptText)

Expand Down
3 changes: 1 addition & 2 deletions src/omero/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
import time
import traceback

from path import path

import omero # Do we need both??
import omero.clients
import omero.callbacks
from omero_ext.path import path

# For ease of use
from omero import LockTimeout
Expand Down
2 changes: 1 addition & 1 deletion src/omero/testlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
from omero.rtypes import rbool, rstring, rlong, rtime, rint, unwrap
from omero.sys import ParametersI
from omero.util.temp_files import create_path
from path import path
from omero_ext.path import path

import hashlib

Expand Down
2 changes: 1 addition & 1 deletion src/omero/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import os
import sys
import Ice
import path
import shlex
import omero
import IcePy
Expand All @@ -30,6 +29,7 @@
import omero.ObjectFactoryRegistrar as ofr

from omero.util.decorators import locked
import omero_ext.path as path

LOGDIR = os.path.join("var", "log")
LOGFORMAT = "%(asctime)s %(levelname)-5.5s [%(name)40s] " \
Expand Down
2 changes: 1 addition & 1 deletion src/omero/util/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import omero.constants
from omero.util import get_omero_userdir, make_logname
from omero.rtypes import rlong
from path import path
from omero_ext.path import path

try:
from urllib.parse import quote, unquote
Expand Down
2 changes: 1 addition & 1 deletion src/omero/util/temp_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import logging
import tempfile

from path import path
from omero.util import get_omero_userdir, get_user
from omero_ext import portalocker
from omero_ext.path import path

# Activating logging at a static level
if "DEBUG" in os.environ:
Expand Down
2 changes: 1 addition & 1 deletion src/path.py → src/omero_ext/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Example::
from path import path
from omero_ext.path import path
d = path('/home/guido/bin')
for f in d.files('*.py'):
f.chmod(0755)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/clitest/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import sys
import pytest

from path import path
from glob import glob

import omero
Expand All @@ -32,6 +31,7 @@
from omero.cli import CLI, NonZeroReturnCode
from omero.plugins.admin import AdminControl
from omero.plugins.prefs import PrefsControl
from omero_ext.path import path

from mocks import MockCLI

Expand Down
2 changes: 1 addition & 1 deletion test/unit/clitest/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from builtins import object
import pytest
import os
from path import path
from omero_ext.path import path
from omero.plugins.db import DatabaseControl
from omero.util.temp_files import create_path
from omero.cli import NonZeroReturnCode
Expand Down
2 changes: 1 addition & 1 deletion test/unit/clitest/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from builtins import object
from past.utils import old_div
import os
from path import path
from omero_ext.path import path
from omero.cli import CLI, NonZeroReturnCode
from omero.plugins.export import ExportControl
from omero.util.temp_files import create_path
Expand Down
2 changes: 1 addition & 1 deletion test/unit/clitest/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from past.utils import old_div
import os
import pytest
from path import path
from omero_ext.path import path
import omero.clients
import uuid
from omero.cli import CLI, NonZeroReturnCode
Expand Down
2 changes: 1 addition & 1 deletion test/unit/clitest/test_rcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from builtins import object
from past.utils import old_div
import os
from path import path
from omero_ext.path import path
from omero.cli import BaseControl, CLI

omeroDir = old_div(path(os.getcwd()), "build")
Expand Down
2 changes: 1 addition & 1 deletion test/unit/clitest/test_sess.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import Glacier2
import uuid

from path import path
from omero_ext.path import path
from omero.cli import CLI, NonZeroReturnCode
from omero.util import get_user
from omero.util.sessions import SessionsStore
Expand Down
4 changes: 2 additions & 2 deletions test/unit/clitest/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def testSubcommandHelp(self, subcommand):

def testDefaultSessionsDir(self):
from omero.util import get_user_dir
from path import path
from omero_ext.path import path

# Default store sessions dir is under user dir
store = self.cli.controls['sessions'].store(None)
Expand Down Expand Up @@ -86,7 +86,7 @@ def testCustomSessionsDir(
session_args):
from argparse import Namespace
from omero.util import get_user_dir
from path import path
from omero_ext.path import path

for var in list(environment.keys()):
if environment[var]:
Expand Down
2 changes: 1 addition & 1 deletion test/unit/scriptstest/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from builtins import object
import pytest

from path import path
from omero_ext.path import path

import omero

Expand Down
2 changes: 1 addition & 1 deletion test/unit/tablestest/test_hdfstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from omero.rtypes import rint, rstring

from library import TestCase
from path import path
from omero_ext.path import path


if hasattr(tables, "open_file"):
Expand Down
2 changes: 1 addition & 1 deletion test/unit/tablestest/test_servants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from library import TestCase

from omero.columns import LongColumnI, DoubleColumnI, ObjectFactories
from path import path
from omero_ext.path import path

logging.basicConfig(level=logging.DEBUG)

Expand Down
Loading

0 comments on commit 5b7dd96

Please sign in to comment.