Esempio n. 1
0
 def run_domain_wizard(self):
     print('Domain.run_review_domain_wizard()')
     #print('domain code = ')
     #print(self.domain_code)
     '''
 domain-code
 '''
     if self.domain_code is None:
         UI.print('You do not have a domain code set up.')
         self.prompt_for_domain_code()
     elif UI.ask_boolean(
             '"{}" is set to your domain code. Would you like to change it?'
             .format(self.domain_code)):
         #print('ask boolean produced true')
         self.prompt_for_domain_code()
     '''
 domain-code
 '''
     pprint(self.port)
     if self.port is None:
         UI.print('You do not have a port set up.')
         self.prompt_for_port()
     elif UI.ask_boolean(
             '"{}" is set to your port. Would you like to change it?'.
             format(self.port)):
         self.prompt_for_port()
Esempio n. 2
0
    def run_wizard(self):
        #UI.print('Git.run_wizard()')
        # get repo name
        if not UI.ask_boolean("Is the name of the repo: {}?".format(
                self.repo_id)):
            self.repo_id = UI.ask("What is the name of the repo?")
        # check if folder is already a repo
        if self.is_git_repo():
            print('this is a git repo')
        else:
            # todo - check to see if thise repo exists on github first
            # note - had errors running this script due to the fact that the directory was not empty
            clone_cmd = 'git clone https://github.com/keithritt/{repo_id}.git {repo_dir}'.format(
                repo_id=self.repo_id, repo_dir=self.repo_dir)

            output = UI.run(cmd=clone_cmd, cwd='/home/ubuntu/')
            #todo - add logic to parse if response was an error
            print('output = {}'.format(output))

        self.current_branch = self.get_checked_out_branch()
        #print(branch)
        if self.env == 'dev' and self.current_branch != 'dev':
            #print('we need to check out the dev branch')
            if not self.does_branch_exist('dev'):
                self.create_branch('dev')

            self.checkout_branch('dev')

        if not self.is_upstream_set():
            self.set_upstream()
Esempio n. 3
0
 def prompt_for_domain_code(self):
     default = self.get_default_domain_code()
     if UI.ask_boolean(
             'Would you like to use {} as your domain code?'.format(
                 default)):
         self.domain_code = default
     else:
         self.domain_code = UI.ask(
             'What would you like to use for your domain code?')
Esempio n. 4
0
 def offer_rematch(self):
   if self.test_mode:
     if self.game_count < self.n:
       self.start_new_game()
     else:
       UI.exit('Thanks for playing!')
   else:
     if UI.ask_boolean('Play again? (y/n)'):
       self.start_new_game()
     else:
       print('Thanks for playing!')
Esempio n. 5
0
    def prompt_for_domain(self):
        #print('Domain.prompt_for_domain()')
        self.domain = 'brewskis.club'  #UI.ask('What domain are you working on?')

        pprint(self.config.all['domains'])
        if self.domain not in self.config.all['domains']:
            if not UI.ask_boolean(
                    'This domain: {} is not recognized. Is it new?'.format(
                        self.domain)):
                return self.prompt_for_domain()

        self.set_domain()
        return self.domain