name: CI
on: push: branches: [main]
from flask import Flask, jsonify, request, abort | |
import datetime | |
import requests | |
import json | |
import logging | |
app=Flask(__name__) | |
# 默认路由,内网穿透地址: http://fishyer-flask.vaiwan.com | |
@app.route('/') |
def test(): | |
print("-------------------[test]-------------------") | |
# print(sys.path) | |
# cmd=f'python --version' | |
# cmd=f'ls -l' | |
# cmd=f'net time \\127.0.0.1' | |
# cmd=r"cd D:\Dropbox\MyObsidian\MyYuque\test && waque upload" | |
# cmdCode = os.system(cmd) | |
# cmdOutput = os.popen(cmd).read() | |
# print("cmd:", cmd) |
"scripts": { | |
"precommit": "lint-staged", | |
"postpack": "rm -f oclif.manifest.json", | |
"posttest": "tsc -p test --noEmit && tslint -p test -t stylish", | |
"prepack": "rm -rf lib && tsc && oclif-dev manifest", | |
"test": "nyc mocha --forbid-only \"test/**/*.test.ts\"", | |
"commitmsg": "commitlint -e $GIT_PARAMS", | |
"release": "standard-version" | |
}, |
def test(): | |
print("-------------------[test]-------------------") | |
# print(sys.path) | |
# cmd=f'python --version' | |
# cmd=f'where cmd' | |
# cmd=f'where ipconfig' | |
cmd=f'where python' | |
# cmdCode = os.system(cmd) | |
# cmdResult = os.popen(cmd).read() | |
print("cmd:", cmd) |
# print(processFommatter(r"D:\Dropbox\MyObsidian\yuque\test\exports\目录05\测试标题52.md")) | |
# print(processFommatter(r"D:\Dropbox\MyObsidian\yuque\test\exports\目录05\测试标题53.md")) | |
# print(processFommatter(r"D:\Dropbox\MyObsidian\yuque\test\exports\title-01.md")) | |
# print(processFommatter(r"D:\Dropbox\MyObsidian\yuque\test\exports\test-private.md")) |
import glob | |
import shutil | |
import dateutil.parser |
def getDate(md_file): | |
with open(md_file) as f: | |
md = frontmatter.load(f) | |
dt = md.metadata['date'] | |
if type(dt) == str: | |
# toml 格式下date被识别为字符串 | |
return dateutil.parser.parse(dt).date() | |
else: | |
# yaml 格式下date被识别为datetime,直接返回 | |
return dt.date() |
# traverseDirWithProcess(path,myProcess) | |
# files = glob.glob('*.md') | |
# if files: | |
# files.remove('_index.md') | |
# for f in files: | |
# date = getDate(f).isoformat() | |
# print(date) |