AnsweredAssumed Answered

Python Add-in missing

Question asked by msilveira.ucu on Aug 6, 2014
Latest reply on Aug 11, 2014 by msilveira.ucu

Hello,

 

I programmed an initial add in in Python that works just fine. My problem is that when I make a trivial refactoring change to it, it fails to load in ArcGIS desktop.

 

The docs point to this being a syntax error in the code, but I checked it outside of ArcGIS and it worked just fine. I also couldn't find any information on ArcGIS (error logs, for example) about what the syntax error could be.

 

What can I do to find the cause of this problem? Can I find anywhere in ArcGIS a detailed error message about why this fails to load?

 

I post below how I refactored my code in case anyone can give me a hint about what could be wrong.

 

Before refactoring:

 

import arcpy
import pythonaddins

class Promedio(object):
     """Implementation for AddinsPyPromedio_addin.Promediobutton (Button)"""
     def __init__(self):
          self.enabled = True
          self.checked = False 

     def onClick(self):
          #Compute average

 

After refactoring:

 

import arcpy
import pythonaddins

class Promedio(object):
     """Implementation for AddinsPyAverage_addin.Averagebutton (Button)"""
     def __init__(self):
          self.enabled = True
          self.checked = False

     def computeAverage(self):
          #compute average

     def onClick(self):
          self.computeAverage()

Outcomes