Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i cant upload a sketch... #509

Open
Tijeni opened this issue Sep 19, 2018 · 6 comments
Open

i cant upload a sketch... #509

Tijeni opened this issue Sep 19, 2018 · 6 comments

Comments

@Tijeni
Copy link

Tijeni commented Sep 19, 2018

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 Tijeni changed the title Teensy 3.2 not roconized in serial port i cant upload a sketch... Sep 19, 2018
@Tijeni
Copy link
Author

Tijeni commented Sep 20, 2018

i dont have verify/Compile menu ...

@mynameisbill2
Copy link

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

@mynameisbill2
Copy link

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

mynameisbill2 added a commit to mynameisbill2/Stino that referenced this issue Nov 6, 2019
bug fix Robot-Will#509, 修改局部变量percent作用域
@ghost
Copy link

ghost commented Jan 5, 2020

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
Copy link

jyjblrd commented Feb 3, 2021

@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
Copy link

ghost commented Feb 3, 2021

@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.

ttlg59 added a commit to ttlg59/Stino that referenced this issue Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants