remove comment out lines by (disable creating repository)
@@ -1142,80 +1142,7 @@ class BrewFile:
print("GitHub repository: " + self.user_name() + "/"
+ self.repo_name() + " doesn't exist.")
print("Please create the repository first, then try again")
- # Disable direct repository creating for now
- # https://github.com/rcmdnk/homebrew-file/issues/104
- sys.exit(0)
-
- #ans = self.ask_yn("do you want to create the repository?")
- #if not ans:
- # sys.exit(0)
-
- ## Try to create w/o two-factor code
- #try:
- # import requests
- #except ImportError:
- # print("To create a repository, "
- # + "you need to install 'requests' module.")
- # ans = self.ask_yn("Do you want to install now?")
- # if not ans:
- # print("Please prepare Brewfile repository.")
- # sys.exit(0)
- # else:
- # ret = self.proc("pip --version", print_cmd=False,
- # print_out=False, exit_on_err=False)
- # if ret != 0:
- # self.proc("easy_install pip")
- # self.proc("pip install requests")
- # import requests
-
- #url = "https://api.github.com/user/repos"
- #description = "package list for Homebrew"
- #data = {"name": self.repo_name(), "description": description,
- # "auto_init": "true"}
- #headers = {}
- #is_ok = True
-
- ## Check password
- #password = getpass.getpass("GitHub password: ")
-
- #while True:
- # r = requests.post(url=url, data=json.dumps(data),
- # auth=(self.user_name(), password),
- # headers=headers)
- # if r.ok:
- # break
- # if r.json()["message"] == "Bad credentials":
- # password = getpass.getpass(
- # "\033[31;1mWrong password!\033[0m GitHub password: ")
- # continue
- # if r.json()["message"] ==\
- # "Must specify two-factor authentication OTP code.":
- # is_ok = False
- # break
- # self.err(r.json()["message"])
- # sys.exit(1)
-
- #if not is_ok:
- # # Try with two-factor code
- # twofac = input("GitHub two-factor code: ")
- # headers.update({"X-Github-OTP": twofac})
- # while True:
- # r = requests.post(url=url, data=json.dumps(data),
- # auth=(self.user_name(), password),
- # headers=headers)
- # if r.ok:
- # break
- # if r.json()["message"] ==\
- # "Must specify two-factor authentication OTP code.":
- # twofac = getpass.getpass("\033[31;1mWrong code!\033[0m "
- # "GitHub two-factor code: ")
- # headers.update({"X-Github-OTP": twofac})
- # continue
- # self.err(r.json()["message"], 0)
- # sys.exit(1)
-
- ## Clone and initialize
- #self.clone_repo()
+ sys.exit(1)
def check_local_repo(self):
dirname = self.opt["repo"].replace("file:///", "")
