def _require_store(tp, po_dir, name):
 from pootle_store.constants import PARSED
 from pootle_store.models import Store
 parent_dir = tp.directory
 pootle_path = (tp.pootle_path + name)
 file_path = (tp.real_path and os.path.join(po_dir, tp.real_path, name))
 try:
  store = Store.objects.get(pootle_path=pootle_path, translation_project=tp)
 except Store.DoesNotExist:
  store = Store.objects.create_by_path(file=file_path, create_tp=False, create_directory=False, pootle_path=('%s%s' % (parent_dir.pootle_path, name)))
 if store.file.exists():
  if (store.state < PARSED):
   store.update(store.file.store)
 return store

def _require_store ( tp , po_dir , name ) : from pootle_store . constants import PARSED from pootle_store . models import Store parent_dir = tp . directory pootle_path = ( tp . pootle_path + name ) file_path = ( tp . real_path and os . path . join ( po_dir , tp . real_path , name ) ) try : store = Store . objects . get ( pootle_path = pootle_path , translation_project = tp ) except Store . DoesNotExist : store = Store . objects . create_by_path ( file = file_path , create_tp = False , create_directory = False , pootle_path = ( '%s%s' % ( parent_dir . pootle_path , name ) ) ) if store . file . exists ( ) : if ( store . state < PARSED ) : store . update ( store . file . store ) return store
helper to get/create a new store .