-
Notifications
You must be signed in to change notification settings - Fork 288
Pootle FS snaglist
Allan Nordhøy edited this page Apr 18, 2018
·
21 revisions
Another list of snags. Just throw it away when we're mostly fixed. Don't get yourself attached to the list.
That is what is broken when we write to FS
- .lang loses its headers - just tested with
## active ##
- If an
## active ##
header exists it is removed - See https://github.com/dwaynebailey/demo-small-lang/commit/39009c3bf1f17782efed4b2a3bcc369a9ee7a616
- Options/thoughts:
- PO format header is just a special unit (first unit if MSGID ID is blank)
- We either need to break that out and have a concept of headers for a Store
- Or we hack .lang to use its own pseudo unit in the same way
- PO header are just a
key: value;
store, so we could just store them as such -
## active ##
is just boolean so interesting would be to expose in Pootle UI the ability for an admin to make a Store active.
- If an
- PO garbles the headers
- sync_stores does not do this but
sync
does - so somehow the paths to the final PO are slightly different
- sync_stores does not do this but
- Adding a new mapping leave mappings stuck in cached state:
- fetch, state
WARNING Could not import files for languages: es-ES, kab
- Add mapping
es<>es-ES
- state
- Does not show es-ES in the list
- Only appears if you do add,sync,state
- After the first warning there is no way to know what languages aren't mapped
- You get
WARNING Could not import files for languages: es-ES, kab
after first state - But subsequently there is no warning
- We should highlight missing languages always when we issue state, as its a state of the file-system
- You get
- Adding a missing locale code requires us adding this in admin then doing stuff in CLI
- Should we not have an option to create the language code?
- That makes it pretty easy to import languages
- But does require that we have access to language name or that users go and update language
- Maybe better from a GUI
- Adding a missing language doesn't raise any error
(pootle)~/dev/demo-small-lang (master)$ pootle fs state small-lang
2017-01-16 15:47:25,848 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
2017-01-16 15:47:26,666 WARNING Could not import files for languages: kab
(pootle)~/dev/demo-small-lang (master)$ pootle fs add -P /kab/ small-lang
2017-01-16 15:47:42,339 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
No changes made
- Adding a
be@latin
to FS with no Pootle lang present doesn't then appear in state
(pootle)~/dev/demo-small-lang (master)$ pootle fs state small-lang
2017-01-16 15:49:22,554 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
(pootle)~/dev/demo-small-lang (master)$ cp -rp templates be@latin
(pootle)~/dev/demo-small-lang (master)$ pootle fs state small-lang
2017-01-16 15:49:35,715 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
(pootle)~/dev/demo-small-lang (master)$ pootle fs fetch small-lang
2017-01-16 15:49:39,451 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
2017-01-16 15:49:40,208 INFO
dirsync finished in 0.05 seconds.
2017-01-16 15:49:40,209 INFO 83 directories parsed, 2 files copied
2017-01-16 15:49:40,209 INFO 1 directories were created.
2017-01-16 15:49:40,209 INFO
(pootle)~/dev/demo-small-lang (master)$ pootle fs state small-lang
2017-01-16 15:49:43,041 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
2017-01-16 15:49:43,848 WARNING Could not import files for languages: kab
(pootle)~/dev/demo-small-lang (master)$ ls -l
total 8
-rw-r--r-- 1 dwayne staff 382 15 Jan 03:54 README.rst
drwxr-xr-x 4 dwayne staff 136 16 Jan 13:48 af
drwxr-xr-x 4 dwayne staff 136 15 Jan 03:58 be@latin
drwxr-xr-x 4 dwayne staff 136 15 Jan 03:58 fr
drwxr-xr-x 4 dwayne staff 136 15 Jan 04:03 kab
drwxr-xr-x 4 dwayne staff 136 15 Jan 03:58 templates
(pootle)~/dev/demo-small-lang (master)$ pootle fs fetch small-lang
2017-01-16 15:49:57,164 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
2017-01-16 15:49:58,203 INFO
dirsync finished in 0.03 seconds.
2017-01-16 15:49:58,203 INFO 83 directories parsed, 0 files copied
2017-01-16 15:49:58,204 INFO
(pootle)~/dev/demo-small-lang (master)$ pootle fs state small-lang
2017-01-16 15:50:02,586 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
- Adding
be@latin
to Pootle languages does not allow state to pick upbe@latin
as needingsync
. Even though it has been copied to Pootle FS working dir.
(pootle)~/dev/demo-small-lang (master)$ ls
README.rst af be@latin fr kab templates
(pootle)~/dev/demo-small-lang (master)$ pootle fs fetch small-lang
2017-01-16 17:35:54,439 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
2017-01-16 17:35:56,267 INFO
dirsync finished in 0.05 seconds.
2017-01-16 17:35:56,267 INFO 83 directories parsed, 0 files copied
2017-01-16 17:35:56,267 INFO
(pootle)~/dev/demo-small-lang (master)$ pootle fs state small-lang
2017-01-16 17:35:59,831 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
(pootle)~/dev/demo-small-lang (master)$ ls ../pootle/pootle/.pootle_fs/tmp/small-lang/
README.rst af be@latin fr kab templates
- When you first setup a project you cannot filter what gets added
- fetch,state
- add -P /af/
- Lists that all files have been added, not just the ones you filtered down to
- sync
- Everything gets sync'd i.e. your filter has no impact
- If you subsequently add a TP and issue the completely wrong path
- Added
fr
to FS, fetch, state -
fr
listed - pootle fs add -P /es/small-lang/one.lang small-lang
- All
fr
files are listed as added
- Added
- Remove
es
from Pootle - state (see two removed files, rm (jsut the one), state (see one to be removed, one still to be resolved), sync (TB)
(pootle)~/dev/demo-small-lang (master)$ pootle fs state small-lang
2017-01-16 15:40:53,159 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
Removed from Pootle (2)
-----------------------
Stores that have been removed from Pootle
(/es/small-lang/one.lang)
<--> /es-ES/one.lang
(/es/small-lang/subdir/two.lang)
<--> /es-ES/subdir/two.lang
(pootle)~/dev/demo-small-lang (master)$ pootle fs rm -P /es/small-lang/one.lang small-lang
2017-01-16 15:41:08,471 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
Staged for removal (1)
----------------------
Files or Stores staged for removal where the corresponding file/Store is missing
(/es/small-lang/one.lang)
<--> /es-ES/one.lang
(pootle)~/dev/demo-small-lang (master)$ pootle fs state small-lang
2017-01-16 15:41:14,203 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
2017-01-16 15:41:15,395 WARNING Could not import files for languages: kab
Staged for removal (1)
----------------------
Files or Stores that have been staged or removal on sync
(/es/small-lang/one.lang)
<--> /es-ES/one.lang
Removed from Pootle (1)
-----------------------
Stores that have been removed from Pootle
(/es/small-lang/subdir/two.lang)
<--> /es-ES/subdir/two.lang
(pootle)~/dev/demo-small-lang (master)$ pootle fs sync small-lang
2017-01-16 15:41:19,730 INFO Loading custom settings from '/Users/dwayne/.pootle/pootle.conf'...
Traceback (most recent call last):
File "/Users/dwayne/dev/envs/pootle/bin/pootle", line 11, in <module>
load_entry_point('Pootle', 'console_scripts', 'pootle')()
File "/Users/dwayne/dev/pootle/pootle/runner.py", line 317, in main
django_settings_module='pootle.settings')
File "/Users/dwayne/dev/pootle/pootle/runner.py", line 297, in run_app
management.execute_from_command_line(command)
File "/Users/dwayne/dev/envs/pootle/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/Users/dwayne/dev/envs/pootle/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/dwayne/dev/pootle/pootle/core/management/subcommands.py", line 164, in run_from_argv
return self.subcommands[known.subcommand]().run_from_argv(argv)
File "/Users/dwayne/dev/envs/pootle/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/dwayne/dev/envs/pootle/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/Users/dwayne/dev/pootle/pootle/apps/pootle_fs/management/commands/__init__.py", line 107, in handle
display = self.display(**options)
File "/Users/dwayne/dev/pootle/pootle/apps/pootle_fs/management/commands/__init__.py", line 88, in display
self.handle_api(**options))
File "/Users/dwayne/dev/pootle/pootle/apps/pootle_fs/management/commands/__init__.py", line 82, in handle_api
return api_method(**self.handle_api_options(options))
File "/Users/dwayne/dev/pootle/pootle/apps/pootle_fs/decorators.py", line 58, in method_wrapper
return f(self, state, response, **kwargs)
File "/Users/dwayne/dev/pootle/pootle/apps/pootle_fs/plugin.py", line 501, in sync
state, response, fs_path=fs_path, pootle_path=pootle_path)
File "/Users/dwayne/dev/pootle/pootle/apps/pootle_fs/decorators.py", line 58, in method_wrapper
return f(self, state, response, **kwargs)
File "/Users/dwayne/dev/pootle/pootle/apps/pootle_fs/plugin.py", line 486, in sync_rm
store_fs.store_id] = store_fs.store.data.max_unit_revision
AttributeError: 'NoneType' object has no attribute 'data'