Kurt wrote:
Spooky behavior. Yes, the green-apple-example also works for me with
your new script, BUT ...!
Try to copy the table content on this page:
http://www.danacord.dk/frmsets/records/732-r.html
which is a realistic scenario. That's whar I am doing these days.
Pasting it into Gedit
Den 08/01/13 16.31, chaouche yacine skrev:
Well tell me how do you use this script in gedit, are you using it as a
plugin ?
Snippets is a plugin, yes. It's included in the .app for Mac (v.
2.30.2), but not activated af default.
Open Tools in the menu line and click Manage snippets Here
Den 06/01/13 15.20, Chris Angelico wrote:
That version should work.
Am 06.01.2013 15:30 schrieb Kurt Hansen:
It certainly does. I'll keep it and use it until at better solution is
found.
On 08/01/13 15.18, Thomas Rachel wrote:
That would be simple:
Replace
output += 'td colspan=' +
what was wrong in the snippet.
If this doesn't work for you, please let me know.
From: Kurt Hansen kurt@ugyldig.invalid
To: python-list@python.org
Sent: Wednesday, January 9, 2013 10:07 AM
Subject: Re: How to modify this script?
Den 08/01/13 16.31, chaouche
Den 09/01/13 11.23, chaouche yacine skrev:
I figrued it out. Copy/paste exactly these lines in the snippets tool.
You can bind it to a key as you may know, I bound it to Ctrl-E. So paste
it in a new snippet (keep the original in a safe place), bind to a key,
select the text you want to
(items))
output += addline(columns)
output += /table\
return output
From: Kurt Hansen kurt@ugyldig.invalid
To: python-list@python.org
Sent: Wednesday, January 9, 2013 12:04 PM
Subject: Re: How to modify this script?
Den 09/01/13 11.23, chaouche yacine
Am 06.01.2013 15:30 schrieb Kurt Hansen:
Den 06/01/13 15.20, Chris Angelico wrote:
On Mon, Jan 7, 2013 at 1:03 AM, Kurt Hansen kurt@ugyldig.invalid wrote:
I'm sorry to bother you, Chris, but applying the snippet with your
code in
Gedit still just deletes the marked, tab-separated text in the
Am 07.01.2013 18:56 schrieb Gertjan Klein:
(Watch out for line wraps! I don't know how to stop Thunderbird from
inserting them.)
Do insert as quotation (in German Thunderbird: Als Zitat einfügen),
or Strg-Shift-O. Then it gets inserted with a before and in blue.
Just remove the and the
Sent: Monday, January 7, 2013 5:42 PM
Subject: Re: How to modify this script?
Den 06/01/13 16.12, chaouche yacine skrev:
I'm not confident this would run on gedit. It works on a python
interpreter if you have a file named data.txt in the same directory
containing your sample data.
It surely
Thomas Rachel wrote:
Am 07.01.2013 18:56 schrieb Gertjan Klein:
(Watch out for line wraps! I don't know how to stop Thunderbird from
inserting them.)
Do insert as quotation (in German Thunderbird: Als Zitat einfügen),
or Strg-Shift-O. Then it gets inserted with a before and in blue.
Just
.
*From:* Kurt Hansen kurt@ugyldig.invalid
*To:* python-list@python.org
*Sent:* Sunday, January 6, 2013 3:21 PM
*Subject:* Re: How to modify this script?
Den 06/01/13 15.01, chaouche yacine wrote:
Well, I'm not answering your question since I am rewriting
Kurt Hansen wrote:
To convert tab-separated text lines into a HTML-table:
As you apparently didn't receive answers that worked for you I tried to
get what you want to work and test it in Gedit. Here's the result:
$
lines = $GEDIT_SELECTED_TEXT.split(\n);
output = 'table\\n';
max_columns =
On Sun, Jan 6, 2013 at 11:42 PM, Kurt Hansen kurt@ugyldig.invalid wrote:
Since there's only one field in the first line, I want this output:
trtd colspan=3Price table/td/tr
- insted of
trtdPrice table/td/tr
How to? Thank you i advance.
It's actually quite simple, as long as you don't
if len(columns) != 3:
colspan = 3 - len(columns) + 1
output += 'td colspan=%s' % (colspan) + item + '/td '
I did not test. Use with caution.
From: Kurt Hansen kurt@ugyldig.invalid
To: python-list@python.org
Sent: Sunday, January 6, 2013 1:42 PM
Den 06/01/13 13.52, Chris Angelico skrev:
On Sun, Jan 6, 2013 at 11:42 PM, Kurt Hansen kurt@ugyldig.invalid wrote:
Since there's only one field in the first line, I want this output:
trtd colspan=3Price table/td/tr
- insted of
trtdPrice table/td/tr
How to? Thank you i advance.
It's
Den 06/01/13 13.58, chaouche yacine skrev:
if len(columns) != 3:
colspan = 3 - len(columns) + 1
output += 'td colspan=%s' % (colspan) + item + '/td '
I did not test. Use with caution.
I've tried to put it in several different places in the script, but with
no luck; remember that I'm
On Mon, Jan 7, 2013 at 12:34 AM, Kurt Hansen kurt@ugyldig.invalid wrote:
innermost? I have replaced this with yours, but all the marked text are
deleted:
Here's the full code, with my change:
$
lines = $GEDIT_SELECTED_TEXT.split(\n);
output = 'table\\n';
for line in lines:
output +=
Green apple /tdtd $1/td/tr
trtd5 /tdtd Green apples /tdtd $4/td/tr
trtd10 /tdtd Green apples /tdtd $7/td/tr
/table
From: Kurt Hansen kurt@ugyldig.invalid
To: python-list@python.org
Sent: Sunday, January 6, 2013 2:38 PM
Subject: Re: How to modify this script
Den 06/01/13 14.44, Chris Angelico wrote:
On Mon, Jan 7, 2013 at 12:34 AM, Kurt Hansen kurt@ugyldig.invalid wrote:
innermost? I have replaced this with yours, but all the marked text are
deleted:
Here's the full code, with my change:
$
lines = $GEDIT_SELECTED_TEXT.split(\n);
output =
On Mon, Jan 7, 2013 at 1:03 AM, Kurt Hansen kurt@ugyldig.invalid wrote:
I'm sorry to bother you, Chris, but applying the snippet with your code in
Gedit still just deletes the marked, tab-separated text in the editor.
Ah, whoops. That would be because I had a bug in the code (that's why
I
Den 06/01/13 15.01, chaouche yacine wrote:
Well, I'm not answering your question since I am rewriting the script,
because I prefer it this way :)
def addline(line):
return tr%s/tr\n % line
[cut]
I surpose I shall put your code between $ and ?
printed
table
trtd colspan='3'Price
Kurt,
Try this:
$
lines = $GEDIT_SELECTED_TEXT.split(\n);
output = 'table\\n';
for line in lines:
output += 'tr\';
columns = line.split(\t);
if len(columns)==1:
output += 'tr\td colspan=3\', line, '/td\/tr\'
else:
for item
Den 06/01/13 15.20, Chris Angelico wrote:
On Mon, Jan 7, 2013 at 1:03 AM, Kurt Hansen kurt@ugyldig.invalid wrote:
I'm sorry to bother you, Chris, but applying the snippet with your code in
Gedit still just deletes the marked, tab-separated text in the editor.
Ah, whoops. That would be
On Mon, Jan 7, 2013 at 1:30 AM, Kurt Hansen kurt@ugyldig.invalid wrote:
Den 06/01/13 15.20, Chris Angelico wrote:
On Mon, Jan 7, 2013 at 1:03 AM, Kurt Hansen kurt@ugyldig.invalid wrote:
I'm sorry to bother you, Chris, but applying the snippet with your code
in
Gedit still just deletes the
Den 06/01/13 15.22, Subimal Deb wrote:
Kurt,
Try this:
[cut]
I've tested it on my original example:
Price table
1 Green apple $1
5 Green apples$4
10 Green apples$7
With all four lines selected it makes an error. With only three (without
the first line) it works
On Mon, Jan 7, 2013 at 1:40 AM, Kurt Hansen kurt@ugyldig.invalid wrote:
failed: cannot concatenate 'str' and 'tuple' objects
The problem is this line:
output += 'trtd colspan=3', line, '/td/tr'
Change it to:
output += 'trtd colspan=3' + line + '/td/tr'
ChrisA
--
Den 06/01/13 15.52, Chris Angelico skrev:
On Mon, Jan 7, 2013 at 1:40 AM, Kurt Hansen kurt@ugyldig.invalid wrote:
failed: cannot concatenate 'str' and 'tuple' objects
The problem is this line:
output += 'trtd colspan=3', line, '/td/tr'
Change it to:
output += 'trtd colspan=3' + line +
: Re: How to modify this script?
Den 06/01/13 15.01, chaouche yacine wrote:
Well, I'm not answering your question since I am rewriting the script,
because I prefer it this way :)
def addline(line):
return tr%s/tr\n % line
[cut]
I surpose I shall put your code between $ and ?
printed
28 matches
Mail list logo