<?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: python addin: best practise for persisting custom setting? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-addin-best-practise-for-persisting-custom/m-p/214585#M16529</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Devious, perhaps, but writing to some location in the user's personal directory is the usual way of doing it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, Arc places the default geodatabase and workspace there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jan 2014 16:38:17 GMT</pubDate>
    <dc:creator>markdenil</dc:creator>
    <dc:date>2014-01-22T16:38:17Z</dc:date>
    <item>
      <title>python addin: best practise for persisting custom setting?</title>
      <link>https://community.esri.com/t5/python-questions/python-addin-best-practise-for-persisting-custom/m-p/214584#M16528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the development of a Python addin (extension) for ArcMap I would like to manage a user setting which persists over multiple arcMap sessions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been exploring several options with an xml settings file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One of the things I found out that it is not possible to directly use a file included in the plugin's Install folder: the contents of this folder are overwritten in the Addin AssemblyCache folder so the original state of the settingsfile is reverted for each new ArcMap session.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I managed to find a solution by copying the settingsfile to a general accessible location and check for existence each time the extension loads. However, this is a rather devious solution. Any other ideas of how to accomplish this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, Laurens&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 14:19:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-addin-best-practise-for-persisting-custom/m-p/214584#M16528</guid>
      <dc:creator>Laurensvan_der_Burgt</dc:creator>
      <dc:date>2014-01-22T14:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: python addin: best practise for persisting custom setting?</title>
      <link>https://community.esri.com/t5/python-questions/python-addin-best-practise-for-persisting-custom/m-p/214585#M16529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Devious, perhaps, but writing to some location in the user's personal directory is the usual way of doing it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, Arc places the default geodatabase and workspace there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 16:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-addin-best-practise-for-persisting-custom/m-p/214585#M16529</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2014-01-22T16:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: python addin: best practise for persisting custom setting?</title>
      <link>https://community.esri.com/t5/python-questions/python-addin-best-practise-for-persisting-custom/m-p/214586#M16530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Write it to %APPDATA%\your_adddin_name\your_config_file.xml.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This way, it gets written to a users profile and will not get overwritten by later users (who will get their own config file).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
config=os.path.join(os.environ['APPDATA'],'your_addin_name', 'your_config_file.xml')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:31:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-addin-best-practise-for-persisting-custom/m-p/214586#M16530</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-12-11T10:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: python addin: best practise for persisting custom setting?</title>
      <link>https://community.esri.com/t5/python-questions/python-addin-best-practise-for-persisting-custom/m-p/214587#M16531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the quick responses!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Indeed useful to ensure that each user will gets a separate instance of the config file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 06:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-addin-best-practise-for-persisting-custom/m-p/214587#M16531</guid>
      <dc:creator>Laurensvan_der_Burgt</dc:creator>
      <dc:date>2014-01-23T06:32:24Z</dc:date>
    </item>
  </channel>
</rss>

