-
Notifications
You must be signed in to change notification settings - Fork 23
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
ss.request_acquire(show_ui=True, modal_ui=False) #38
Comments
Can you provide full stack trace? |
import sys class ScannerApp(QMainWindow):
if name == 'main': |
stack trace is below: Traceback (most recent call last): |
Looks like you are using old version, try upgrading to the latest version 2.2.1 |
i upgrade my twain version but also get error
and my code is import tkinter as tk
import twain
import uuid
import logging
app = tk.Tk()
app.title("Simple Form")
def button_click():
logging.basicConfig(level=logging.DEBUG)
with twain.SourceManager(app) as sm:
with sm.open_source() as ss:
for _ in range(2):
ss.request_acquire(show_ui=True, modal_ui=True)
rv = ss.xfer_image_natively()
if rv:
(handle, count) = rv
print(f"number of images remaining: {count}")
twain.dib_to_bm_file(handle, 'testscans/{}.bmp'.format(uuid.uuid4()))
else:
break
ss.hide_ui()
button = tk.Button(app, text="Click Me", command=button_click)
button.pack()
app.mainloop() |
sir please solve my query.
…On Tue, Oct 17, 2023 at 3:20 AM denisenkom ***@***.***> wrote:
Looks like you are using old version, try upgrading to the latest version
2.2.1
—
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARCUBTGMXMQLZOBJWJSDZWLX7WTY7AVCNFSM6AAAAAA6AZ4EEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRVGMZTEMJUHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I tried running this program, and it worked for me. So I could not reproduce your issue. |
sir can you solve my query. i give you anydesk. because i tried but not success. so please i request to you. |
Try enabling debug logging for twain DSM using environment variable
Before you start your program, and then run your program from the same terminal window. Logging only works with Twain DSM (can be downloaded here https://github.com/twain/twain-dsm/releases). Logging does not work with twain_32 which is bundled with Windows. You would need to pass path to DSM via dsm_name paramter in SourceManager constructor. |
Were you able to get logs with the above mechanism? |
yes sir |
Can you share logs here? Or have you already figured out your issue? |
SORRY SIR. BECAUSE AT THAT TIME I DON'T UNDERSTAND WHAT IS LOGS WITH MECHANISM. SO I REPLAY WITH YES. ONCE AGAIN SORRY SIR. |
def test_multiple_images_scan(root_window):
logging.basicConfig(level=logging.DEBUG)
with twain.SourceManager(root_window) as sm:
with sm.open_source() as ss:
for _ in range(2):
ss.request_acquire(show_ui=False, modal_ui=False)
rv = ss.xfer_image_natively()
if rv:
(handle, count) = rv
print(f"number of images remaining: {count}")
twain.dib_to_bm_file(handle, 'testscans/{}.bmp'.format(uuid.uuid4()))
else:
break
ss.hide_ui()
sir using above code when ss.request_acquire(show_ui=True, modal_ui=False) or ss.request_acquire(show_ui=True, modal_ui=True) in both situation. its give error like
INFO:main:Creating source manager
INFO:lowlevel:attempting to load dll: C:\Windows\twain_32.dll
INFO:lowlevel:DSM initialized
INFO:main:Opening source
INFO:lowlevel:starting source selection dialog
INFO:lowlevel:user selected source with id 827
INFO:lowlevel:opening data source with id 827
INFO:main:Request acquire
INFO:lowlevel:starting scan
INFO:main:Transferring image
INFO:lowlevel:closing data source with id 827
ERROR:main:Error: module 'twain.exceptions' has no attribute 'DSTransferCancelled'
The text was updated successfully, but these errors were encountered: