Robot-Will / Stino

A Sublime Text Plugin for Arduino
Other
1.58k stars 250 forks source link

i cant upload a sketch... #509

Open Tijeni opened 5 years ago

Tijeni commented 5 years ago

Hi, i dont know why my Teensy 3.2 dont want eat my sketch ... Step 3 Start building pending for ever and in my console:

plugins loaded
environment variables loaded using: /bin/bash -l
Exception in thread Thread-16:
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "/Users/tijani/Library/Application Support/Sublime Text 3/Packages/Stino-Stino-Dev/libs/base_utils/task_queue.py", line 86, in _run
    self._consumer(*args)
  File "/Users/tijani/Library/Application Support/Sublime Text 3/Packages/Stino-Stino-Dev/libs/stino_runtime/__init__.py", line 2198, in build_sketch
    is_ok = run_build_commands(cmds, msgs)
  File "/Users/tijani/Library/Application Support/Sublime Text 3/Packages/Stino-Stino-Dev/libs/stino_runtime/__init__.py", line 1835, in run_build_commands
    is_ok = run_build_command(percent, cmd, msg)
UnboundLocalError: local variable 'percent' referenced before assignment`

osx 10.13.6

thank for your help.

T

Tijeni commented 5 years ago

i dont have verify/Compile menu ...

mynameisbill2 commented 4 years ago

Hi Tijeni, Have you solved this problem? I meet the same problem.

mynameisbill2 commented 4 years ago

I have solved this problem.

`def run_build_commands(cmds, msgs): """.""" is_ok = True n = 0 percent = 0

non_blank_msgs = [m for m in msgs if m]
total = len(non_blank_msgs)
for cmd, msg in zip(cmds, msgs):
    if msg:
        n += 1
        percent = n / total * 100
    is_ok = run_build_command(percent, cmd, msg)
    if not is_ok:
        break
return is_ok`

The error msg tell us that the 'percent' is a local variable, so we need to declare the variable in the function.

UnboundLocalError: local variable 'percent' referenced before assignment

ghost commented 4 years ago

I have solved this problem. def run_build_commands(cmds, msgs): """.""" is_ok = True n = 0 percent = 0 non_blank_msgs = [m for m in msgs if m] total = len(non_blank_msgs) for cmd, msg in zip(cmds, msgs): if msg: n += 1 percent = n / total * 100 is_ok = run_build_command(percent, cmd, msg) if not is_ok: break return is_ok

The error msg tell us that the 'percent' is a local variable, so we need to declare the variable in the function.

UnboundLocalError: local variable 'percent' referenced before assignment

Where is that file?

jyjblrd commented 3 years ago

@Pararera

File: /Sublime Text 3/Packages/Stino-Stino-Dev/libs/stino_runtime/__init__.py at line 1835.

change

def run_build_commands(cmds, msgs):
    """."""
    is_ok = True
    n = 0

to

def run_build_commands(cmds, msgs):
    """."""
    is_ok = True
    n = 0
    percent = 0
ghost commented 3 years ago

@Pararera

File: /Sublime Text 3/Packages/Stino-Stino-Dev/libs/stino_runtime/__init__.py at line 1835.

change

def run_build_commands(cmds, msgs):
    """."""
    is_ok = True
    n = 0

to

def run_build_commands(cmds, msgs):
    """."""
    is_ok = True
    n = 0
    percent = 0

A bit late, but better ever than never. Thanks.