示例#1
0
def MainMenu():

    # Attempt to log in
    logged_in = US_Account.LoggedIn()
    if not logged_in:
        logged_in = US_Account.TryLogIn()

    oc = ObjectContainer(no_cache=True)

    if logged_in:

        oc.add(DirectoryObject(key=Callback(UserList), title='TV & Movies'))
        oc.add(
            DirectoryObject(key=Callback(
                MenuItem,
                url='http://api-public.netflix.com/users/%s/queues/instant' %
                US_Account.GetUserId(),
                title='Instant Queue',
                is_queue=True),
                            title='Instant Queue'))
        oc.add(
            InputDirectoryObject(key=Callback(Search),
                                 title='Search',
                                 prompt='Search for a Movie or TV Show...'))

    oc.add(PrefsObject(title='Preferences'))

    return oc
示例#2
0
def MainMenu():

    # Attempt to log in
    logged_in = US_Account.LoggedIn()
    if not logged_in:
        logged_in = US_Account.TryLogIn()

    oc = ObjectContainer(no_cache=True)

    if logged_in:

        oc.add(DirectoryObject(key=Callback(UserList), title='TV & Movies'))
        oc.add(
            DirectoryObject(key=Callback(
                MenuItem,
                url='http://api-public.netflix.com/users/%s/queues/instant' %
                US_Account.GetUserId(),
                title='Instant Queue',
                is_queue=True),
                            title='Instant Queue'))
        oc.add(
            InputDirectoryObject(key=Callback(Search),
                                 title='Search',
                                 prompt='Search for a Movie or TV Show...'))

    else:

        # The user has not yet provided valid credentials. Therefore, we should allow them to be redirected
        # to sign up for a free trial.
        if Client.Platform in ('MacOSX', 'Windows'):
            oc.add(
                DirectoryObject(key=Callback(FreeTrial),
                                title='Sign up for free trial'))

    oc.add(PrefsObject(title='Preferences'))

    return oc