'(' was never closed

14 views
Skip to first unread message

CJS Hayward

unread,
Nov 20, 2023, 11:33:46 AM11/20/23
to brython
I've gotten an error:

emit closing bracket
brython.js:532 braces (2) ['{', '(']
brython.js:14938
  File "VFS.string.py", line 77
    pattern=fr"""
                                                                                                                                                                                                                 ^
SyntaxError: '(' was never closed
$io.flush @ brython.js:14938
method @ brython.js:5810
$B.show_error @ brython.js:8375
$B.handle_error @ brython.js:8379
$B.loop @ brython.js:5100
$B.inImported @ brython.js:5068
$B.loop @ brython.js:5102
$B.inImported @ brython.js:5068
$B.loop @ brython.js:5102
$B.inImported @ brython.js:5068
$B.loop @ brython.js:5102
$B.inImported @ brython.js:5068
$B.loop @ brython.js:5102
$B.run_script @ brython.js:4920
$B.loop @ brython.js:5102
req.onreadystatechange @ brython.js:5057
XMLHttpRequest.send (async)
$B.ajax_load_script @ brython.js:5058
$B.loop @ brython.js:5102
run_scripts @ brython.js:4880
$B.parser.brython @ brython.js:4828
onload @ (index):10
ev.target.body.onload @ brython.js:4779
load (async)
(anonymous) @ brython.js:4779

What does this mean and how do I address this? I load JSON from a string that was created by CPython's json module and validates with jsonlint.com. My one .bpy file reads:

#!/usr/bin/python3 from browser import document, window import json import pickle import re import string jQuery = window.jQuery console = window.console def display_view(view_number): view = views_data[view_number] output = '' output += ('<img src="static/assets/' + view['canonical_name'] + '.jpg" alt="' + view['title'] + '" id="main-picture" />') if 'Forward' in view['neighbors']: forword_arrow = 'arrow_up.gif' else: forword_arrow = 'invalid_arrow_up.gif' if 'Right' in view['neighbors']: right_arrow = 'arrow_right.gif' else: right_arrow = 'invalid_arrow_right.gif' if 'Back' in view['neighbors']: back_arrow = 'arrow_down.gif' else: back_arrow = 'invalid_arrow_down.gif' if 'Left' in view['neighbors']: left_arrow = 'arrow_left.gif' else: left_arrow = 'invalid_arrow_left.gif' direction = view['canonical_name'].split('_')[-1] if direction == 'coordinate': if direction == 'E': center = 'center_arrow_right.gif' alt='Facing East' elif direction == 'S': center = 'center_arrow_down.gif' alt='Facing South' elif direction == 'W': center = 'center_arrow_left.gif' alt='Facing West' elif direction == 'N': center = 'center_arrow_up.gif' alt='Facing North' elif view['view-type'] == 'passage': if direction == 'B': center = 'center_arrow_down.gif' alt="Facing Back" elif direction == 'F': center = 'center_arrow_up.gif' alt='Facing Forward' else: center = 'center_arrow_up.gif' output += ( '<div id="navigation">' + '<img src="static/assets/placeholder.gif" alt="" />' + '<img src="static/assets/' + up_arrow + '" alt="Forward" />' + '<img src="static/assets/placeholder.gif" alt="" />' + '<br />' '<img src="static/assets/' + left_arrow + '" alt="Left" />' + '<img src="static/assets/' + center + '" alt="' + alt + '" />' + '<img src="static/assets/' + right_arrow + '" alt="Right" />' + '<img src="static/assets/placeholder.gif" alt="" />' + '<img src="static/assets/' + down_arrow + '" alt="Back" />' + '<img src="static/assets/placeholder.gif" alt="" />') jQuery('#view').html(output) if __name__ == '__main__': console.log('Reached here!') views_data = json.loads(open('static/json/view.json', 'rb').read()) current_view = "22273" display_view(current_view)

Thanks for any help,
C.J.S. Hayward

CJS Hayward

unread,
Nov 20, 2023, 11:34:57 AM11/20/23
to brython
That Python script should have read:

On Monday, November 20, 2023 at 11:33:46 AM UTC-5 CJS Hayward wrote:
I've gotten an error:

Pierre Quentel

unread,
Nov 20, 2023, 11:54:58 AM11/20/23
to bry...@googlegroups.com
Hi,

Could you report the issue in the GIthub issue tracker ? It's almost impossible to read it here.

Thanks,
Pierre

Sans virus.www.avast.com

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/74436749-abe5-41e9-ba92-125f80931116n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages