MCPcopy
hub / github.com/codelucas/newspaper / get_resource_path

Method get_resource_path

newspaper/article.py:343–352  ·  view source on GitHub ↗

Every article object has a special directory to store data in from initialization to garbage collection

(self)

Source from the content-addressed store, hash-verified

341 os.mkdir(res_path)
342
343 def get_resource_path(self):
344 """Every article object has a special directory to store data in from
345 initialization to garbage collection
346 """
347 res_dir_fn = 'article_resources'
348 resource_directory = os.path.join(settings.TOP_DIRECTORY, res_dir_fn)
349 if not os.path.exists(resource_directory):
350 os.mkdir(resource_directory)
351 dir_path = os.path.join(resource_directory, '%s_' % self.link_hash)
352 return dir_path
353
354 def release_resources(self):
355 # TODO: implement in entirety

Callers 2

build_resource_pathMethod · 0.95
release_resourcesMethod · 0.95

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected