I'm writing a Sublime2 plugin and fighting a bit.
Code is:
def run(self, edit):
self.edit = edit
self.view.window().show_input_panel("New Controller and View Path (ex: client_area/index )", "", self.trigger, None, None)
def trigger(self, user_entry):
formatted_entry = user_entry.encode('utf-8')
print formatted_entry.__class__
print formatted_entry
if formatted_entry.slice('/')[0] == '':
#some code
Output is:
<type 'str'>
client_area/index
Traceback (most recent call last):
File "./PluginName.py", line 27, in trigger
AttributeError: 'str' object has no attribute 'slice'
How is it I get 'str' object has no attribute 'slice' ? (Python version is 2.6)
"asdasd"[1:3]... ahh I think bradley.ayers got it ... I didnt figure it out :(