Esri / military-tools-geoprocessing-toolbox

military-tools-geoprocessing-toolbox is a collection of models, scripts, and tools for use in ArcGIS for Desktop and ArcGIS Pro. This toolbox is one component that is a part of Military Tools.
Apache License 2.0
33 stars 14 forks source link

adding the geoprocessing folder to the repo #355

Closed topowright-zz closed 6 years ago

topowright-zz commented 6 years ago

adding the geoprocessing fodler to the repo due to the python package not working in arcmap

Description

Adding the Geoprocessing tools old structure back to the build because the python package does not work in ArcMap

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

csmoore commented 6 years ago

@topowright @dfoll @BobBooth

If you want to avoid this duplication, you have some other options:

  1. Place just the pyt toolbox files at the top level here (this won't be included in packaging) : https://github.com/Esri/military-tools-geoprocessing-toolbox/tree/dev/pythonpackage

  2. Add fallback imports to pyt file at: Military Tools.pyt - downside to this is that the folder is somewhat buried

try:
    # Library installed:
    from militarytools.ConversionTools import *
    from militarytools.DistanceAndDirectionTools import *
    from militarytools.GRGTools import *
    from militarytools.VisTools import *
except:
    # Library not installed:
    # Enable testing the toolbox directly from the repo without library installed
    import os
    import sys
    # Add root folder to path
    lib_root_dir_name = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
    sys.path.append(lib_root_dir_name)

    # Now retry imports
    from militarytools.ConversionTools import *
    from militarytools.DistanceAndDirectionTools import *
    from militarytools.GRGTools import *
    from militarytools.VisTools import *