1
1
from pathlib import Path
2
2
from pythonanywhere .api import Webapp
3
3
from pythonanywhere .exceptions import SanityException
4
- from pythonanywhere .virtualenvs import Virtualenv , virtualenv_path
4
+ from pythonanywhere .virtualenvs import Virtualenv
5
5
6
6
7
7
class Project :
@@ -10,7 +10,6 @@ def __init__(self, domain, python_version):
10
10
self .python_version = python_version
11
11
self .project_path = Path (f'~/{ domain } ' ).expanduser ()
12
12
self .virtualenv = Virtualenv (self .domain , self .python_version )
13
- self .virtualenv_path = virtualenv_path (domain )
14
13
self .wsgi_file_path = Path (f'/var/www/{ domain .replace ("." , "_" )} _wsgi.py' )
15
14
self .webapp = Webapp (domain )
16
15
@@ -19,7 +18,7 @@ def sanity_checks(self, nuke):
19
18
self .webapp .sanity_checks (nuke = nuke )
20
19
if nuke :
21
20
return
22
- if self .virtualenv_path .exists ():
21
+ if self .virtualenv . path .exists ():
23
22
raise SanityException (f'You already have a virtualenv for { self .domain } .\n \n Use the --nuke option if you want to replace it.' )
24
23
if self .project_path .exists ():
25
24
raise SanityException (f'You already have a project folder at { self .project_path } .\n \n Use the --nuke option if you want to replace it.' )
@@ -30,7 +29,7 @@ def create_virtualenv(self, nuke):
30
29
31
30
32
31
def create_webapp (self , nuke ):
33
- self .webapp .create (self .python_version , self .virtualenv_path , self .project_path , nuke = nuke )
32
+ self .webapp .create (self .python_version , self .virtualenv . path , self .project_path , nuke = nuke )
34
33
35
34
36
35
def add_static_file_mappings (self ):
0 commit comments