Activity for CFrank

  • CFrank CFrank posted a comment on discussion Help

    To be honest, I don't think that reading a file once and using its content in a list is slower than opening the substitution file always, if you tested this with more than one file. But a general question, all that you want to do is to find some text and replace it, correct? If so, why not using ... notepad.open(fileName.encode('utf-8')) for s in sl editor.replace(s[0],s[1]) notepad.save() notepad.close() There is no need for doing findText, saving position ... first. Another hint, you can define...

  • CFrank CFrank posted a comment on discussion Help

    Well than you need to find out what encoding has been used, which, btw, cannot be done in a 100% save manner. Npp uses chardet to identify the encoding, chardet is also available as python module. If only utf8 with or without BOM is used, than you can use codecs module and do something like import codecs with codecs.open(u'FILENAME') as f: for l in f: if len(l) > 1: s = l.split() if s[0].startswith(codecs.BOM_UTF8): _s = s[0][len(codecs.BOM_UTF8):].decode('utf-8') else: _s = s[0] ... Cheers Clau...

  • CFrank CFrank posted a comment on discussion Help

    Why not converting your file to UTF-8 (without the BOM). Cheers Claudia

  • CFrank CFrank posted a comment on discussion Help

    yep, another possible way :-D

  • CFrank CFrank posted a comment on discussion Help

    get/setProperty is normally used to get/set lexer specific properties like allow folding etc... Recently npp added fold.quotes.python property to allow doc comments to be folded, this wasn't possible before unless you would have set it with python script for example. But this gaves also the possibility to add any info/value you want to a document and it is only avaliable through the lifetime of that document. Once document closes everything is gone and you don't have to take care of it.(well, in...

  • CFrank CFrank posted a comment on discussion Help

    Correct, setProperty is per document as globals() returns the current global scope which is used by every script you run as long as your in the same namespace. Scott, I think moon refers to my example where I used 42 in setProperty call.

  • CFrank CFrank posted a comment on discussion Help

    You could use the global namespace or the editor.setProperty function to save data need on subsequent calls global namespace: counter = globals().get('counter', 1) t = globals().get('t', 'set') print '{} {}'.format(t, counter) counter += 1 or editor.setProperty('MY_VAR','42') print editor.getProperty('MY_VAR')

  • CFrank CFrank posted a comment on discussion Help

    @Moon, After rereading my post I guess I was a bit unclear - yes, getTag(number) rerturns a submatch but there is no function to retrieve how many submatches were catched. Sorry for confusion.

  • CFrank CFrank posted a comment on discussion Script Showcase

    An updated version (V2) is available here https://sourceforge.net/p/npppythonscript/discussion/1199074/thread/f59511a4/

  • CFrank CFrank modified a comment on discussion Help

    Not quite sure if I understand your question correctly. getTag doesn't provide a functionality to retrieve "submatches" (results when using regex like (hello).(world) where hello would be the first and world the second "submatch". If you still want to use getTag, than you have to loop over it and as soon as you receive an empty string your done. In order to retrieve this, I would, for example, use a match object and lastindex property. Concerning the backward search, why not using current position...

  • CFrank CFrank posted a comment on discussion Help

    Not quite sure if I understand your question correctly. getTag doesn't provide a functionality to retrieve "submatches" (results when using regex like (hello).(world) where hello would be the first and world the second "submatch". If you still want to use getTag, than you have to loop over it and as soon as you receive an empty string your done. In order to retrieve this, I would, for example, use a match object and lastindex property. Concerning the backward search, why not using current position...

  • CFrank CFrank posted a comment on discussion Help

    David, I don't think that Cell can be used in such a case as the Cell class seems not to provide any functions which could convert the input and in addition scintilla documentation states, that setting the text must be prior to setting styles. Let's see what Dave thinks. My strategy is the following ERROR_MSG_ID = 20 WARNING_MSG = 21 INFO_MSG = 22 editor.styleSetFore(ERROR_MSG_ID,(255,0,0)) editor.styleSetBack(ERROR_MSG_ID,(0,0,0)) editor.styleSetFore(WARNING_MSG,(255,255,0)) editor.styleSetBack(WARNING_MSG,(0,0,0))...

  • CFrank CFrank modified a comment on discussion Help

    I haven't used Cell class (to be honest wasn't even aware that it exists) but I use it like this editor.annotationClearAll() editor.annotationSetText(1,'hello\nworld') editor.annotationSetStyles(1, "\1\1\1\2\2\2\3\3\3\4\5") editor.annotationSetVisible(2) Hope this is helpful for you. Be aware that the document needs to get the focus to make it work. Cheers Claudia

  • CFrank CFrank posted a comment on discussion Help

    I haven't used Cell class (to be honest wasn't even aware that it exists) but I use it like this editor.annotationClearAll() editor.annotationSetText(1,'hello\nworld') editor.annotationSetStyles(1, "\1\1\1\2\2\2\3\3\3\4\5") editor.annotationSetVisible(2) Hope this is helpful for you. Cheers Claudia

  • CFrank CFrank posted a comment on discussion Help

    By using filePathSrc = u'D:\TEMP\a' you turn everything returned by os.walk into a unicode string but open function expects normal byte string. Use filePathSrc = 'D:\TEMP\a' instead. Cheers Claudia

  • CFrank CFrank posted a comment on discussion Script Showcase

    This is not really python syntax ;-) import os os.chdir('Y:\dataFiles') list_of_files = [x for x in os.listdir('.') if x.endswith('.xml')] for file in list_of_files: notepad.open(file) editor.rereplace('replaceData', notepad.getCurrentFilename()) notepad.save() notepad.close() First you cahnge to the directory (as you already did) then you create a list of all files which end with .xml now iterate over that list and open it (otherwise you cannot use editor object) replace the data save and close...

  • CFrank CFrank modified a comment on discussion Open Discussion

    How do you start the batch? From commandline or within notepad++? Did you consider running the batch using python script plugin? Or do you use nppexec to run the batch. In general, the notepad++ sprecific objects are only accessible within a running notepad++ instance. Cheers Claudia

  • CFrank CFrank posted a comment on discussion Open Discussion

    How do you start the batch? From commandline or within notepad++? Did you consider running the batch using python script plugin? Or do you use nppexec to run the batch. Cheers Claudia

  • CFrank CFrank posted a comment on discussion Script Showcase

    Nice job and thank you for sharing it. Cheers Claudia

  • CFrank CFrank modified a comment on discussion Help

    so what is the solution Escaping. Python uses the backslash internally as well, so you need to do things like \\4,\\1... Cheers Claudia

  • CFrank CFrank modified a comment on discussion Help

    so what is the solution Escaping. Python uses the backslash internally as well, so you need to do things like \\4,\\1... Cheers Claudia

  • CFrank CFrank posted a comment on discussion Help

    so what is the solution Escaping. Python uses the backslash internally as well, so you need to do things like \4,\1... Cheers Claudia

  • CFrank CFrank posted a comment on discussion Script Showcase

    Hi, this is my second version of the RegexTester. Bugfixes and new features. I hope...

  • CFrank CFrank posted a comment on discussion Help

    editor.addText does only add the text without the end of line characters (carriage...

  • CFrank CFrank posted a comment on discussion Script Showcase

    Just use an empty line and coloring should go away ;-) Cheers Claudia

  • CFrank CFrank posted a comment on discussion Help

    So something like this would do it. If there is something unclear about the code...

  • CFrank CFrank modified a comment on discussion Help

    and the result should be this? Written by somesoft 1.1.0 version v1.1.0 tags Name_tags...

  • CFrank CFrank posted a comment on discussion Help

    and the result should be Written by somesoft 1.1.0 version v1.1.0 tags Name_tags...

  • CFrank CFrank posted a comment on discussion Help

    Could you provide an example what you try to do? Especially the part with sorting...

  • CFrank CFrank posted a comment on discussion Script Showcase

    Is the script run from Python Script folder as other one? What do you mean from folder?...

  • CFrank CFrank posted a comment on discussion Help

    What is expected? The WHOLEDOC treats the ^ as start of doc and $ as end of document....

  • CFrank CFrank posted a comment on discussion Script Showcase

    What is not working? Do you have any error in the console? Cheers Claudia

  • CFrank CFrank posted a comment on discussion Help

    Afaik this is mostly bug fixing - especially when using console object together with...

  • CFrank CFrank posted a comment on discussion Help

    Is it possible to override a key press? Somehow, you could hook npp message queue...

  • CFrank CFrank posted a comment on discussion Script Showcase

    Providing the source code encoding # -- coding: utf-8 -- will solve this. Cheers...

  • CFrank CFrank posted a comment on discussion Help

    Just to be sure, you responded to the original poster, didn't you? You are right,...

  • CFrank CFrank posted a comment on discussion Help

    btw. there is a known issue that the backup functionality might jump in wile doing...

  • CFrank CFrank posted a comment on discussion Help

    I assume you wanna replace the literals }, with },\n If so, the regex is incorrect...

  • CFrank CFrank posted a comment on discussion Script Showcase

    Hi Dave, of course you are correct (and corrected) but I don't know why/how this...

  • CFrank CFrank modified a comment on discussion Script Showcase

    Hello, script needs to use both npp views, 2nd is were you type the regular expression....

  • CFrank CFrank posted a comment on discussion Script Showcase

    Hello, script needs to use both npp views, 2nd is were you type the regular expression....

  • CFrank CFrank modified a comment on discussion Help

    Hello Thomas, you are correct, npp is using \1 notation internally where as boost...

  • CFrank CFrank modified a comment on discussion Help

    Hello Thomas, you are correct, npp is using \1 notation internally where as boost...

  • CFrank CFrank modified a comment on discussion Help

    Hello Thomas, you are correct, npp is using \1 notation internally where as boost...

  • CFrank CFrank posted a comment on discussion Help

    Hello Thomas, you are correct, npp is using \1 notation internally where as boost...

  • CFrank CFrank posted a comment on discussion Help

    Hallo André, deine Antworten, wie bereits von Dave gesagt, führen zur Verwirrung....

  • CFrank CFrank posted a comment on discussion Help

    Hi Dave, thank you for your kind words. Supporting your plugin is the minimum I can...

  • CFrank CFrank posted a comment on discussion Help

    Hallo André, ja, aber was macht die if Frage? Übersetzt: Wenn von der Datei die letzte...

  • CFrank CFrank posted a comment on discussion Help

    Hallo André, guter Gedanke aber kann eine Datei .php UND .js extension haben? if...

  • CFrank CFrank posted a comment on discussion Help

    Plugins->Python Script->Show Console Wenn du deinen Code mit meinem vergleichst,...

  • CFrank CFrank modified a comment on discussion Help

    Hallo André, du hast die console nicht geöffnet, dort würde auf jeden Fall eine Fehler...

  • CFrank CFrank posted a comment on discussion Help

    Hallo André, du hast die console nicht geöffnet, dort würde auf jeden Fall eine Fehler...

  • CFrank CFrank posted a comment on discussion Help

    Hallo André, was gibt es für eine Fehlermeldung in der Console? Wenn Lösung 1, dann...

  • CFrank CFrank posted a comment on discussion Help

    Hallo André, du kannst root überprüfen. Wenn Dateien in Broker und alle Subverzeichnisse...

  • CFrank CFrank posted a comment on discussion Help

    Andre, bei einem konkreten Problem zu helfen ist eine Seite aber das was du wunscht...

  • CFrank CFrank posted a comment on discussion Help

    No, but see my answer to your other question. Cheers Claudia

  • CFrank CFrank posted a comment on discussion Help

    Oh, I see - no, I don't think that you can get these information within the filebeforeloaded...

  • CFrank CFrank posted a comment on discussion Help

    Sorry, don't understand your question Cheers Claudia

  • CFrank CFrank posted a comment on discussion Help

    I think it is only possible when using external modules like win32file. import win32file...

  • CFrank CFrank posted a comment on discussion Help

    Hallo Andre, ja, das macht Sinn. Gruß Claudia

  • CFrank CFrank posted a comment on discussion Help

    Hallo Andre, du meinst hier hast Du ohne BOM eingegeben notepad.runMenuCommand("Kodierung",...

  • CFrank CFrank posted a comment on discussion Help

    Hallo Andre, schön das du es geschafft hast. Wegen dem UTF-8, dass ist nicht gut...

  • CFrank CFrank modified a comment on discussion Help

    Hi Mirko, the easieast way to see if a menucommand or plugin command works is to...

  • CFrank CFrank modified a comment on discussion Help

    Hi Mirko, the easieast way to see if a menucommand or plugin command works is to...

  • CFrank CFrank posted a comment on discussion Help

    Hi Mirko, the easieast way to see if a menucommand or plugin command works is to...

  • CFrank CFrank modified a comment on discussion Help

    Hallo André, dann vermute ich, das du einen Mix aus Tab und Spaces hast, das ist...

  • CFrank CFrank posted a comment on discussion Help

    Hallo André, dann vermute ich, das du einen Mix aus Tab und Spaces hast, das ist...

  • CFrank CFrank posted a comment on discussion Help

    Hallo André, welcher Fehler kommt? Öffne die python console (Plugins->PythonScript->Show...

  • CFrank CFrank posted a comment on discussion Help

    Hallo Andre, ja, füge folgende Zeile vor dem notepad.save() ein editor.replace('iso-8859-1',...

  • CFrank CFrank modified a comment on discussion Help

    Hallo Andre, in notepad 6.8.8 musse es heissen notepad.runMenuCommand("Encoding",...

  • CFrank CFrank modified a comment on discussion Help

    Hallo Andre, in notepad 6.8.8 musse es heissen notepad.runMenuCommand("Encoding",...

  • CFrank CFrank posted a comment on discussion Help

    Hello Andre, in notepad 6.8.8 musse es heissen notepad.runMenuCommand("Encoding",...

  • CFrank CFrank posted a comment on discussion Help

    Hallo, ich hoffe mein Deutsch ist gut genug. Bei Python muss man auf Tabs oder Spaces...

  • CFrank CFrank posted a comment on discussion Open Discussion

    From the scintilla docs The SCI_NULL does nothing and is the value assigned to keys...

  • CFrank CFrank posted a comment on discussion Help

    What I do is making a main function out of the main part and using return instead....

  • CFrank CFrank posted a comment on discussion Help

    May I ask you why you want to go this way? Why not using a pure python script, without...

  • CFrank CFrank posted a comment on discussion Help

    Hi Dave, sorry for late answer but I didn't get a notifcation sent that someone had...

  • CFrank CFrank posted a comment on discussion Help

    OK, solution seems to be setting indicator styles within for loop. Hmm, still not...

  • CFrank CFrank modified a comment on discussion Help

    Hello, I try to use indicators but it doesn't work as expected. When running the...

  • CFrank CFrank modified a comment on discussion Help

    Hello, I try to use indicators but it doesn't work as expected. When running the...

  • CFrank CFrank posted a comment on discussion Help

    Hello, I try to use indicators but it doesn't work as expected. When running the...

  • CFrank CFrank posted a comment on discussion Help

    Hi Philip, thank you and sorry for answering so late. I will give it a try and see...

  • CFrank CFrank posted a comment on discussion Help

    Hi, I wonder if it is possible to have more than one renderer delegate per column...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hi Bernhard, more or less. What about calling Select.All and iterating over SelectedObjects?...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hello Philip, kinda, it looks like this is an XP problem only (or I did something...

  • CFrank CFrank modified a comment on discussion Open Discussion

    Hi Frans, I did the test with your configuration and still get the RowState=Modified...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hi Frans, I did the test with your configuration and still get the RowState=Modified...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hi Frans, yes, I set the same properties. I even installed 4.5.1, which I wasn't...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hi Frasse, to be honest, I don't see any problem. I used your code, edited the first...

  • CFrank CFrank posted a comment on discussion 3. Plugin Development

    Well, I'm not a C# expert but I assume you must define the initial size first. var...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hi, this doesn't seem to be an ObjectListview problem. It looks like that your row...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hi, I'm using ObjectListview 2.8.1.830 on Windows XP SP3 and Me.dataTreeListView.ExpandAll()...

  • CFrank CFrank posted a comment on discussion Help

    OK - Problem found and solved. SQLite.Net defines INTEGER as INT64. As I'm developing...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hello, as subject says it all, doesn't it? Is this expected behaviour? If not, it...

  • CFrank CFrank posted a comment on discussion Help

    Hello, I do have a SQLite database and want to use a DataTreeListview to show the...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hi Andrew, because you wrote that you start learning python I thought I may give...

  • CFrank CFrank posted a comment on discussion Help

    Hi, npp currently uses scintilla version 3.3.4 whereas the requested function has...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hi, Plugins->Python Script->Configuration and check Prefer installed python libraries...

  • CFrank CFrank posted a comment on discussion Open Discussion

    Hi, if you want to provide the maxCount you need to provide flags, startPosition...

  • CFrank CFrank posted a comment on discussion 3. Plugin Development

    Depends what the plugin does but from my understanding about what you wrote you have...

1 >