Removed installing packages in the runtime

This commit is contained in:
Ali Parlakci
2018-07-11 23:59:14 +03:00
parent f1a9f1d3e4
commit 2994adea38
3 changed files with 3 additions and 25 deletions

View File

@@ -4,19 +4,13 @@ import sys
import urllib.request import urllib.request
from pathlib import Path from pathlib import Path
import imgurpython
from src.errors import (AlbumNotDownloadedCompletely, FileAlreadyExistsError, from src.errors import (AlbumNotDownloadedCompletely, FileAlreadyExistsError,
FileNameTooLong, ImgurLoginError, FileNameTooLong, ImgurLoginError,
NotADownloadableLinkError) NotADownloadableLinkError)
from src.tools import GLOBAL, nameCorrector, printToFile from src.tools import GLOBAL, nameCorrector, printToFile
try:
from imgurpython import *
except ModuleNotFoundError:
print("\nimgurpython not found on your computer, installing...\n")
from src.tools import install
install("imgurpython")
from imgurpython import *
VanillaPrint = print VanillaPrint = print
print = printToFile print = printToFile

View File

@@ -3,14 +3,7 @@ import random
import socket import socket
import webbrowser import webbrowser
try: import praw
import praw
except ModuleNotFoundError:
print("\nPRAW not found on your computer, installing...\n")
from src.tools import install
install("praw")
import praw
from prawcore.exceptions import NotFound, ResponseException, Forbidden from prawcore.exceptions import NotFound, ResponseException, Forbidden
from src.tools import GLOBAL, createLogFile, jsonFile, printToFile from src.tools import GLOBAL, createLogFile, jsonFile, printToFile

View File

@@ -2,20 +2,11 @@ import io
import json import json
import sys import sys
import time import time
try:
from pip import main as pipmain
except:
from pip._internal import main as pipmain
from os import makedirs, path, remove from os import makedirs, path, remove
from pathlib import Path from pathlib import Path
from src.errors import FileNotFoundError from src.errors import FileNotFoundError
def install(package):
pipmain(['install', package])
class GLOBAL: class GLOBAL:
"""Declare global variables""" """Declare global variables"""