mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-02 07:54:27 +00:00
Fixed pylint warnings.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
'''This script would guide the seafile admin to setup seafile with MySQL'''
|
'''This script would guide the seafile admin to setup seafile with MySQL'''
|
||||||
|
|
||||||
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
@@ -13,12 +14,12 @@ import hashlib
|
|||||||
import getpass
|
import getpass
|
||||||
import uuid
|
import uuid
|
||||||
import warnings
|
import warnings
|
||||||
import MySQLdb
|
|
||||||
import argparse
|
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
from ConfigParser import ConfigParser
|
from ConfigParser import ConfigParser
|
||||||
|
|
||||||
|
import MySQLdb
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import readline # pylint: disable=W0611
|
import readline # pylint: disable=W0611
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@@ -380,6 +381,9 @@ class AbstractDBConfigurator(AbstractConfigurator):
|
|||||||
self.seafile_mysql_password = ''
|
self.seafile_mysql_password = ''
|
||||||
self.seafile_mysql_userhost = 'localhost'
|
self.seafile_mysql_userhost = 'localhost'
|
||||||
|
|
||||||
|
self.root_password = ''
|
||||||
|
self.root_conn = ''
|
||||||
|
|
||||||
self.ccnet_db_name = ''
|
self.ccnet_db_name = ''
|
||||||
self.seafile_db_name = ''
|
self.seafile_db_name = ''
|
||||||
self.seahub_db_name = ''
|
self.seahub_db_name = ''
|
||||||
@@ -538,9 +542,6 @@ class NewDBConfigurator(AbstractDBConfigurator):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
AbstractDBConfigurator.__init__(self)
|
AbstractDBConfigurator.__init__(self)
|
||||||
|
|
||||||
self.root_password = ''
|
|
||||||
self.root_conn = ''
|
|
||||||
|
|
||||||
def ask_questions(self):
|
def ask_questions(self):
|
||||||
self.ask_mysql_host_port()
|
self.ask_mysql_host_port()
|
||||||
|
|
||||||
@@ -1282,6 +1283,7 @@ def check_params(args):
|
|||||||
global db_config
|
global db_config
|
||||||
|
|
||||||
use_existing_db = get_param_val(args.use_existing_db, 'USE_EXISTING_DB', '0')
|
use_existing_db = get_param_val(args.use_existing_db, 'USE_EXISTING_DB', '0')
|
||||||
|
# pylint: disable=redefined-variable-type
|
||||||
if use_existing_db == '0':
|
if use_existing_db == '0':
|
||||||
db_config = NewDBConfigurator()
|
db_config = NewDBConfigurator()
|
||||||
elif use_existing_db == '1':
|
elif use_existing_db == '1':
|
||||||
@@ -1403,6 +1405,7 @@ def main():
|
|||||||
seafile_config.ask_questions()
|
seafile_config.ask_questions()
|
||||||
seahub_config.ask_questions()
|
seahub_config.ask_questions()
|
||||||
|
|
||||||
|
# pylint: disable=redefined-variable-type
|
||||||
if not db_config:
|
if not db_config:
|
||||||
if AbstractDBConfigurator.ask_use_existing_db():
|
if AbstractDBConfigurator.ask_use_existing_db():
|
||||||
db_config = ExistingDBConfigurator()
|
db_config = ExistingDBConfigurator()
|
||||||
|
Reference in New Issue
Block a user