Compare commits
10 Commits
b742a0ef61
...
46b534d447
Author | SHA1 | Date | |
---|---|---|---|
46b534d447 | |||
aba9020f34 | |||
8a4a8eaa32 | |||
67ce19ca44 | |||
fefee3c3ea | |||
9bc2752fab | |||
d17e9cf880 | |||
8dd1a9f612 | |||
7775cdc6a2 | |||
d7b8c2f974 |
@ -2,6 +2,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import enum
|
import enum
|
||||||
import threading
|
import threading
|
||||||
|
import shutil
|
||||||
import collections
|
import collections
|
||||||
import datetime
|
import datetime
|
||||||
import functools
|
import functools
|
||||||
@ -22,6 +23,9 @@ import time
|
|||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def custom_notify(
|
def custom_notify(
|
||||||
title=None,
|
title=None,
|
||||||
msg=None,
|
msg=None,
|
||||||
@ -1141,7 +1145,7 @@ def http_server(argv):
|
|||||||
else:
|
else:
|
||||||
path = options.token
|
path = options.token
|
||||||
|
|
||||||
print(
|
logger.info(
|
||||||
'access url is http://%s:%d/%s/' % (
|
'access url is http://%s:%d/%s/' % (
|
||||||
options.host,
|
options.host,
|
||||||
options.port,
|
options.port,
|
||||||
@ -1258,7 +1262,8 @@ http {
|
|||||||
) as f:
|
) as f:
|
||||||
f.write(r'''
|
f.write(r'''
|
||||||
server {
|
server {
|
||||||
listen 80;
|
server_name %s;
|
||||||
|
listen %d;
|
||||||
charset UTF-8;
|
charset UTF-8;
|
||||||
client_max_body_size 2K;
|
client_max_body_size 2K;
|
||||||
|
|
||||||
@ -1272,20 +1277,24 @@ server {
|
|||||||
%s
|
%s
|
||||||
}
|
}
|
||||||
''' % (
|
''' % (
|
||||||
|
options.host,
|
||||||
|
options.port,
|
||||||
DATA_DIR,
|
DATA_DIR,
|
||||||
location_section,
|
location_section,
|
||||||
))
|
))
|
||||||
|
|
||||||
subprocess.check_call(
|
sys.stderr.flush()
|
||||||
r'''
|
sys.stdout.flush()
|
||||||
exec nginx -c $CONF_DIR/nginx.conf -p $DATA_DIR -g "daemon off;"
|
|
||||||
''',
|
os.execv(
|
||||||
env=dict(
|
'/usr/sbin/nginx',
|
||||||
CONF_DIR=CONF_DIR,
|
[
|
||||||
DATA_DIR=DATA_DIR,
|
'/usr/sbin/nginx',
|
||||||
#APP_DIR=APP_DIR,
|
'-c',
|
||||||
),
|
os.path.join(CONF_DIR, 'nginx.conf'),
|
||||||
shell=True,
|
'-p', DATA_DIR,
|
||||||
|
'-g', 'daemon off;',
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
def pass_ssh_osx(argv):
|
def pass_ssh_osx(argv):
|
||||||
@ -3355,6 +3364,7 @@ def media_keys(argv):
|
|||||||
|
|
||||||
def commands_cli():
|
def commands_cli():
|
||||||
logging.getLogger().setLevel(logging.INFO)
|
logging.getLogger().setLevel(logging.INFO)
|
||||||
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
msg = None
|
msg = None
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ set backspace=indent,eol,start
|
|||||||
|
|
||||||
set mouse=a
|
set mouse=a
|
||||||
au FileType netrw nmap <buffer> <LeftMouse> <LeftMouse> <CR>
|
au FileType netrw nmap <buffer> <LeftMouse> <LeftMouse> <CR>
|
||||||
|
au FocusLost * silent! wa
|
||||||
|
|
||||||
set term=xterm-256color
|
set term=xterm-256color
|
||||||
|
|
||||||
@ -28,12 +29,34 @@ set hls
|
|||||||
colorscheme morning
|
colorscheme morning
|
||||||
hi MatchParen guifg=white guibg=black gui=NONE ctermfg=1 ctermbg=0
|
hi MatchParen guifg=white guibg=black gui=NONE ctermfg=1 ctermbg=0
|
||||||
|
|
||||||
|
function! MakeSession()
|
||||||
|
let b:sessiondir = '.vim/'
|
||||||
|
if (filewritable(b:sessiondir) != 2)
|
||||||
|
exe 'silent !mkdir -p ' b:sessiondir
|
||||||
|
redraw!
|
||||||
|
endif
|
||||||
|
let b:filename = b:sessiondir . '/session.vim'
|
||||||
|
exe "mksession! " . b:filename
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LoadSession()
|
||||||
|
let b:sessiondir = '.vim/'
|
||||||
|
let b:sessionfile = b:sessiondir . "/session.vim"
|
||||||
|
if (filereadable(b:sessionfile))
|
||||||
|
exe 'source ' b:sessionfile
|
||||||
|
else
|
||||||
|
echo "No session loaded."
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
map <Leader>w <C-w>
|
map <Leader>w <C-w>
|
||||||
map <Leader>wo :py3 print('fuck')<CR>
|
map <Leader>wo :py3 print('fuck')<CR>
|
||||||
map <Leader>z :wqa<CR>
|
map <Leader>z :wqa<CR>
|
||||||
map <Leader>m :py3 f1()<CR>
|
map <Leader>m :py3 f1()<CR>
|
||||||
map <Leader>r :redraw!<CR>
|
map <Leader>r :redraw!<CR>
|
||||||
|
map <Leader>s :call MakeSession()<CR>
|
||||||
|
map <Leader>l :call LoadSession()
|
||||||
map <Leader>cq :cq<CR>
|
map <Leader>cq :cq<CR>
|
||||||
map <Leader>f2 :py3 f2()<CR>
|
map <Leader>f2 :py3 f2()<CR>
|
||||||
map <Leader>f3 :source ~/.vimrc<CR>:echo 'reloaded'<CR>
|
map <Leader>f3 :source ~/.vimrc<CR>:echo 'reloaded'<CR>
|
||||||
|
Loading…
Reference in New Issue
Block a user