From 33c0ba808cd86f1271c03079968c019be6022f5a Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 11 Jan 2011 11:59:53 +0100 Subject: [PATCH] Changed references to what has already been moved from hsutil to hscommon (io, path, testutil). --- core/app.py | 5 +++-- core/directories.py | 4 ++-- core/fs.py | 7 ++----- core/scanner.py | 4 ++-- core/tests/app_test.py | 4 ++-- core/tests/directories_test.py | 4 ++-- core/tests/engine_test.py | 2 +- core/tests/ignore_test.py | 2 +- core/tests/results_test.py | 2 +- core/tests/scanner_test.py | 4 ++-- core_me/tests/scanner_test.py | 4 ++-- core_pe/app_cocoa.py | 4 ++-- core_pe/tests/block_test.py | 2 +- core_pe/tests/cache_test.py | 2 +- core_se/app_cocoa.py | 6 ++---- core_se/fs.py | 2 +- 16 files changed, 27 insertions(+), 31 deletions(-) diff --git a/core/app.py b/core/app.py index dba4bfad..3da9c31c 100644 --- a/core/app.py +++ b/core/app.py @@ -13,10 +13,11 @@ import subprocess import re from send2trash import send2trash +from hscommon import io from hscommon.reg import RegistrableApplication from hscommon.notify import Broadcaster -from hsutil import io, files -from hsutil.path import Path +from hscommon.path import Path +from hsutil import files from hsutil.misc import flatten, first from hsutil.str import escape diff --git a/core/directories.py b/core/directories.py index fc2ddce8..697b863c 100644 --- a/core/directories.py +++ b/core/directories.py @@ -8,9 +8,9 @@ from xml.etree import ElementTree as ET -from hsutil import io +from hscommon import io +from hscommon.path import Path from hsutil.files import FileOrPath -from hsutil.path import Path from . import fs diff --git a/core/fs.py b/core/fs.py index 6fa48980..5457d6ab 100644 --- a/core/fs.py +++ b/core/fs.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Created By: Virgil Dupras # Created On: 2009-10-22 # Copyright 2010 Hardcoded Software (http://www.hardcoded.net) @@ -12,12 +11,10 @@ # resulting needless complexity and memory usage. It's been a while since I wanted to do that fork, # and I'm doing it now. - - import hashlib import logging -from hsutil import io +from hscommon import io from hsutil.misc import nonone, flatten from hsutil.str import get_file_ext @@ -52,7 +49,7 @@ class OperationError(FSError): operation shows that it didn't work.""" cls_message = "Operation on '{name}' failed." -class File(object): +class File: INITIAL_INFO = { 'size': 0, 'mtime': 0, diff --git a/core/scanner.py b/core/scanner.py index 8618c610..b0127849 100644 --- a/core/scanner.py +++ b/core/scanner.py @@ -10,7 +10,7 @@ import logging import re from jobprogress import job -from hsutil import io +from hscommon import io from hsutil.misc import dedupe from hsutil.str import get_file_ext, rem_file_ext @@ -37,7 +37,7 @@ def is_same_with_digit(name, refname): end = name[len(refname):].strip() return RE_DIGIT_ENDING.match(end) is not None -class Scanner(object): +class Scanner: def __init__(self): self.ignore_list = IgnoreList() self.discarded_file_count = 0 diff --git a/core/tests/app_test.py b/core/tests/app_test.py index e04a673d..dcd16eb0 100644 --- a/core/tests/app_test.py +++ b/core/tests/app_test.py @@ -11,8 +11,8 @@ import os.path as op import logging from pytest import mark -from hsutil import io -from hsutil.path import Path +from hscommon import io +from hscommon.path import Path from hsutil.decorators import log_calls import hsutil.files from hscommon.testutil import CallLogger, eq_ diff --git a/core/tests/directories_test.py b/core/tests/directories_test.py index 25eb42f7..c7ec5601 100644 --- a/core/tests/directories_test.py +++ b/core/tests/directories_test.py @@ -12,8 +12,8 @@ import tempfile import shutil from pytest import raises -from hsutil import io -from hsutil.path import Path +from hscommon import io +from hscommon.path import Path from hscommon.testutil import eq_ from ..directories import * diff --git a/core/tests/engine_test.py b/core/tests/engine_test.py index 6afbc912..61af1bbe 100644 --- a/core/tests/engine_test.py +++ b/core/tests/engine_test.py @@ -11,7 +11,7 @@ import sys from jobprogress import job from hsutil.decorators import log_calls from hsutil.misc import first -from hsutil.testutil import eq_ +from hscommon.testutil import eq_ from .. import engine from ..engine import * diff --git a/core/tests/ignore_test.py b/core/tests/ignore_test.py index 62907c4a..04affca9 100644 --- a/core/tests/ignore_test.py +++ b/core/tests/ignore_test.py @@ -9,7 +9,7 @@ import io from xml.etree import ElementTree as ET -from hsutil.testutil import eq_ +from hscommon.testutil import eq_ from ..ignore import * diff --git a/core/tests/results_test.py b/core/tests/results_test.py index df2c32bd..c31e3697 100644 --- a/core/tests/results_test.py +++ b/core/tests/results_test.py @@ -12,7 +12,7 @@ import os.path as op from xml.etree import ElementTree as ET -from hsutil.path import Path +from hscommon.path import Path from hscommon.testutil import eq_ from hsutil.misc import first diff --git a/core/tests/scanner_test.py b/core/tests/scanner_test.py index 34c8d67f..ace67e70 100644 --- a/core/tests/scanner_test.py +++ b/core/tests/scanner_test.py @@ -7,8 +7,8 @@ # http://www.hardcoded.net/licenses/bsd_license from jobprogress import job -from hsutil import io -from hsutil.path import Path +from hscommon import io +from hscommon.path import Path from hscommon.testutil import eq_ from .. import fs diff --git a/core_me/tests/scanner_test.py b/core_me/tests/scanner_test.py index cb414cf4..07cfae5d 100644 --- a/core_me/tests/scanner_test.py +++ b/core_me/tests/scanner_test.py @@ -7,8 +7,8 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license -from hsutil import io -from hsutil.path import Path +from hscommon import io +from hscommon.path import Path from core.engine import getwords from ..scanner import * diff --git a/core_pe/app_cocoa.py b/core_pe/app_cocoa.py index 2ed1c991..23959e4e 100644 --- a/core_pe/app_cocoa.py +++ b/core_pe/app_cocoa.py @@ -13,9 +13,9 @@ import re from appscript import app, k, CommandError, ApplicationNotFoundError -from hsutil import io +from hscommon import io from hsutil.str import get_file_ext, remove_invalid_xml -from hsutil.path import Path +from hscommon.path import Path from hscommon.cocoa import as_fetch from hscommon.cocoa.objcmin import NSUserDefaults, NSURL diff --git a/core_pe/tests/block_test.py b/core_pe/tests/block_test.py index 92c3f776..210c1906 100644 --- a/core_pe/tests/block_test.py +++ b/core_pe/tests/block_test.py @@ -8,7 +8,7 @@ # The commented out tests are tests for function that have been converted to pure C for speed from pytest import raises, skip -from hsutil.testutil import eq_ +from hscommon.testutil import eq_ try: from ..block import * diff --git a/core_pe/tests/cache_test.py b/core_pe/tests/cache_test.py index 849043ba..2a7d57b4 100644 --- a/core_pe/tests/cache_test.py +++ b/core_pe/tests/cache_test.py @@ -9,7 +9,7 @@ import logging from pytest import raises, skip -from hsutil.testutil import eq_ +from hscommon.testutil import eq_ try: from ..cache import Cache, colors_to_string, string_to_colors diff --git a/core_se/app_cocoa.py b/core_se/app_cocoa.py index bc3f2073..803a34ae 100644 --- a/core_se/app_cocoa.py +++ b/core_se/app_cocoa.py @@ -6,12 +6,10 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license - - import logging -from hsutil import io -from hsutil.path import Path +from hscommon import io +from hscommon.path import Path from hscommon.cocoa.objcmin import NSWorkspace from core import fs diff --git a/core_se/fs.py b/core_se/fs.py index f5331a91..5f3635f2 100644 --- a/core_se/fs.py +++ b/core_se/fs.py @@ -9,7 +9,7 @@ import hashlib -from hsutil import io +from hscommon import io from hsutil.misc import nonone from core import fs