'Determines if the user wants to check for updates.
On startup, the dev_appserver wants to check for updates to the SDK.
Because this action reports usage to Google when the user is not
otherwise communicating with Google (e.g. pushing a new app version),
the user must opt in.
If the user does not have a nag file, we will query the user and
save the response in the nag file.  Subsequent calls to this function
will re-use that response.
Args:
input_fn: used to collect user input. This is for testing only.
Returns:
True if the user wants to check for updates.  False otherwise.'

def AllowedToCheckForUpdates(self, input_fn=raw_input):

    nag = self._ParseNagFile()
    if (nag is None):
        nag = NagFile()
        nag.timestamp = 0.0
    if (nag.opt_in is None):
        answer = input_fn('Allow    dev_appserver    to    check    for    updates    on    startup?    (Y/n):    ')
        answer = answer.strip().lower()
        if ((answer == 'n') or (answer == 'no')):
            print ('dev_appserver    will    not    check    for    updates    on    startup.        To    change    this    setting,    edit    %s' % SDKUpdateChecker.MakeNagFilename())
            nag.opt_in = False
        else:
            print ('dev_appserver    will    check    for    updates    on    startup.        To    change    this    setting,    edit    %s' % SDKUpdateChecker.MakeNagFilename())
            nag.opt_in = True
        self._WriteNagFile(nag)
    return nag.opt_in
