]> arthur.barton.de Git - bup.git/commitdiff
Don't import * from helpers
authorRob Browning <rlb@defaultvalue.org>
Sun, 17 Jan 2016 16:11:22 +0000 (10:11 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 17 Jan 2016 16:47:29 +0000 (10:47 -0600)
So we're not pulling access to random other namespaces through helpers
(like errno, subprocess, etc.), and so it's obvious what's coming from
where.

Thanks to Greg Troxel for help evaluating the changes.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
37 files changed:
cmd/bloom-cmd.py
cmd/cat-file-cmd.py
cmd/damage-cmd.py
cmd/drecurse-cmd.py
cmd/fsck-cmd.py
cmd/ftp-cmd.py
cmd/fuse-cmd.py
cmd/index-cmd.py
cmd/init-cmd.py
cmd/join-cmd.py
cmd/list-idx-cmd.py
cmd/ls-cmd.py
cmd/margin-cmd.py
cmd/memtest-cmd.py
cmd/midx-cmd.py
cmd/mux-cmd.py
cmd/on-cmd.py
cmd/random-cmd.py
cmd/restore-cmd.py
cmd/save-cmd.py
cmd/server-cmd.py
cmd/split-cmd.py
cmd/tag-cmd.py
cmd/web-cmd.py
lib/bup/bloom.py
lib/bup/client.py
lib/bup/drecurse.py
lib/bup/git.py
lib/bup/index.py
lib/bup/ls.py
lib/bup/midx.py
lib/bup/t/tbloom.py
lib/bup/t/tgit.py
lib/bup/t/thelpers.py
lib/bup/t/tindex.py
lib/bup/vfs.py
main.py

index b2f909bd0d9b7fb8d7cb248b540b2cef190676bb..f968fa02e398fab2b55e85a62af30deb9435e7aa 100755 (executable)
@@ -4,9 +4,12 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
-import sys, glob, tempfile
+
+import glob, os, sys, tempfile
+
 from bup import options, git, bloom
-from bup.helpers import *
+from bup.helpers import (debug1, handle_ctrl_c, log, progress, qprogress,
+                         saved_errors)
 
 optspec = """
 bup bloom [options...]
index d8a3dc559cc553e6f11abf3d9067a383d50786c5..3247e4ff2dbd154a30741306c5c33a4583bfaf7d 100755 (executable)
@@ -4,9 +4,11 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
-import sys, stat
+
+import re, stat, sys
+
 from bup import options, git, vfs
-from bup.helpers import *
+from bup.helpers import chunkyreader, handle_ctrl_c, log, saved_errors
 
 optspec = """
 bup cat-file [--meta|--bupm] /branch/revision/[path]
index 22bc8f094c3eae3a95f4ccd8a339fc449f2426dd..669148ad565a17ec9c5da168459bb8d4d72eec56 100755 (executable)
@@ -4,9 +4,11 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys, os, random
+
 from bup import options
-from bup.helpers import *
+from bup.helpers import log
 
 
 def randblock(n):
index 611bfdbb3e89bdc3d93d9900fc3b38fc5cb6343d..bc537cbd96044c155d915212a353d7fbb81aa252 100755 (executable)
@@ -6,8 +6,11 @@ exec "$bup_python" "$0" ${1+"$@"}
 # end of bup preamble
 
 from os.path import relpath
+import sys
+
 from bup import options, drecurse
-from bup.helpers import *
+from bup.helpers import log, parse_excludes, parse_rx_excludes, saved_errors
+
 
 optspec = """
 bup drecurse <path>
index 94eeb89f4ae52bb429a725a2d28fb080a59fb581..8c4d0b7e842f8431a6d5315e2d802dcafede4691 100755 (executable)
@@ -4,9 +4,11 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys, os, glob, subprocess
+
 from bup import options, git
-from bup.helpers import *
+from bup.helpers import Sha1, chunkyreader, istty2, log, progress
 
 par2_ok = 0
 nullf = open('/dev/null')
@@ -77,7 +79,7 @@ def git_verify(base):
         try:
             quick_verify(base)
         except Exception as e:
-            debug('error: %s\n' % e)
+            log('error: %s\n' % e)
             return 1
         return 0
     else:
index 908932bfd49e9b3ac600153fcd1ad8adb5b15e6f..44fe68ca58142a5b1abadbd9880527334f796353 100755 (executable)
@@ -4,9 +4,12 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys, os, stat, fnmatch
+
 from bup import options, git, shquote, vfs, ls
-from bup.helpers import *
+from bup.helpers import chunkyreader, handle_ctrl_c, log
+
 
 handle_ctrl_c()
 
index 3708692975dc9be8dc55675d28268180b98b67ae..df9bf56fa399739cf9a70c3fe6216e1197ba9448 100755 (executable)
@@ -4,9 +4,12 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys, os, errno
+
 from bup import options, git, vfs, xstat
-from bup.helpers import *
+from bup.helpers import log
+
 try:
     import fuse
 except ImportError:
index 73ef55820b5dd95e56e8b7245aea27868d140e14..8390452223afd8b82bb4f09a8fdf1ae805e8ea3d 100755 (executable)
@@ -6,9 +6,12 @@ exec "$bup_python" "$0" ${1+"$@"}
 # end of bup preamble
 
 import sys, stat, time, os, errno, re
+
 from bup import metadata, options, git, index, drecurse, hlinkdb
-from bup.helpers import *
 from bup.hashsplit import GIT_MODE_TREE, GIT_MODE_FILE
+from bup.helpers import (handle_ctrl_c, log, parse_excludes, parse_rx_excludes,
+                         progress, qprogress, saved_errors)
+
 
 class IterHelper:
     def __init__(self, l):
index fabd98c2d1711affba816b7742f3ff3ca30c93db..f2c0052bd5fd0d16811d8d809f52e8819c2c85a4 100755 (executable)
@@ -4,10 +4,11 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys
 
 from bup import git, options, client
-from bup.helpers import *
+from bup.helpers import log, saved_errors
 
 
 optspec = """
index 8ad322d151d6ad3565eef38fd8c23753aa7e837b..33935d2ad85d997cc8ded8f7faebc22458b88ff9 100755 (executable)
@@ -4,9 +4,11 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys
+
 from bup import git, options, client
-from bup.helpers import *
+from bup.helpers import linereader, log
 
 
 optspec = """
index 3bab6b3fc3fee580df45cc57b97dcfec5a833119..0d5e9aca04a3dc0ffa4f7e0984b7434f4a7edf04 100755 (executable)
@@ -4,9 +4,12 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys, os
+
 from bup import git, options
-from bup.helpers import *
+from bup.helpers import handle_ctrl_c, log, qprogress, saved_errors
+
 
 optspec = """
 bup list-idx [--find=<prefix>] <idxfilenames...>
index 031fbaefd7aba78339df53162d66b1773c8ce11d..377d2756958e829aba92b727a5b097c7ab068f57 100755 (executable)
@@ -4,9 +4,10 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys
+
 from bup import git, vfs, ls
-from bup.helpers import *
 
 
 git.check_repo_or_die()
index ac25ed0644a9049d76d259572890ac7262b6e638..ca502b90cd9768fbb95815b7a25e903e6b759c6a 100755 (executable)
@@ -4,9 +4,11 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys, struct, math
+
 from bup import options, git, _helpers
-from bup.helpers import *
+from bup.helpers import log
 
 POPULATION_OF_EARTH=6.7e9  # as of September, 2010
 
index 245bfc99fb89ff4ecb95c0932032a537ceba8c63..c4c531e22928c5c95cf03f6d75adaa3a7edd1c96 100755 (executable)
@@ -4,12 +4,16 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys, re, struct, time, resource
+
 from bup import git, bloom, midx, options, _helpers
-from bup.helpers import *
+from bup.helpers import handle_ctrl_c
+
 
 handle_ctrl_c()
 
+
 _linux_warned = 0
 def linux_memstat():
     global _linux_warned
index d867ad6064f72ffd2484a59c1bffdf10ef463fbf..1879550b7c9fdb5f463ad9b957599fc45cd06bd8 100755 (executable)
@@ -4,10 +4,14 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
-import sys, math, struct, glob, resource
-import tempfile
+
+import glob, math, os, resource, struct, sys, tempfile
+
 from bup import options, git, midx, _helpers, xstat
-from bup.helpers import *
+from bup.helpers import (Sha1, atomically_replaced_file, debug1, fdatasync,
+                         handle_ctrl_c, log, mmap_readwrite, qprogress,
+                         saved_errors, unlink)
+
 
 PAGE_SIZE=4096
 SHA_PER_PAGE=PAGE_SIZE/20.
index 7a8a9eac1a9ea950abf350e87b32b0de86363346..b7a6db12882d39c648749879842e0d1375ebaaff 100755 (executable)
@@ -4,9 +4,12 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import os, sys, subprocess, struct
+
 from bup import options
-from bup.helpers import *
+from bup.helpers import debug1, debug2, mux
+
 
 # Give the subcommand exclusive access to stdin.
 orig_stdin = os.dup(0)
index f76ad3e1e06a71fd07de06db586f1827d92d1a97..10b1e3f249710aae44fae64faa4af83a81624bd6 100755 (executable)
@@ -4,10 +4,13 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import sys, os, struct, getopt, subprocess, signal
+
 from subprocess import PIPE
 from bup import options, ssh, path
-from bup.helpers import *
+from bup.helpers import DemuxConn, log
+
 
 optspec = """
 bup on <hostname> index ...
index 7d4c007611334c64b7ae61425839745f0cea5d69..868c3afd3fcebf2a775bc7e5e5a0b63dfd31239b 100755 (executable)
@@ -4,9 +4,12 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
-import sys
+
+import os, sys
+
 from bup import options, _helpers
-from bup.helpers import *
+from bup.helpers import atoi, handle_ctrl_c, log, parse_num
+
 
 optspec = """
 bup random [-S seed] <numbytes>
index afcc3a444940e266a4312744f1336b043e9be64b..d1ff9b59890eb7f6620d37e43e17e6903901b19c 100755 (executable)
@@ -4,10 +4,15 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
-import copy, errno, sys, stat, re
+
+import copy, errno, os, sys, stat, re
+
 from bup import options, git, metadata, vfs
-from bup.helpers import *
 from bup._helpers import write_sparsely
+from bup.helpers import (chunkyreader, handle_ctrl_c, log, mkdirp,
+                         parse_rx_excludes, progress, qprogress, saved_errors,
+                         should_rx_exclude_path, unlink)
+
 
 optspec = """
 bup restore [-C outdir] </branch/revision/path/to/dir ...>
index 961d7f3fa171797917a424ffe32ccc8de68b2dd5..4fa6dcae1981532311953c0577386ab5e0a9901a 100755 (executable)
@@ -4,13 +4,17 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
-import sys, stat, time, math
+
 from errno import EACCES
 from io import BytesIO
+import os, sys, stat, time, math
 
 from bup import hashsplit, git, options, index, client, metadata, hlinkdb
-from bup.helpers import *
 from bup.hashsplit import GIT_MODE_TREE, GIT_MODE_FILE, GIT_MODE_SYMLINK
+from bup.helpers import (add_error, grafted_path_components, handle_ctrl_c,
+                         istty2, log, parse_date_or_fatal, parse_num,
+                         path_components, progress, qprogress, resolve_parent,
+                         saved_errors, stripped_path_components)
 
 
 optspec = """
index 520ea649585ab63d3318fd86fd290848c4072e41..0de6694f5f58d375cabcdc0f2a1d0a399a100aec 100755 (executable)
@@ -4,9 +4,12 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import os, sys, struct
+
 from bup import options, git
-from bup.helpers import *
+from bup.helpers import Conn, debug1, debug2, linereader, log
+
 
 suspended_w = None
 dumb_server_mode = False
index 2ad5721853eff6530102b45dca8e13fc258064c5..abf37371973744d4f1b7f433153d2e40655e2b18 100755 (executable)
@@ -4,9 +4,12 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
 import os, sys, time
+
 from bup import hashsplit, git, options, client
-from bup.helpers import *
+from bup.helpers import (handle_ctrl_c, log, parse_num, qprogress, reprogress,
+                         saved_errors)
 
 
 optspec = """
index f065904d78397c3c66e34a988f2bf560b866f621..492c3baad833631f7248553be60d1e48ea427f16 100755 (executable)
@@ -5,11 +5,10 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
-import sys
-import os
+import os, sys
 
 from bup import git, options
-from bup.helpers import *
+from bup.helpers import debug1, handle_ctrl_c, log
 
 # FIXME: review for safe writes.
 
index 640e4ae8de3126983b414602b7d3504e5020aad0..9d5d8a1445b0d0454da06c636e7e27e785006899 100755 (executable)
@@ -4,10 +4,12 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
-import sys, stat, urllib, mimetypes, posixpath, time, webbrowser
-import urllib
+
+import mimetypes, os, posixpath, stat, sys, time, urllib, webbrowser
+
 from bup import options, git, vfs
-from bup.helpers import *
+from bup.helpers import debug1, handle_ctrl_c, log, resource_path
+
 try:
     import tornado.httpserver
     import tornado.ioloop
@@ -16,6 +18,7 @@ except ImportError:
     log('error: cannot find the python "tornado" module; please install it\n')
     sys.exit(1)
 
+
 handle_ctrl_c()
 
 
index c90a1fdf40bd812bea35d3ee2d7e28e22a9fc499..ef896f564027158523594ff71728d51f20c64ee0 100644 (file)
@@ -79,9 +79,13 @@ None of this tells us what max_pfalse_positive to choose.
 
 Brandon Low <lostlogic@lostlogicx.com> 2011-02-04
 """
-import sys, os, math, mmap
+
+import sys, os, math, mmap, struct
+
 from bup import _helpers
-from bup.helpers import *
+from bup.helpers import (debug1, debug2, log, mmap_read, mmap_readwrite,
+                         mmap_readwrite_private)
+
 
 BLOOM_VERSION = 2
 MAX_BITS_EACH = 32 # Kinda arbitrary, but 4 bytes per entry is pretty big
index d819e701f77629e2609399c1509d023babf9ec1f..a57254b961e59315a45229248ec46a4f487510b1 100644 (file)
@@ -1,6 +1,10 @@
-import re, struct, errno, time, zlib
+
+import errno, os, re, struct, time, zlib
+
 from bup import git, ssh
-from bup.helpers import *
+from bup.helpers import (Conn, atomically_replaced_file, chunkyreader, debug1,
+                         debug2, linereader, mkdirp, progress, qprogress)
+
 
 bwlimit = None
 
index 90b7f26de4bf6316230c68ed49304a5d73e8c927..37e189adfd56d04ab1073dca82886442bc35729e 100644 (file)
@@ -1,7 +1,10 @@
+
 import stat, os
-from bup.helpers import *
+
+from bup.helpers import should_rx_exclude_path, debug1
 import bup.xstat as xstat
 
+
 try:
     O_LARGEFILE = os.O_LARGEFILE
 except AttributeError:
index a79b9bd9f8f676fe05e3befdf18ce33162dba775..fd0f3c92799393b1121228a6fbd6ebed064b2c43 100644 (file)
@@ -2,12 +2,17 @@
 bup repositories are in Git format. This library allows us to
 interact with the Git data structures.
 """
-import os, sys, zlib, time, subprocess, struct, stat, re, tempfile, glob
+
+import errno, os, sys, zlib, time, subprocess, struct, stat, re, tempfile, glob
 from collections import namedtuple
 from itertools import islice
 
-from bup.helpers import *
 from bup import _helpers, path, midx, bloom, xstat
+from bup.helpers import (Sha1, add_error, chunkyreader, debug1, debug2,
+                         hostname, log, merge_iter, mmap_read, mmap_readwrite,
+                         progress, qprogress, unlink, username, userfullname,
+                         utc_offset_str)
+
 
 max_pack_size = 1000*1000*1000  # larger packs will slow down pruning
 max_pack_objects = 200*1000  # cache memory usage is about 83 bytes per object
index d4dbc55f7a54e4a623fbae5c2eeaa8cd9974e343..0829764824b0cea02cd44972ac154d403d6b71da 100644 (file)
@@ -1,6 +1,9 @@
-import metadata, os, stat, struct, tempfile
+import errno, metadata, os, stat, struct, tempfile
+
 from bup import xstat
-from bup.helpers import *
+from bup.helpers import (add_error, log, merge_iter, mmap_readwrite,
+                         progress, qprogress, resolve_parent, slashappend)
+
 
 EMPTY_SHA = '\0'*20
 FAKE_SHA = '\x01'*20
index df299e58787b040f930a8938d65cbb6c4ad5bbf4..6e66be5e838bc7281787604cdd0f5f87f6482d19 100644 (file)
@@ -1,7 +1,9 @@
 """Common code for listing files from a bup repository."""
+
 import copy, os.path, stat, xstat
+
 from bup import metadata, options, vfs
-from helpers import *
+from helpers import istty1, log
 
 
 def node_info(n, name,
index 57a478759297228622e32f102976150fe27d7525..99c47a2585ac6575c49b715f050b6332f4aa2301 100644 (file)
@@ -1,6 +1,9 @@
-import mmap
+
+import mmap, struct
+
 from bup import _helpers
-from bup.helpers import *
+from bup.helpers import log, mmap_read
+
 
 MIDX_VERSION = 4
 
index 25ef66105335d6e9b1578f2a5ae631a7d440154b..43ee2d3fd474301b80ba5e1fef3fa88c95fcaa7c 100644 (file)
@@ -1,8 +1,12 @@
-import errno, platform, tempfile
+
+import errno, platform, subprocess, tempfile
+
 from bup import bloom
-from bup.helpers import *
+from bup.helpers import mkdirp
+
 from wvtest import *
 
+
 bup_tmp = os.path.realpath('../../../t/tmp')
 mkdirp(bup_tmp)
 
index c57e8cd75e4b866bbe1c0fe5ed384f10c9f8c389..8665e8011c1a69f9912e8bdea7e70ef35988c739 100644 (file)
@@ -1,7 +1,9 @@
-import struct, os, tempfile, time
 from subprocess import check_call
+import struct, os, subprocess, tempfile, time
+
 from bup import git
-from bup.helpers import *
+from bup.helpers import log, mkdirp, readpipe
+
 from wvtest import *
 
 
index ee8df5103e6238c71f11832ca2fec3fd47ee19bf..865ad5d8a27bdfe31751ff249fac39096a85c22d 100644 (file)
@@ -4,10 +4,17 @@ import os
 import os.path
 import tempfile
 import stat
+import subprocess
+
+from bup.helpers import (atomically_replaced_file, batchpipe, detect_fakeroot,
+                         grafted_path_components, mkdirp, parse_num,
+                         path_components, readpipe, stripped_path_components,
+                         utc_offset_str)
 import bup._helpers as _helpers
-from bup.helpers import *
+
 from wvtest import *
 
+
 bup_tmp = os.path.realpath('../../../t/tmp')
 mkdirp(bup_tmp)
 
index 14a8d4acaafc8aee6180921a5b7c1db7766ed6bb..c0276c58f62455ca33a2cf9fe3eb4389dfcd7401 100644 (file)
@@ -1,13 +1,13 @@
-import os
-import time, tempfile
+
+import os, subprocess, time, tempfile
 
 from bup import index, metadata
-from bup.helpers import *
-import bup.helpers as helpers
+from bup.helpers import mkdirp, resolve_parent
 import bup.xstat as xstat
 
 from wvtest import *
 
+
 lib_t_dir = os.getcwd()
 bup_tmp = os.path.realpath('../../../t/tmp')
 mkdirp(bup_tmp)
@@ -17,11 +17,11 @@ def index_basic():
     cd = os.path.realpath('../../../t')
     WVPASS(cd)
     sd = os.path.realpath(cd + '/sampledata')
-    WVPASSEQ(helpers.resolve_parent(cd + '/sampledata'), sd)
+    WVPASSEQ(resolve_parent(cd + '/sampledata'), sd)
     WVPASSEQ(os.path.realpath(cd + '/sampledata/x'), sd + '/x')
     WVPASSEQ(os.path.realpath(cd + '/sampledata/var/abs-symlink'),
              sd + '/var/abs-symlink-target')
-    WVPASSEQ(helpers.resolve_parent(cd + '/sampledata/var/abs-symlink'),
+    WVPASSEQ(resolve_parent(cd + '/sampledata/var/abs-symlink'),
              sd + '/var/abs-symlink')
 
 
index fbe5bd6cc6fca5ed2eb0407c7c6792c3a9032122..00e1b8dbe97e1d2ce9b87a8ee8937423e3ac1d62 100644 (file)
@@ -3,9 +3,11 @@
 The vfs.py library makes it possible to expose contents from bup's repository
 and abstracts internal name mangling and storage from the exposition layer.
 """
+
 import os, re, stat, time
+
 from bup import git, metadata
-from helpers import *
+from helpers import debug1, debug2
 from bup.git import BUP_NORMAL, BUP_CHUNKED, cp
 from bup.hashsplit import GIT_MODE_TREE, GIT_MODE_FILE
 
diff --git a/main.py b/main.py
index b149bbad76cbe49643792a6cf50be58864eb492e..ecc975fed5d274b7550f5b25a8aa9eaf7e18a0cd 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -7,6 +7,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 
 import sys, os, subprocess, signal, getopt
 
+
 argv = sys.argv
 exe = os.path.realpath(argv[0])
 exepath = os.path.split(exe)[0] or '.'
@@ -29,8 +30,10 @@ os.environ['PYTHONPATH'] = libpath + ':' + os.environ.get('PYTHONPATH', '')
 os.environ['BUP_MAIN_EXE'] = os.path.abspath(exe)
 os.environ['BUP_RESOURCE_PATH'] = resourcepath
 
+
 from bup import helpers
-from bup.helpers import *
+from bup.helpers import atoi, columnate, debug1, log, tty_width
+
 
 # after running 'bup newliner', the tty_width() ioctl won't work anymore
 os.environ['WIDTH'] = str(tty_width())