-
Notifications
You must be signed in to change notification settings - Fork 1
Bluetooth support fix #2
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
base: bluetooth-support
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -395,7 +395,7 @@ def __init__(self, log=sys.stderr): | |
| print("Searching for bt devices on OSX", file=log) | ||
| # on osx a rfcomm port is created and linked automatically when the cameo is connected | ||
| # TODO add support for other machines. I would expect files like CAMEO3-... and PORTRAIT2-... | ||
| pat = re.compile("tty\.(PORTRAIT2|CAMEO3|CAMEO4)-.*") | ||
| pat = re.compile("tty.(PORTRAIT2|CAMEO3|CAMEO4)-.*") | ||
| # get first matching port | ||
| rfcomms = [f for f in os.listdir("/dev/") if pat.match(f)] | ||
| rfcomm = rfcomms[0] if rfcomms else None | ||
|
|
@@ -414,7 +414,7 @@ def __init__(self, log=sys.stderr): | |
| else: # linux | ||
| print("Searching for bt devices on Linux", file=log) | ||
|
|
||
| pat = re.compile("tty\.(PORTRAIT2|CAMEO3|CAMEO4)-?.*") | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| pat = re.compile("tty.(PORTRAIT2|CAMEO3|CAMEO4)-?.*") | ||
| # get first matching port | ||
| rfcomms = [f for f in os.listdir("/dev/") if pat.match(f)] | ||
| rfcomm = rfcomms[0] if rfcomms else None | ||
|
|
@@ -1125,7 +1125,7 @@ def draw_mm_cmd(self, mmy, mmx): | |
| return "D%d,%d" % (_mm_2_SU(mmy), _mm_2_SU(mmx)) | ||
|
|
||
| def upper_left_mm_cmd(self, mmy, mmx): | ||
| """ \y,x """ | ||
| r""" \y,x """ | ||
| return "\\%d,%d" % (_mm_2_SU(mmy), _mm_2_SU(mmx)) | ||
|
|
||
| def lower_right_mm_cmd(self, mmy, mmx): | ||
|
|
@@ -1398,7 +1398,8 @@ def plot(self, mediawidth=210.0, mediaheight=297.0, margintop=None, | |
| self.draw_mm_cmd(bbox['ury'], bbox['llx'])] | ||
|
|
||
| # potentially long command string needs extra care | ||
| self.safe_send_command(cmd_list) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I also stumbled over that one, but I think it only occurs if sending nothing to the device, no? If that were the case, this should probably be handled from the plugin itself, i.e. we should test directly when the extensions is launched, whether a object/path was currently selected. But it probably doesn't hurt to catch it here also. Just saying. |
||
| if cmd_list: | ||
| self.safe_send_command(cmd_list) | ||
|
|
||
| self.wait_for_ready() | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about this? Normally I would expect the old code to match a dot character (".") whereas the new code would match any character but newlines?
We probably should use a raw string here, too. However, the current branch version using PyBluez does not have this problem anyways.