Skip to content

Commit b896e4f

Browse files
committed
update how arcpy is imported
* using archook module to setup pro paths
1 parent 03633af commit b896e4f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ArcGisUtil/ArcGisUtil/LayerFileReader.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
'''
1010
import logging
1111
import os
12-
import arcpy # @UnresolvedImport
12+
import platform
13+
import archook
1314

15+
# setup for arcpro paths
16+
archook.get_arcpy(pro=True)
17+
import arcpy
1418

1519
class ReadLayerFiles(object):
1620
'''
@@ -55,7 +59,7 @@ def createSDEConnection(self, sdeServer, sdePort):
5559
self.logger.debug("Connection file successfully created...")
5660

5761
def readLyrFile(self, srcLyrFile):
58-
'''
62+
'''
5963
Going into the layer file and extracting the following information
6064
to put into the GWIP database.
6165
@@ -76,8 +80,8 @@ def readLyrFile(self, srcLyrFile):
7680
(get from serviceProperties.ServiceType)
7781
7882
:param srcLyrFile: a string describing the input layer file that is to
79-
be read.
80-
:type srcLyrFile: str
83+
be read.
84+
:type srcLyrFile: str
8185
'''
8286
self.logger.info(u'inlayer file is: %s', srcLyrFile)
8387
lyrObj = arcpy.mp.LayerFile(srcLyrFile)

ArcGisUtil/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
from setuptools import setup
1313

1414
setup(name='ArcGisUtil',
15-
version='0.2',
15+
version='0.3',
1616
description='Library to with functions to automate aspects of ArcGIS',
1717
url='https://github.com/bcgov/dbc-pylib/tree/master/ArcGisUtil',
1818
author='Kevin Netherton',
1919
author_email='kevin.netherton@gov.bc.ca',
2020
license='Apache',
2121
packages=['ArcGisUtil'],
22+
install_requires=['archook-dbc>=202012.2.1925'],
2223
zip_safe=False)

0 commit comments

Comments
 (0)