<?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: How to require info or editor in arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301582#M23426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Aug 2015 12:43:22 GMT</pubDate>
    <dc:creator>GuidoStein</dc:creator>
    <dc:date>2015-08-19T12:43:22Z</dc:date>
    <item>
      <title>How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301580#M23424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have a script that edits sde and requires info or an editor license.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that you can use&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1439980557295813 jive_text_macro" data-renderedposition="71_8_912_16" jivemacro_uid="_1439980557295813" modifiedtitle="true"&gt;&lt;P&gt;import arcinfo&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14399806027099029 jive_text_macro" data-renderedposition="150_8_912_16" jivemacro_uid="_14399806027099029"&gt;&lt;P&gt;import arceditor&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if you have two imports, one will fail. So how do you use this pattern to require one or the other?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 10:38:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301580#M23424</guid>
      <dc:creator>GuidoStein</dc:creator>
      <dc:date>2015-08-19T10:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301581#M23425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import arcinfo
if arcinfo:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'info license'
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arceditor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if arceditor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'editor license'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301581#M23425</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-11T14:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301582#M23426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 12:43:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301582#M23426</guid>
      <dc:creator>GuidoStein</dc:creator>
      <dc:date>2015-08-19T12:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301583#M23427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wes, this won't work because a license is checked out when arcpy is imported which defaults to highest available (arcinfo if one is available, arceditor if not, or arcview if all else fails).&amp;nbsp; You need to import arcview/arceditor/arcinfo &lt;EM&gt;before&lt;/EM&gt; arcpy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arceditor
import arcpy
print arcpy.ProductInfo()&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ArcEditor&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import arceditor
print arcpy.ProductInfo()&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ArcInfo&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:28:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301583#M23427</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-12-11T14:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301584#M23428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please be aware that a bug has been reported for 10.3 and in 10.3.1 this has still not been fixed. See:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/message/446333"&gt;import arceditor does not set proper license level&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have an older version (like 10.1) it will work (not sure if 10.2 works).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 01:06:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301584#M23428</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-08-20T01:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301585#M23429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander, I'm using 10.2.2 and it works. Did you find a workaround in 10.3?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 01:31:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301585#M23429</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2015-08-20T01:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301586#M23430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still open....&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.esri.com/en/bugs/nimbus/role/beta10_1/QlVHLTAwMDA4NDI0Ng==" title="http://support.esri.com/en/bugs/nimbus/role/beta10_1/QlVHLTAwMDA4NDI0Ng=="&gt;http://support.esri.com/en/bugs/nimbus/role/beta10_1/QlVHLTAwMDA4NDI0Ng==&lt;/A&gt; &lt;/P&gt;&lt;P&gt;​no posted workaround (except a single use license...which is not an option for some)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 03:03:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301586#M23430</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-08-20T03:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301587#M23431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt; mentions it is still open en there is no fix available. No workaround unless you want to use single use or separate a license on another server. Thanks for posting that it works in 10.2.2. Apparently it was introduced in 10.3. Might enlist for the 10.4 beta that will soon be around to see if it is fixed... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 04:01:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301587#M23431</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-08-20T04:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301588#M23432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Luke thanks i didn't know that. Does that mean then that it should be a try except so if he doesn't get the upper level licenses it won't run?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;class LicenseError(Exception):
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass


import arcpy


try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.ProductInfo() == 'ArcInfo' or arcpy.ProductInfo() == 'ArcEditor':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Raise a custom exception
&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; raise LicenseError
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Do your work here'




except LicenseError:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "ArcInfo or ArcEditor license unavailable"&amp;nbsp; 
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages(2)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301588#M23432</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-11T14:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to require info or editor in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301589#M23433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok, here is what I wrote up as a standalone check prior to arcpy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;import arcview&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;if arcview:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; print 'arcview license is available'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;else:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; import arceditor&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; if arceditor:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; print 'arceditor license is available'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; else:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; import arcinfo&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; if arcinfo:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; print 'arcinfo license is available'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; else:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;&amp;nbsp; print 'no license is available'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; background-color: #fafafa;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 13:26:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-require-info-or-editor-in-arcpy/m-p/301589#M23433</guid>
      <dc:creator>GuidoStein</dc:creator>
      <dc:date>2015-08-20T13:26:36Z</dc:date>
    </item>
  </channel>
</rss>

