This repository has been archived by the owner on Apr 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8-*- | ||
|
||
import os | ||
import shutil | ||
|
||
WORDS = [u"HUANCUN"] | ||
SLUG = "cleancache" | ||
PRIORITY = 0 | ||
|
||
|
||
def handle(text, mic, profile, wxbot=None): | ||
""" | ||
Reports the current time based on the user's timezone. | ||
Arguments: | ||
text -- user-input, typically transcribed speech | ||
mic -- used to interact with the user (for both input and output) | ||
profile -- contains information related to the user (e.g., phone | ||
number) | ||
wxBot -- wechat robot | ||
""" | ||
temp = mic.dingdangpath.TEMP_PATH | ||
shutil.rmtree(temp) | ||
os.mkdir(temp) | ||
mic.say(u'缓存目录已清空', cache=True) | ||
|
||
|
||
def isValid(text): | ||
""" | ||
Returns True if input is related to the time. | ||
Arguments: | ||
text -- user-input, typically transcribed speech | ||
""" | ||
return any(word in text.lower() for word in ["清除缓存", u"清空缓存", u"清缓存"]) |