Skip to content

Commit

Permalink
Resolves #23 by moving "Layer" from self._layers to self._simple_data…
Browse files Browse the repository at this point in the history
…sets

Layer files have metadata that's operated on directly, and no path to
another dataset (thus dataElement not existing for the describe object).
So, they should be considered a simple dataset, which makes the rest of
the test suite function. Thomas, if you get a chance to sign off on
this, I'd appreciate it - I think it should fix support for layer files
  • Loading branch information
nickrsan committed Oct 27, 2016
1 parent 93bdfc9 commit 7fb9b02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arcpy_metadata/metadata_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __init__(self, dataset=None, metadata_file=None, items=None,
self.dataset = dataset

self._gdb_datasets = ["FeatureClass", "Table", "RasterDataset", "RasterCatalog", "MosaicDataset"]
self._simple_datasets = ["ShapeFile", "RasterDataset"]
self._layers = ["FeatureLayer", "Layer"]
self._simple_datasets = ["ShapeFile", "RasterDataset", "Layer"]
self._layers = ["FeatureLayer"]

if self.dataset: # for both, we want to export the metadata out
# export the metadata to the temporary location
Expand All @@ -69,7 +69,7 @@ def __init__(self, dataset=None, metadata_file=None, items=None,
if self.data_type in self._layers:
desc = arcpy.Describe(self.dataset)
self.data_type = desc.dataElement.dataType
self.dataset = desc.dataElement.catalogPath
self.dataset = desc.dataElement.catalogPath # overwrite path to dataset with layer's data source

self._workspace = self.get_workspace()
self._workspace_type = self.get_workspace_type()
Expand Down

0 comments on commit 7fb9b02

Please sign in to comment.