Skip to content

Commit b51df0c

Browse files
committed
extra doc and other minor changes
1 parent bea650f commit b51df0c

1 file changed

Lines changed: 26 additions & 5 deletions

File tree

tools/__init__.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# !/usr/bin/env python
22
# -*- coding: utf-8 -*-
3+
import sublime
4+
from sublime_plugin import WindowCommand
5+
36
from .. import requests
47
from os import path, makedirs
5-
from sublime import version, active_window
68

79
from ..tools.boards import get_boards_list
810
from ..tools.command import run_command
@@ -41,7 +43,8 @@ def get_headers():
4143
headers for urllib request
4244
"""
4345

44-
user_agent = 'uPIOT/{0} (Sublime-Text/{1})'.format(__version__, version())
46+
user_agent = 'uPIOT/{0} (Sublime-Text/{1})'.format(__version__,
47+
sublime.version())
4548
headers = {'User-Agent': user_agent}
4649
return headers
4750

@@ -95,13 +98,17 @@ def download_file(file_url, dst_path, callback=None):
9598

9699

97100
def erase_flash():
101+
"""Erase flash memory
102+
103+
Erase the flash memory from the current selected device
104+
"""
98105
from ..tools import serial
99106

100107
port = serial.selected_port()
101108
if(not port):
102109
return
103110

104-
options = ['--port', port, 'erase_flash']
111+
options = ['esptool', '--port', port, 'erase_flash']
105112
run_command(options)
106113

107114

@@ -192,18 +199,32 @@ def check_sidebar_folder(folder):
192199

193200

194201
def set_status(text):
202+
"""Set the status bar
203+
204+
Sets a message/text in the status bar
205+
206+
Arguments:
207+
text {str} -- text to add
208+
"""
195209
if(ACTIVE_VIEW):
196210
ACTIVE_VIEW.set_status('_upiot_', text)
197211

198212

199213
def clean_status():
214+
"""Remove status bar text
215+
216+
Removes the status bar text related to the plugin
217+
"""
200218
if(ACTIVE_VIEW):
201219
ACTIVE_VIEW.erase_status('_upiot_')
202220

203221

204222
def show_console():
205-
options = {'panel': 'console', 'toggle': True}
206-
active_window().run_command('show_panel', options)
223+
"""Open ST console
207224
225+
Opens the Sublime Text console
226+
"""
227+
options = {'panel': 'console', 'toggle': True}
228+
sublime.active_window().run_command('show_panel', options)
208229

209230
__version__ = versionize(VERSION)

0 commit comments

Comments
 (0)