Sounds plausible.

Much simpler fix (which should work without further issues):

Change lines 1678 and 1679 from:

        if global_currentfile.startswith(this_currentfilename+":") and
int(global_currentfile.split(':',1)[1]) != consider_linenumber:
            consider_linenumber = int(global_currentfile.split(':')[1])

To:

        if global_currentfile.startswith(this_currentfilename+":") and
int(global_currentfile.rsplit(':',1)[1]) != consider_linenumber:
            consider_linenumber = int(global_currentfile.rsplit(':')[1])


ie use .rsplit instead of .split .

regards,


Stefan

-----Original Message-----
From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
Behalf Of Andrew Collier
Sent: maandag 7 oktober 2013 01:36
To: sam-users@nvg.ntnu.no
Subject: Re: pyz80 with Notepad++ integration

Hi,

Hmm. It's a while since I wrote that code, but I think the effect of
commenting out those lines may be that after an INCLUDE directive is used,
it would continue assembling from the wrong line number in the parent file.

Unfortunately I do appear to have made an implicit assumption about the
character ":" not appearing in file names, and it is used explicitly as a
delimiter in a whole bunch of places. Windows isn't really on my radar, I'm
afraid. Ideally I guess I would keep a single definition of the delimiter
string in a variable somewhere and refer to it, and "::" should probably be
safe(r).

Andrew

On 6 Oct 2013, at 21:27, Stefan Drissen <stefan.dris...@gmail.com> wrote:

> 1. get the NppExec plugin - it provides an output console and (just 
> installed it so not sure) allows you to do something with the resulting
file 2. there seems to be an issue with pyz80 and qualified input file names
- as soon as you try to run python pyz80.py c:\source.s it chokes (also from
the command line) with:
> 
> Process started >>>
> pass  1 ...
> Traceback (most recent call last):
>  File "D:/Users/Public/Documents/pyz80/pyz80", line 1835, in <module>
>    assembler_pass(p, inputfile)
>  File "D:/Users/Public/Documents/pyz80/pyz80", line 1678, in
assembler_pass
>    if global_currentfile.startswith(this_currentfilename+":") and
int(global_currentfile.split(':',1)[1]) != consider_linenumber:
> ValueError: invalid literal for int() with base 10:
'/Users/public/Documents/specpang.s:0'
> <<< Process finished. (Exit code 1)
> 
> If I comment out line 1678 and 1679 then the error is gone, but I have 
> no idea what I've broken at the same time :-)
> 
> Over to Andrew...
> 
> Regards,
> 
> 
> Stefan
> 
> 
> 
> -----Original Message-----
> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] 
> On Behalf Of SCjoe
> Sent: zondag 6 oktober 2013 14:58
> To: sam-users
> Subject: pyz80 with Notepad++ integration
> 
> Hi,
> 
> please help me with the idea how to integrate pyz80 into the Notepad++
(Win7).
> 
> I tried many forms of the Notepad++´s  Menu Run, from the simple
sentence...
> PYTHON PYZ80.PY source.s
> (which works in the CMD line)
> 
> ... to ...
> c:\python25\python c:\python25\pyz80.py "$(FULL_CURRENT_PATH)"
> ... or ...
> cmd /c c: && cd python25 && python pyz80.py "$(FULL_CURRENT_PATH)" || 
> pause
> 
> Also created a BAT file in order to have the  "RUN" sentence as short as
possible...
> 
> And yes, I have set the system PATH variable in Windows 7 for the the
PYTHON25 directory and copy the file pyz80 into it.
> 
> Thanks
> Josef
> 


Reply via email to