资源简介
该资源只在github有更新,但github国内用户下载龟速,解决快速下载使用的痛点。seafile-server_7.0.5是目前最新版的服务端安装包。
代码片段和文件信息
#coding: UTF-8
‘‘‘This script would check if there is admin and prompt the user to create a new one if non exist‘‘‘
import json
import sys
import os
import time
import re
import shutil
import glob
import subprocess
import hashlib
import getpass
import uuid
import warnings
from ConfigParser import ConfigParser
try:
import readline # pylint: disable=W0611
except ImportError:
pass
SERVER_MANUAL_HTTP = ‘https://github.com/haiwen/seafile/wiki‘
class Utils(object):
‘‘‘Groups all helper functions here‘‘‘
@staticmethod
def welcome():
‘‘‘Show welcome message‘‘‘
welcome_msg = ‘‘‘\
-----------------------------------------------------------------
This script will guide you to setup your seafile server using MySQL.
Make sure you have read seafile server manual at
%s
Press ENTER to continue
-----------------------------------------------------------------‘‘‘ % SERVER_MANUAL_HTTP
print welcome_msg
raw_input()
@staticmethod
def highlight(content):
‘‘‘Add ANSI color to content to get it highlighted on terminal‘‘‘
return ‘\x1b[33m%s\x1b[m‘ % content
@staticmethod
def info(msg):
print msg
@staticmethod
def error(msg):
‘‘‘Print error and exit‘‘‘
print
print ‘Error: ‘ + msg
sys.exit(1)
@staticmethod
def run_argv(argv cwd=None env=None suppress_stdout=False suppress_stderr=False):
‘‘‘Run a program and wait it to finish and return its exit code. The
standard output of this program is supressed.
‘‘‘
with open(os.devnull ‘w‘) as devnull:
if suppress_stdout:
stdout = devnull
else:
stdout = sys.stdout
if suppress_stderr:
stderr = devnull
else:
stderr = sys.stderr
proc = subprocess.Popen(argv
cwd=cwd
stdout=stdout
stderr=stderr
env=env)
return proc.wait()
@staticmethod
def run(cmdline cwd=None env=None suppress_stdout=False suppress_stderr=False):
‘‘‘Like run_argv but specify a command line string instead of argv‘‘‘
with open(os.devnull ‘w‘) as devnull:
if suppress_stdout:
stdout = devnull
else:
stdout = sys.stdout
if suppress_stderr:
stderr = devnull
else:
stderr = sys.stderr
proc = subprocess.Popen(cmdline
cwd=cwd
stdout=stdout
stderr=stderr
env=env
shell=True)
return proc.wait()
@staticmethod
def prepend_env_value(name value env=None
相关资源
- Linux环境下C编程指南-第2版-杨树青清
- CanFestival移植到arm的am3359
- 深入理解linux内核第三版.zip
- linux管道通信例程
- 支持IDEA中文输入的JRE环境
- 跟老男孩学Linux运维:Shell编程实战
- LINUX内核完全剖析:基于0.12内核
- jdk-8u171-linux-i586.tar.gz和zookeeper-3.4.6.
- jdk-8u144-linux-x64.tar.gz.zip
- Nextcloud 服务端 源代码安装包nextclou
- 后台开发:核心技术与应用实践.徐晓
- centos下nvidia-docker2环境安装离线安装资
- xampp-linux-x64-1.8.2-5-installer
- update_MapleStory_service_linux_arm64_amd64_aa
- gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnue
- 基于linux c实现web服务器
- Ext4研究与性能分析
- 《鸟哥的Linux私房菜-基础篇》第四版
- I.MX6U嵌入式Linux驱动开发指南V1.0.pdf
- 魔力宝贝网游win版服务端
- MQTT 服务器和客户端工具及使用说明
- 深入理解linux内核(第三版中文).p
- Linux 内核设计的艺术第2版 : -图解Li
- mongodb-linux-x86_64-4.0.8.tgz
- linux2.6源码
- (带超细书签)(第二版)Linux内核
- linux网络源码分析
- 《Linux命令行大全》.((美)William
- Linux从入门到精通(第2版).pdf
- mongodb-linux-x86_64-rhel70-4.2.1.tgz
评论
共有 条评论