本文整理匯總了Python中matplotlib.cbook._lock_path方法的典型用法代碼示例。如果您正苦於以下問題:Python cbook._lock_path方法的具體用法?Python cbook._lock_path怎麽用?Python cbook._lock_path使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類matplotlib.cbook
的用法示例。
在下文中一共展示了cbook._lock_path方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _rebuild
# 需要導入模塊: from matplotlib import cbook [as 別名]
# 或者: from matplotlib.cbook import _lock_path [as 別名]
def _rebuild():
global fontManager
fontManager = FontManager()
with cbook._lock_path(_fmcache):
json_dump(fontManager, _fmcache)
_log.info("generated new fontManager")
示例2: make_dvi
# 需要導入模塊: from matplotlib import cbook [as 別名]
# 或者: from matplotlib.cbook import _lock_path [as 別名]
def make_dvi(self, tex, fontsize):
"""
Generate a dvi file containing latex's layout of tex string.
Return the file name.
"""
if rcParams['text.latex.preview']:
return self.make_dvi_preview(tex, fontsize)
basefile = self.get_basefile(tex, fontsize)
dvifile = '%s.dvi' % basefile
if not os.path.exists(dvifile):
texfile = self.make_tex(tex, fontsize)
with cbook._lock_path(texfile):
self._run_checked_subprocess(
["latex", "-interaction=nonstopmode", "--halt-on-error",
texfile], tex)
for fname in glob.glob(basefile + '*'):
if not fname.endswith(('dvi', 'tex')):
try:
os.remove(fname)
except OSError:
pass
return dvifile
示例3: _rebuild
# 需要導入模塊: from matplotlib import cbook [as 別名]
# 或者: from matplotlib.cbook import _lock_path [as 別名]
def _rebuild():
global fontManager
fontManager = FontManager()
if _fmcache:
with cbook._lock_path(_fmcache):
json_dump(fontManager, _fmcache)
_log.debug("generated new fontManager")