<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Print a list of SDE datasources in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369416#M29178</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Mark that's done the trick, they are listing perfectly now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jul 2014 07:09:48 GMT</pubDate>
    <dc:creator>RebeccaWatson</dc:creator>
    <dc:date>2014-07-03T07:09:48Z</dc:date>
    <item>
      <title>Print a list of SDE datasources</title>
      <link>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369412#M29174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to print out a list of SDE datasources used by some MXDs in a folder. I can successfully print out a list of all the datasources, but I am having no luck separating out the sde connections. I have tried the following and a few other variations on the theme but I can't get anything to print out:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;for lyr in arcpy.mapping.ListLayers(mxd): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.supports("WORKSPACEPATH"): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wsp = lyr.workspacePath &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if wsp == ("*.sde"): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print lyr.dataSource&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems like this should be pretty straight forward but I'm having no luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone point me in the right direction?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 14:49:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369412#M29174</guid>
      <dc:creator>RebeccaWatson</dc:creator>
      <dc:date>2014-07-02T14:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Print a list of SDE datasources</title>
      <link>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369413#M29175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It may or may not be this simply but&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if lyr.supports("WORKSPACEPATH"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;might need to be&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if lyr.supports("WORKSPACEPATH") == True:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;since the support method returns a Boolean data type.&amp;nbsp; Currently you are not actually checking it against anything for the if statement.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 15:04:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369413#M29175</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-02T15:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Print a list of SDE datasources</title>
      <link>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369414#M29176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would suggest that &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if wsp == ("*.sde"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is not a useful test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;perhaps &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if wsp.endswith('.sde'):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;would serve better&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is, by the way, perfectly fine to test a boolean baldly, as in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if True: do something&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 17:26:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369414#M29176</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2014-07-02T17:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Print a list of SDE datasources</title>
      <link>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369415#M29177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the python nugget Mark, I thought that my suggestion was a bit too simple, but it was the only thing that struck me when i looked at it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 18:23:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369415#M29177</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-02T18:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Print a list of SDE datasources</title>
      <link>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369416#M29178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Mark that's done the trick, they are listing perfectly now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 07:09:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/print-a-list-of-sde-datasources/m-p/369416#M29178</guid>
      <dc:creator>RebeccaWatson</dc:creator>
      <dc:date>2014-07-03T07:09:48Z</dc:date>
    </item>
  </channel>
</rss>

