Merge lp:~cwilson/spud/noflml into lp:spud

Proposed by Cian Wilson
Status: Merged
Merged at revision: 516
Proposed branch: lp:~cwilson/spud/noflml
Merge into: lp:spud
Diff against target: 43 lines (+14/-6)
2 files modified
diamond/bin/diamond (+13/-3)
diamond/diamond/config.py (+1/-3)
To merge this branch: bzr merge lp:~cwilson/spud/noflml
Reviewer Review Type Date Requested Status
Patrick Farrell Approve
Review via email: mp+94613@code.launchpad.net

Description of the change

The automatic download of the fluidity schema for diamond is broken - it does not download correctly so you get an incomplete schema. Furthermore if you register a single non-flml schema you still get an flml option because the download option is always automatically registered, which is weird on machines where fluidity isn't even installed.

This merge removes the broken flml download from diamond and instead issues an error if no schemas are found.

To post a comment you must log in.
Revision history for this message
Patrick Farrell (pefarrell) wrote :

I think the message is a bit confusing (and has a spelling mistake). How about

+ debug.deprint("The file should consist of:", 0)
+ debug.deprint(" A Verbal Description Of The Language Purpose", 0)
+ debug.deprint(" alias1=/path/to/schema/alias1", 0)
+ debug.deprint(" alias2=/path/to/schema/alias2", 0)

?

Technically the change looks fine. David, Tim: do we install the fluidity schema now by default with the package? If so, I think we should get rid of any flml-specific stuff in diamond (as much as possible, anyway).

lp:~cwilson/spud/noflml updated
517. By Cian Wilson

Updating error message.

Revision history for this message
Cian Wilson (cwilson) wrote :

OK, have updated the error message. I had just copied it from the one that was already there so I've updated the original too.

My understanding is that the packages install the fluidity schema but regardless the current 'default' download behavior is broken so should be fixed or removed. I obviously favor removal as I think it's broken on other levels too.

This was all the flml-specific stuff I could find based on grepping. Is there more out there that I didn't find? I'm only aware of the test xml specific stuff.

Revision history for this message
Tim Greaves (tim-greaves) wrote :

We do:

tmb1@borken:~$ dpkg -L fluidity | grep flml
/usr/share/diamond/schemata/flml
/usr/share/fluidity/schemas/flml
/usr/share/fluidity/schemas/flml.in
tmb1@borken:~$

Revision history for this message
Patrick Farrell (pefarrell) wrote :

In that case, let's go!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'diamond/bin/diamond'
2--- diamond/bin/diamond 2011-09-09 12:02:21 +0000
3+++ diamond/bin/diamond 2012-02-27 15:27:21 +0000
4@@ -153,11 +153,21 @@
5 debug.deprint("Have you registered it in /etc/diamond/schemata/ or $HOME/.diamond/schemata?", 0)
6 debug.deprint("To register a schema, place a file in one of those directories, and let its name be the suffix of your language.", 0)
7 debug.deprint("The file should consist of:", 0)
8- debug.deprint(" A Verbal Description Of The Language Purpose", 0)
9- debug.deprint(" Lines of the format alias=/path/to/the/schema/file.rng", 0)
10- debug.deprint(" alias= is optional, if not given default= is added automaticly")
11+ debug.deprint(" A Verbal Description Of The Language Purpose", 0)
12+ debug.deprint(" alias1=/path/to/schema1/file.rng", 0)
13+ debug.deprint(" alias2=/path/to/schema2/file.rng", 0)
14 sys.exit(1)
15
16+ elif len(config.schemata) == 0:
17+ debug.deprint("Could not find a schema file.", 0)
18+ debug.deprint("Have you registered it in /etc/diamond/schemata/ or $HOME/.diamond/schemata?", 0)
19+ debug.deprint("To register a schema, place a file in one of those directories, and let its name be the suffix of your language.", 0)
20+ debug.deprint("The file should consist of:", 0)
21+ debug.deprint(" A Verbal Description Of The Language Purpose", 0)
22+ debug.deprint(" alias1=/path/to/schema1/file.rng", 0)
23+ debug.deprint(" alias2=/path/to/schema2/file.rng", 0)
24+ sys.exit(1)
25+
26 # if there is only one schema, use that
27 elif len(config.schemata) == 1:
28 suffix = config.schemata.keys()[0]
29
30=== modified file 'diamond/diamond/config.py'
31--- diamond/diamond/config.py 2011-11-03 16:21:35 +0000
32+++ diamond/diamond/config.py 2012-02-27 15:27:21 +0000
33@@ -48,9 +48,7 @@
34 __set_default("diffadd", "lightgreen")
35 __set_default("diffsub", "indianred")
36
37-# Here we hard-code a default for flml
38-# so that users don't have to tweak this to run it.
39-schemata = {'flml': ('Fluidity markup language', { None: 'http://bazaar.launchpad.net/~fluidity-core/fluidity/4.0-release/download/head:/fluidity_options.rng-20110415014759-hdavpx17hi2vz53z-811/fluidity_options.rng'})}
40+schemata = {}
41
42 for dir in [os.path.join(path, "schemata") for path in dirs]:
43 try:

Subscribers

People subscribed via source and target branches