Skip to content

Commit

Permalink
Remove unused code and fix missing term color
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Mar 21, 2024
1 parent d1a2077 commit 553b428
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 112 deletions.
27 changes: 3 additions & 24 deletions ibeis/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python
"""
Runs IBIES gui
SeeAlso:
ibeis.main_module - contains more entry point logic (needs cleanup)
"""
import utool as ut
import ubelt as ub
Expand Down Expand Up @@ -80,30 +83,6 @@ def run_ibeis():
print('... exiting')
sys.exit(0)

# Attempt to run a test using the funciton name alone
# with the --tf flag
# if False:
# import ibeis.tests.run_tests
# import ibeis.tests.reset_testdbs
# import ibeis.scripts.thesis
# ignore_prefix = [
# #'ibeis.tests',
# 'ibeis.control.__SQLITE3__',
# '_autogen_explicit_controller']
# ignore_suffix = ['_grave']
# func_to_module_dict = {
# 'demo_bayesnet': 'ibeis.unstable.demobayes',
# }
# ut.main_function_tester('ibeis', ignore_prefix, ignore_suffix,
# func_to_module_dict=func_to_module_dict)

#if ub.argflag('-e'):
# import ibeis
# expt_kw = ut.get_arg_dict(ut.get_func_kwargs(ibeis.run_experiment),
# prefix_list=['--', '-'])
# ibeis.run_experiment(**expt_kw)
# sys.exit(0)

doctest_modname = ut.get_argval(
('--doctest-module', '--tmod', '-tm', '--testmod'),
type_=str, default=None, help_='specify a module to doctest')
Expand Down
69 changes: 0 additions & 69 deletions ibeis/init/__init__.py
Original file line number Diff line number Diff line change
@@ -1,69 +0,0 @@
# -*- coding: utf-8 -*-
# UNCOMMENTING WHAT I THOUGHT SHOULD BE FINE IN AN INIT MODULE SEEMS TO
# BREAK THE IMPORT STRUCTURE. WERID

#### __init__.py ###
## flake8: noqa
#from __future__ import absolute_import, division, print_function
#from ibeis.init import main_commands
#from ibeis.init import main_helpers
#from ibeis.init import sysres
#import utool


#def reassign_submodule_attributes(verbose=True):
# """
# why reloading all the modules doesnt do this I don't know
# """
# import sys
# if verbose and '--quiet' not in sys.argv:
# print('dev reimport')
# # Self import
# import ibeis.init
# # Implicit reassignment.
# seen_ = set([])
# for tup in IMPORT_TUPLES:
# if len(tup) > 2 and tup[2]:
# continue # dont import package names
# submodname, fromimports = tup[0:2]
# submod = getattr(ibeis.init, submodname)
# for attr in dir(submod):
# if attr.startswith('_'):
# continue
# if attr in seen_:
# # This just holds off bad behavior
# # but it does mimic normal util_import behavior
# # which is good
# continue
# seen_.add(attr)
# setattr(ibeis.init, attr, getattr(submod, attr))


#def reload_subs(verbose=True):
# """ Reloads ibeis.init and submodules """
# rrr(verbose=verbose)
# def fbrrr(*args, **kwargs):
# """ fallback reload """
# pass
# getattr(main_commands, 'rrr', fbrrr)(verbose=verbose)
# getattr(main_helpers, 'rrr', fbrrr)(verbose=verbose)
# getattr(sysres, 'rrr', fbrrr)(verbose=verbose)
# rrr(verbose=verbose)
# try:
# # hackish way of propogating up the new reloaded submodule attributes
# reassign_submodule_attributes(verbose=verbose)
# except Exception as ex:
# print(ex)
#rrrr = reload_subs

#IMPORT_TUPLES = [
# ('main_commands', None),
# ('main_helpers', None),
# ('sysres', None),
#]
#"""
#Regen Command:
# cd /home/joncrall/code/ibeis/ibeis/init
# makeinit.py
#"""
## autogenerated __init__.py for: '/home/joncrall/code/ibeis/ibeis/init'
17 changes: 0 additions & 17 deletions ibeis/main_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,7 @@ def _init_numpy():
'under': on_err,
'invalid': on_err,
}
#numpy_print = {
# 'precision': 8,
# 'threshold': 500,
# 'edgeitems': 3,
# 'linewidth': 200, # default 75
# 'suppress': False,
# 'nanstr': 'nan',
# 'formatter': None,
#}
np.seterr(**numpy_err)
#np.set_printoptions(**numpy_print)


#-----------------------
Expand Down Expand Up @@ -215,8 +205,6 @@ def set_newfile_permissions():
mask = 0o000 # most permissive umask
prev_mask = os.umask(mask)
return prev_mask
#print('prev_mask = %o' % (prev_mask,))
#print('new_mask = %o' % (mask,))


def main(gui=True, dbdir=None, defaultdb='cache',
Expand Down Expand Up @@ -574,9 +562,6 @@ def _preload(mpl=True, par=True, logging=True):
_init_signals()
# inject colored exceptions
ut.util_inject.inject_colored_exceptions()
# register type aliases for debugging
#main_helpers.register_utool_aliases()
#return params.args


def main_loop(main_locals, rungui=True, ipy=False, persist=True):
Expand Down Expand Up @@ -626,8 +611,6 @@ def main_close(main_locals=None):
_reset_signals()


#if __name__ == '__main__':
# multiprocessing.freeze_support()
if __name__ == '__main__':
"""
CommandLine:
Expand Down
2 changes: 1 addition & 1 deletion ibeis/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
automagically)
TODO:
nnkj/enerate this module automagically from
autogenerate this module automagically from
import utool as ut
utool_parse_codeblock = ut.util_arg.autogen_argparse_block(extra_args=parsed_args)
ut.util_arg.reset_argrecord()
Expand Down
2 changes: 1 addition & 1 deletion ibeis/web/job_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def _initialize_job_ports(self, use_static_ports=False, static_root=51381):

def initialize_background_processes(self, dbdir=None, wait=0, containerized=False,
thread=True):
print = partial(ut.colorprint, color='fuchsia')
print = partial(ut.colorprint, color='white')
#if VERBOSE_JOBS:
print('Initialize Background Processes')

Expand Down

0 comments on commit 553b428

Please sign in to comment.