Known subclasses: cocopp.archiving._ArchivesOfficial, cocopp.archiving.ArchivesKnown, cocopp.archiving.ArchivesLocal

List of URLs or path names to COCO data archives available to this user.

Elements can be added with append and deleted with the respective list operations. After any of these operations, the current state can be made "permanent" with save.

Archives created with create are automatically added to ArchivesLocal to find splattered archives more easily, archives retrieved from a remote location with get are added to ArchivesKnown.

Elements of the list are meant to be used directly as argument to get.

>>> import cocopp.archiving as ar
>>> ar.ListOfArchives.lists()  # doctest:+ELLIPSIS
{...

returns all available archive lists.

To reassign a given list:

>>> l = ar.ListOfArchives('test')
>>> l[:] = ['p2', 'p1']  # re-assign a new value to the list
>>> l.sort()  # `list` builtin in-place sort method
>>> l.save()  # doctest:+SKIP

To save the list, a listing name needs to be given on instantiation. Two inherited classes are

>>> ar.ArchivesKnown() and ar.ArchivesLocal()  # doctest:+ELLIPSIS
[...

where the former contains downloaded "inofficial" archives. To add all locally created archives within the user home directory tree (CAVEAT: the search may take a while):

>>> al = ar.ArchivesLocal()  # based on user home
>>> al._walk()  # doctest:+SKIP
>>> al._save_walk()  # add found paths (permanently) to the ArchivesLocal class

Details: duplicates are removed during save. Path names are stored as absolute path names (OS-dependent).

TODO: should we be able to generate a list on the fly? Figure out usecase with _walk?

TODO-decide: usecase, when to decide setting search_folder?

Method __init__ print available archive lists if no listing file is given
Method name name of this list
Static Method lists Undocumented
Class Method register add folder path or url to list of archives.
Method save save current list making changes permanent
Method remote_update join in the respective list from http://coco.gforge.inria.fr/data-archives.
Method update update self from the listing file that may have changed
Static Method _name Undocumented
Static Method _file Undocumented
Static Method _fullfile Undocumented
Method _makepathsabsolute Undocumented
Method _remove_double_entries keep the first of duplicated entries
Method _walk recursive search for COCO data archives in folder on disk.
Method _save_walk extend self by elements of _last_walk not in self and save
def __init__(self, listing_name=None):
print available archive lists if no listing file is given
@property
def name(self):
name of this list
@staticmethod
def _name(listing_file):
Undocumented
@staticmethod
def _file(listing_name):
Undocumented
@staticmethod
def _fullfile(listing_name):
Undocumented
@staticmethod
def lists():
Undocumented
@classmethod
def register(cls, folder):

add folder path or url to list of archives.

Caveat: existing class instances won't be aware of new registrations.

def _makepathsabsolute(self):
Undocumented
def save(self):
save current list making changes permanent
def remote_update(self, name=None):

join in the respective list from http://coco.gforge.inria.fr/data-archives.

Use save to save the joined entries.

def _remove_double_entries(self):
keep the first of duplicated entries
def _walk(self, folder=None):

recursive search for COCO data archives in folder on disk.

This may take (many?) seconds, for example if using folder='~'.

_last_walk contains the returned result and _save_walk` makes the result "permanent" to the current class instance / listing file.

def _save_walk(self):
extend self by elements of _last_walk not in self and save
def update(self):
update self from the listing file that may have changed
API Documentation for cocopp, generated by pydoctor at 2020-01-21 16:27:37.