Codebase list python-faraday / 43b6ca5
Refresh patches Sophie Brun 4 years ago
3 changed file(s) with 64 addition(s) and 85 deletion(s). Raw diff Collapse all Expand all
1515 faraday/server/commands/status_check.py | 124 ++++++++++++++++----------------
1616 3 files changed, 90 insertions(+), 90 deletions(-)
1717
18 diff --git a/faraday/client/start_client.py b/faraday/client/start_client.py
19 index eade808..8a06ea3 100755
2018 --- a/faraday/client/start_client.py
2119 +++ b/faraday/client/start_client.py
22 @@ -170,9 +170,9 @@ def getParserArgs():
20 @@ -180,9 +180,9 @@ def getParserArgs():
2321 default=None,
2422 help="File containing user's credentials to be used in CLI mode")
2523
3230 parser.add_argument('--keep-old', action='store_true', help='Keep old object in CLI mode if Faraday find a conflict')
3331 parser.add_argument('--keep-new', action='store_true', help='Keep new object in CLI mode if Faraday find a conflict (DEFAULT ACTION)')
3432
35 @@ -182,33 +182,33 @@ def getParserArgs():
33 @@ -192,33 +192,33 @@ def getParserArgs():
3634 return parser.parse_args()
3735
3836
8684
8785 def setConf():
8886 """
89 diff --git a/faraday/manage.py b/faraday/manage.py
90 index e1fefca..17662c7 100755
9187 --- a/faraday/manage.py
9288 +++ b/faraday/manage.py
93 @@ -141,9 +141,9 @@ def sql_shell():
89 @@ -100,9 +100,9 @@ def sql_shell():
9490 @click.command(help='Checks configuration and faraday status.')
9591 @click.option('--check_postgresql', default=False, is_flag=True)
9692 @click.option('--check_faraday', default=False, is_flag=True)
10298
10399 selected = False
104100 exit_code = 0
105 @@ -157,9 +157,9 @@ def status_check(check_postgresql, check_faraday, check_dependencies, check_conf
101 @@ -116,9 +116,9 @@ def status_check(check_postgresql, check
106102 status_check_functions.print_faraday_status()
107103 selected = True
108104
115111
116112 if check_config:
117113 status_check_functions.print_config_status()
118 diff --git a/faraday/server/commands/status_check.py b/faraday/server/commands/status_check.py
119 index 40c6fd1..56bc971 100644
120114 --- a/faraday/server/commands/status_check.py
121115 +++ b/faraday/server/commands/status_check.py
122116 @@ -20,7 +20,7 @@ from faraday.server.web import app
201195
202196
203197 def check_credentials():
204 @@ -255,34 +255,34 @@ def print_faraday_status():
198 @@ -256,31 +256,31 @@ def print_faraday_status():
205199 .format(yellow=Fore.YELLOW, white=Fore.WHITE))
206200
207201
209203 - """Prints Status of the dependencies using check_server_dependencies() and check_client_dependencies()"""
210204 -
211205 - status, server_dep = check_server_dependencies()
206 - red = Fore.RED
207 - white = Fore.WHITE
208 - green = Fore.GREEN
212209 - if status == True:
213 - print('[{red}-{white}] Some server dependencies are old: [' + ', '.join(server_dep) + ']. Update them with \"pip install -r requirements_server.txt -U\"') \
214 - .format(red=Fore.RED, white=Fore.WHITE)
210 - print(f"[{red}-{white}] Some server dependencies are old: [{', '.join(server_dep)}']. Update them with \"pip install -r requirements_server.txt -U\"")
215211 -
216212 - elif status == 0:
217 - print('[{red}-{white}] Client dependencies not met: [' + ', '.join(server_dep) + '] Install them with \"pip install -r requirements_server.txt -U\"')\
218 - .format(red=Fore.RED, white=Fore.WHITE)
213 - print(f"[{red}-{white}] Client dependencies not met: [{', '.join(server_dep)}'] Install them with \"pip install -r requirements_server.txt -U\"")
219214 -
220215 - else:
221 - print('[{green}+{white}] Server dependencies met' \
222 - .format(green=Fore.GREEN, white=Fore.WHITE))
216 - print(f'[{green}+{white}] Server dependencies met')
223217 -
224218 - status, client_dep = check_client_dependencies()
225219 - if status == True:
226 - print('[{red}-{white}] Some client dependencies are old: [' + ', '.join(client_dep) + ']. Update them with \"pip install -r requirements.txt -U\"') \
227 - .format(red=Fore.RED, white=Fore.WHITE)
220 - print(f"[{red}-{white}] Some client dependencies are old: [{', '.join(client_dep)}]. Update them with \"pip install -r requirements.txt -U\"")
228221 -
229222 - elif status == 0:
230 - print('[{red}-{white}] Client dependencies not met: [' + ', '.join(client_dep) + ']. Install them with \"pip install -r requirements.txt -U\"')\
231 - .format(red=Fore.RED, white=Fore.WHITE)
223 - print(f"[{red}-{white}] Client dependencies not met: [{', '.join(client_dep)}]. Install them with \"pip install -r requirements.txt -U\"")
232224 -
233225 - else:
234 - print('[{green}+{white}] Client dependencies met'\
235 - .format(green=Fore.GREEN, white=Fore.WHITE))
226 - print(f'[{green}+{white}] Client dependencies met')
236227 +#def print_depencencies_status():
237228 +# """Prints Status of the dependencies using check_server_dependencies() and check_client_dependencies()"""
238229 +#
239230 +# status, server_dep = check_server_dependencies()
231 +# red = Fore.RED
232 +# white = Fore.WHITE
233 +# green = Fore.GREEN
240234 +# if status == True:
241 +# print('[{red}-{white}] Some server dependencies are old: [' + ', '.join(server_dep) + ']. Update them with \"pip install -r requirements_server.txt -U\"') \
242 +# .format(red=Fore.RED, white=Fore.WHITE)
235 +# print(f"[{red}-{white}] Some server dependencies are old: [{', '.join(server_dep)}']. Update them with \"pip install -r requirements_server.txt -U\"")
243236 +#
244237 +# elif status == 0:
245 +# print('[{red}-{white}] Client dependencies not met: [' + ', '.join(server_dep) + '] Install them with \"pip install -r requirements_server.txt -U\"')\
246 +# .format(red=Fore.RED, white=Fore.WHITE)
238 +# print(f"[{red}-{white}] Client dependencies not met: [{', '.join(server_dep)}'] Install them with \"pip install -r requirements_server.txt -U\"")
247239 +#
248240 +# else:
249 +# print('[{green}+{white}] Server dependencies met' \
250 +# .format(green=Fore.GREEN, white=Fore.WHITE))
241 +# print(f'[{green}+{white}] Server dependencies met')
251242 +#
252243 +# status, client_dep = check_client_dependencies()
253244 +# if status == True:
254 +# print('[{red}-{white}] Some client dependencies are old: [' + ', '.join(client_dep) + ']. Update them with \"pip install -r requirements.txt -U\"') \
255 +# .format(red=Fore.RED, white=Fore.WHITE)
245 +# print(f"[{red}-{white}] Some client dependencies are old: [{', '.join(client_dep)}]. Update them with \"pip install -r requirements.txt -U\"")
256246 +#
257247 +# elif status == 0:
258 +# print('[{red}-{white}] Client dependencies not met: [' + ', '.join(client_dep) + ']. Install them with \"pip install -r requirements.txt -U\"')\
259 +# .format(red=Fore.RED, white=Fore.WHITE)
248 +# print(f"[{red}-{white}] Client dependencies not met: [{', '.join(client_dep)}]. Install them with \"pip install -r requirements.txt -U\"")
260249 +#
261250 +# else:
262 +# print('[{green}+{white}] Client dependencies met'\
263 +# .format(green=Fore.GREEN, white=Fore.WHITE))
251 +# print(f'[{green}+{white}] Client dependencies met')
264252
265253
266254 def print_config_status():
255 @@ -326,4 +326,4 @@ def full_status_check():
256
257 print('\n{white}Checking Faraday config...{white}'.format(white=Fore.WHITE))
258 print_config_status()
259 -# I'm Py3
260 \ No newline at end of file
261 +# I'm Py3
1010 faraday/utils/dependencies.py | 22 +++++++++++-----------
1111 2 files changed, 24 insertions(+), 24 deletions(-)
1212
13 diff --git a/faraday/server/commands/support.py b/faraday/server/commands/support.py
14 index 16e75ad..a2d53c4 100644
1513 --- a/faraday/server/commands/support.py
1614 +++ b/faraday/server/commands/support.py
17 @@ -5,10 +5,10 @@ from tqdm import tqdm
18 from colorama import init
19 from colorama import Fore, Style
15 @@ -8,10 +8,10 @@ from colorama import Fore, Style
16
17 import distro
2018
2119 -try:
2220 - from pip._internal.operations import freeze
2927
3028 import faraday.config.constant as constants
3129 from faraday.server.commands import status_check
32 @@ -32,14 +32,14 @@ def get_status_check(path):
30 @@ -35,14 +35,14 @@ def get_status_check(path):
3331 sys.stdout = original_stdout
3432
3533
4947 +# pip_file.write('\n')
5048 +# pip_file.close()
5149
50
5251 def get_logs(path):
53 #Copies the logs using the logs path saved on constants
54 @@ -60,7 +60,7 @@ def all_for_support():
52 @@ -71,7 +71,7 @@ def all_for_support():
5553 pbar.update(1)
5654 get_logs(path)
5755 pbar.update(1)
5856 - get_pip_freeze(path)
5957 +# get_pip_freeze(path)
6058 pbar.update(1)
61 make_zip(path)
59 revise_os(path)
6260 pbar.update(1)
63 @@ -68,4 +68,4 @@ def all_for_support():
64 pbar.update(1)
65
66 print('[{green}+{white}] Process Completed. A {bright}faraday_support.zip{normal} was generated'
67 - .format(green=Fore.GREEN, white=Fore.WHITE, bright=Style.BRIGHT, normal=Style.NORMAL))
68 \ No newline at end of file
69 + .format(green=Fore.GREEN, white=Fore.WHITE, bright=Style.BRIGHT, normal=Style.NORMAL))
70 diff --git a/faraday/utils/dependencies.py b/faraday/utils/dependencies.py
71 index 2ff854b..5a5efad 100644
7261 --- a/faraday/utils/dependencies.py
7362 +++ b/faraday/utils/dependencies.py
74 @@ -5,11 +5,11 @@ See the file 'doc/LICENSE' for the license information
63 @@ -5,11 +5,11 @@ See the file 'doc/LICENSE' for the licen
7564
76 '''
65 """
7766 import sys
7867 -try:
7968 - from pip import main
8877 import pkg_resources
8978
9079
91 @@ -36,9 +36,9 @@ def check_dependencies(requirements_file='requirements.txt'):
80 @@ -36,12 +36,12 @@ def check_dependencies(requirements_file
9281 return installed, missing, conflict
9382
9483
9988 - pip_cmd.append('--user')
10089 - main(pip_cmd)
10190 +#def install_packages(packages):
102 +# for package in packages:
103 +# pip_cmd = ['install', package, '-U']
104 +# if not hasattr(sys, 'real_prefix'):
105 +# pip_cmd.append('--user')
106 +# main(pip_cmd)
91 +# for package in packages:
92 +# pip_cmd = ['install', package, '-U']
93 +# if not hasattr(sys, 'real_prefix'):
94 +# pip_cmd.append('--user')
95 +# main(pip_cmd)
96
97
98 # I'm Py3
1212 requirements.txt | 2 --
1313 requirements_server.txt | 1 -
1414 3 files changed, 18 insertions(+), 21 deletions(-)
15
16 diff --git a/faraday/manage.py b/faraday/manage.py
17 index 17662c7..f0ec744 100755
1815 --- a/faraday/manage.py
1916 +++ b/faraday/manage.py
20 @@ -119,23 +119,23 @@ def import_from_couchdb():
21 def database_schema():
17 @@ -29,7 +29,7 @@ if platform.system() == "Linux":
18 import click
19 import requests
20 import alembic.command
21 -from pgcli.main import PGCli
22 +#from pgcli.main import PGCli
23 from requests import ConnectionError
24 from urllib.parse import urlparse
25 from alembic.config import Config
26 @@ -83,18 +83,18 @@ def database_schema():
2227 DatabaseSchema().run()
28
2329
2430 [email protected](help="Open a SQL Shell connected to postgresql 'Faraday DB'")
2531 -def sql_shell():
26 - try:
27 - from pgcli.main import PGCli
28 - except ImportError:
29 - print('PGCli was not found, please install it with: pip install pgcli')
30 - sys.exit(1)
3132 - conn_string = faraday.server.config.database.connection_string.strip("'")
3233 - conn_string = urlparse(conn_string)
3334 - parsed_conn_string = ("user={username} password={password} host={hostname} dbname={dbname}"
4041 - pgcli.run_cli()
4142 +#@click.command(help="Open a SQL Shell connected to postgresql 'Faraday DB'")
4243 +#def sql_shell():
43 +# try:
44 +# from pgcli.main import PGCli
45 +# except ImportError:
46 +# print('PGCli was not found, please install it with: pip install pgcli')
47 +# sys.exit(1)
4844 +# conn_string = faraday.server.config.database.connection_string.strip("'")
4945 +# conn_string = urlparse(conn_string)
5046 +# parsed_conn_string = ("user={username} password={password} host={hostname} dbname={dbname}"
5854
5955
6056 @click.command(help='Checks configuration and faraday status.')
61 @@ -287,7 +287,7 @@ cli.add_command(initdb)
62 cli.add_command(import_from_couchdb)
57 @@ -258,7 +258,7 @@ cli.add_command(show_urls)
58 cli.add_command(initdb)
6359 cli.add_command(database_schema)
6460 cli.add_command(create_superuser)
6561 -cli.add_command(sql_shell)
6763 cli.add_command(status_check)
6864 cli.add_command(create_tables)
6965 cli.add_command(change_password)
70 diff --git a/requirements.txt b/requirements.txt
71 index 68a194d..acd503a 100644
7266 --- a/requirements.txt
7367 +++ b/requirements.txt
7468 @@ -5,11 +5,9 @@ deprecation>=1.0.1
7771 mockito>=1.0.12
7872 -pgcli>=1.8.2
7973 requests>=2.18.4
80 tornado==4.5.1
74 tornado>=5.0.0
8175 tqdm>=4.15.0
8276 -whoosh>=2.7.4
8377 cairocffi==0.9.0
8478 pycairo==1.18.1
8579 PyGObject==3.32.1
86 diff --git a/requirements_server.txt b/requirements_server.txt
87 index bf8efc6..d15591f 100644
8880 --- a/requirements_server.txt
8981 +++ b/requirements_server.txt
9082 @@ -12,7 +12,6 @@ future>=0.17.1
9183 IPy>=0.83
9284 marshmallow<3.0.0
9385 Pillow>=4.2.1
94 -pgcli
95 psycopg2==2.7.7
86 -pgcli==2.1.1
87 psycopg2-binary==2.8.4
9688 pyasn1-modules>=0.0.11
9789 pyopenssl>=17.2.0