source: orange/Orange/orng/orngServerFiles.py @ 10582:180f600dfb15

Revision 10582:180f600dfb15, 841 bytes checked in by markotoplak, 2 years ago (diff)

Orange.misc to Orange.utils move: some more fixes.

Line 
1from Orange.utils.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.utils.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.utils.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.