資源簡介
bootstrap-3.2.0資源文件,內含源碼,以及各種實例,特別好用。可以進網(wǎng)站得到最新版本

代碼片段和文件信息
#!/usr/bin/env?python2.7
#?pylint:?disable=C0301
from?__future__?import?absolute_import?unicode_literals?print_function?division
from?sys?import?argv
from?os?import?environ?stat?chdir?remove?as?_delete_file
from?os.path?import?dirname?basename?abspath?realpath?expandvars
from?hashlib?import?sha256
from?subprocess?import?check_call?as?run
from?json?import?load?dump?as?save
from?contextlib?import?contextmanager
from?datetime?import?datetime
from?boto.s3.connection?import?S3Connection
from?boto.s3.key?import?Key
from?boto.exception?import?S3ResponseError
CONFIG_FILE?=?‘./S3Cachefile.json‘
UPLOAD_TODO_FILE?=?‘./S3CacheTodo.json‘
BYTES_PER_MB?=?1024?*?1024
@contextmanager
def?timer():
????start?=?datetime.utcnow()
????yield
????end?=?datetime.utcnow()
????elapsed?=?end?-?start
????print(“\tDone.?Took“?int(elapsed.total_seconds())?“second(s).“)
@contextmanager
def?todo_file(writeback=True):
????try:
????????with?open(UPLOAD_TODO_FILE?‘rt‘)?as?json_file:
????????????todo?=?load(json_file)
????except?(IOError?OSError?ValueError):
????????todo?=?{}
????yield?todo
????if?writeback:
????????try:
????????????with?open(UPLOAD_TODO_FILE?‘wt‘)?as?json_file:
????????????????save(todo?json_file)
????????except?(OSError?IOError)?as?save_err:
????????????print(“Error?saving?{}:“.format(UPLOAD_TODO_FILE)?save_err)
def?_sha256_of_file(filename):
????hasher?=?sha256()
????with?open(filename?‘rb‘)?as?input_file:
????????hasher.update(input_file.read())
????file_hash?=?hasher.hexdigest()
????print(‘sha256({})?=?{}‘.format(filename?file_hash))
????return?file_hash
def?_delete_file_quietly(filename):
????try:
????????_delete_file(filename)
????except?(OSError?IOError):
????????pass
def?mark_needs_uploading(cache_name):
????with?todo_file()?as?todo:
????????todo[cache_name]?=?True
def?mark_uploaded(cache_name):
????with?todo_file()?as?todo:
????????todo.pop(cache_name?None)
def?need_to_upload(cache_name):
????with?todo_file(writeback=False)?as?todo:
????????return?todo.get(cache_name?False)
def?_tarball_size(directory):
????kib?=?stat(_tarball_filename_for(directory)).st_size?//?BYTES_PER_MB
????return?“{}?MiB“.format(kib)
def?_tarball_filename_for(directory):
????return?abspath(‘./{}.tar.gz‘.format(basename(directory)))
def?_create_tarball(directory):
????print(“Creating?tarball?of?{}...“.format(directory))
????with?timer():
????????run([‘tar‘?‘-czf‘?_tarball_filename_for(directory)?‘-C‘?dirname(directory)?basename(directory)])
def?_extract_tarball(directory):
????print(“Extracting?tarball?of?{}...“.format(directory))
????with?timer():
????????run([‘tar‘?‘-xzf‘?_tarball_filename_for(directory)?‘-C‘?dirname(directory)])
def?download(directory):
????mark_uploaded(cache_name)??#?reset
????try:
????????print(“Downloading?{}?tarball?from?S3...“.format(cache_name))
????????with?timer():
????????????key.get_contents_to_filename(_tarball_filename_for(directory))
????except?S3ResponseError?as?err:
????????mark_needs_u
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-06-26?16:36??bootstrap-3.2.0\
?????文件?????????191??2014-06-26?16:36??bootstrap-3.2.0\.editorconfig
?????文件?????????184??2014-06-26?16:36??bootstrap-3.2.0\.gitattributes
?????文件?????????451??2014-06-26?16:36??bootstrap-3.2.0\.gitignore
?????文件????????2007??2014-06-26?16:36??bootstrap-3.2.0\.travis.yml
?????文件??????????17??2014-06-26?16:36??bootstrap-3.2.0\CNAME
?????文件????????8384??2014-06-26?16:36??bootstrap-3.2.0\CONTRIBUTING.md
?????文件???????12948??2014-06-26?16:36??bootstrap-3.2.0\Gruntfile.js
?????文件????????1084??2014-06-26?16:36??bootstrap-3.2.0\LICENSE
?????文件????????5883??2014-06-26?16:36??bootstrap-3.2.0\README.md
?????文件????????1066??2014-06-26?16:36??bootstrap-3.2.0\_config.yml
?????文件?????????849??2014-06-26?16:36??bootstrap-3.2.0\bower.json
?????文件?????????743??2014-06-26?16:36??bootstrap-3.2.0\composer.json
?????目錄???????????0??2014-06-26?16:36??bootstrap-3.2.0\dist\
?????目錄???????????0??2014-06-26?16:36??bootstrap-3.2.0\dist\css\
?????文件???????21368??2014-06-26?16:36??bootstrap-3.2.0\dist\css\bootstrap-theme.css
?????文件???????23071??2014-06-26?16:36??bootstrap-3.2.0\dist\css\bootstrap-theme.css.map
?????文件???????18860??2014-06-26?16:36??bootstrap-3.2.0\dist\css\bootstrap-theme.min.css
?????文件??????132546??2014-06-26?16:36??bootstrap-3.2.0\dist\css\bootstrap.css
?????文件??????220790??2014-06-26?16:36??bootstrap-3.2.0\dist\css\bootstrap.css.map
?????文件??????109518??2014-06-26?16:36??bootstrap-3.2.0\dist\css\bootstrap.min.css
?????目錄???????????0??2014-06-26?16:36??bootstrap-3.2.0\dist\fonts\
?????文件???????20335??2014-06-26?16:36??bootstrap-3.2.0\dist\fonts\glyphicons-halflings-regular.eot
?????文件???????62927??2014-06-26?16:36??bootstrap-3.2.0\dist\fonts\glyphicons-halflings-regular.svg
?????文件???????41280??2014-06-26?16:36??bootstrap-3.2.0\dist\fonts\glyphicons-halflings-regular.ttf
?????文件???????23320??2014-06-26?16:36??bootstrap-3.2.0\dist\fonts\glyphicons-halflings-regular.woff
?????目錄???????????0??2014-06-26?16:36??bootstrap-3.2.0\dist\js\
?????文件???????60681??2014-06-26?16:36??bootstrap-3.2.0\dist\js\bootstrap.js
?????文件???????31819??2014-06-26?16:36??bootstrap-3.2.0\dist\js\bootstrap.min.js
?????目錄???????????0??2014-06-26?16:36??bootstrap-3.2.0\docs\
?????文件???????19466??2014-06-26?16:36??bootstrap-3.2.0\docs\LICENSE
............此處省略369個文件信息
- 上一篇:YY0505標準
- 下一篇:NOIP 數(shù)據(jù)結構課件
評論
共有 條評論