Ignore:
Timestamp:
Aug 2, 2017 9:45:09 AM (5 years ago)
Author:
riza
Message:

Close #2034: Add support to Python3 using PJSUA2 API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pygui/endpoint.py

    r4704 r5638  
    2121import sys 
    2222if sys.version_info[0] >= 3: # Python 3 
    23         import tkinter as tk 
    24         from tkinter import ttk 
    25         from tkinter import messagebox as msgbox 
     23    import tkinter as tk 
     24    from tkinter import ttk 
     25    from tkinter import messagebox as msgbox 
    2626else: 
    27         import Tkinter as tk 
    28         import tkMessageBox as msgbox 
    29         import ttk 
     27    import Tkinter as tk 
     28    import tkMessageBox as msgbox 
     29    import ttk 
    3030 
    3131import pjsua2 as pj 
     
    3434 
    3535class Endpoint(pj.Endpoint): 
    36         """ 
    37         This is high level Python object inherited from pj.Endpoint 
    38         """ 
    39         instance = None 
    40         def __init__(self): 
    41                 pj.Endpoint.__init__(self) 
    42                 Endpoint.instance = self 
    43          
    44          
     36    """ 
     37    This is high level Python object inherited from pj.Endpoint 
     38    """ 
     39    instance = None 
     40    def __init__(self): 
     41        pj.Endpoint.__init__(self) 
     42        Endpoint.instance = self 
     43 
     44 
    4545def validateUri(uri): 
    46         return Endpoint.instance.utilVerifyUri(uri) == pj.PJ_SUCCESS 
     46    return Endpoint.instance.utilVerifyUri(uri) == pj.PJ_SUCCESS 
    4747 
    4848def validateSipUri(uri): 
    49         return Endpoint.instance.utilVerifySipUri(uri) == pj.PJ_SUCCESS 
     49    return Endpoint.instance.utilVerifySipUri(uri) == pj.PJ_SUCCESS 
    5050 
    5151 
    5252if __name__ == '__main__': 
    53         application.main() 
     53    application.main() 
Note: See TracChangeset for help on using the changeset viewer.