source: orange/orange/orngServerFiles.py @ 8042:ffcb93bc9028

Revision 8042:ffcb93bc9028, 838 bytes checked in by markotoplak, 3 years ago (diff)

Hierarchical clustering: also catch RuntimeError when importing matplotlib (or the documentation could not be built on server).

Line 
1from Orange.misc.serverfiles import *
2import Orange
3
4#for backward compatibility
5
6def _sf_with_code(access_code=None):
7    if not access_code:
8        return ServerFiles()
9    else:
10        return ServerFiles(access_code=access_code)
11
12def needs_update(domain, filename, access_code=None):
13    sf = _sf_with_code(access_code=access_code)
14    return Orange.misc.serverfiles.needs_update(domain, filename, serverfiles=sf)
15
16def update(domain, filename, access_code=None, verbose=True):
17    sf = _sf_with_code(access_code=access_code)
18    return Orange.misc.serverfiles.update(domain, filename, serverfiles=sf, verbose=verbose)
19
20def createPathForFile(target):
21    try:
22        os.makedirs(os.path.dirname(target))
23    except OSError:
24        pass
25 
26def createPath(target):
27    try:
28        os.makedirs(target)
29    except OSError:
30        pass
Note: See TracBrowser for help on using the repository browser.