Author Topic: VrrtepCLI  (Read 20945 times)

0 Members and 1 Guest are viewing this topic.

Offline Swoka Ikran

  • Palulukan Makto
  • *****
  • *
  • Posts: 1642
  • Karma: 29
Re: VrrtepCLI: Translator+
« Reply #40 on: May 23, 2011, 04:45:53 pm »
It has to be lower case: "__file__", not "__FILE__"
It is, I just typed it in uppercase here for readability...

My lines look like: filename = os.path.join(os.path.dirname(__file__), "naviwords.txt") and give that undefined error when compiled with Py2EXE.

Another possibility is to use sys.argv[0], which should work even in py2exe. That's the path to the main script, not to the current module, but as long as they're all in the same directory there's no difference.
Trying that now...

EDIT: Works even when compiled. :D :D I'll include it in the upcoming version. Irayo for this! :). Let's hope it works on Linux...
« Last Edit: May 23, 2011, 04:54:44 pm by Swoka Ikran »
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!

 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9891
  • nv Eywa'eveng
  • Karma: 243
  • Oeri ran lu srung
    • Tirea Aean
Re: VrrtepCLI: Translator+
« Reply #41 on: May 23, 2011, 04:57:30 pm »
I'll test it on linux upon linkage.

kelku ikranä a hawnventi yom podcast (na'vi-only): https://tirearadio.com/podcast
Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Swoka Ikran

  • Palulukan Makto
  • *****
  • *
  • Posts: 1642
  • Karma: 29
Re: VrrtepCLI: Translator+
« Reply #42 on: May 23, 2011, 05:18:24 pm »
I'll test it on linux upon linkage.
This is a Windows version, but the Python files should work on Linux:

Changes that should be in here (testing needed!):
* Path support. If you install it, you can run it by opening CMD and running vrrtepcli. No more messing with the CD command. :)
* Installation on Windows now requires administrator rights. If you don't have them, you won't get the Path support above, and you'll have to CD "%userprofile%\.vrrtepcli" as you did with the old versions.
* Kä'engä fix for movability. You can use it without installing if you don't mind using CD to switch to wherever you extracted the program.

Both standalone EXE and .py version are included:
http://swokaikran.skxawng.lu/files/vcli_path_movable.zip
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!

 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Offline Kä'eng

  • Uniltìranyu
  • **
  • Posts: 133
  • Karma: 12
Re: VrrtepCLI: Translator+
« Reply #43 on: May 23, 2011, 05:45:26 pm »
The best way would ba changing the PATH variable to include the application directory. Or the mory ugly way; putting binaries in C:\Windows\system32
Oh dear god no. It is an utter abomination for an ordinary user-level program to make system-wide changes like modifying C:\Windows. It opens up the door for inexplicable conflicts between different programs (the most common kind, incompatible DLLs, even has a name: "DLL hell"). Even if you're absolutely sure you won't have any adverse effects, e.g. because you're creating a file with a name you "know" is unique, don't do it anyway, because some impressionable young programmers might see it and think it's acceptable.
Ma evi, ke'u ke lu prrte' to fwa sim tuteot ayawne.
Slä txo tuteo fmi 'ivampi ngat ro seng, fu nìfya'o, a 'eykefu ngati vä', tsakem ke lu sìltsan.
Tsaw lu ngeyä tokx! Kawtu ke tsun nìmuiä 'ivampi ngat txo ngal ke new tsakemit.
Ha kempe si nga? Nì'awve, nga plltxe san kehe. Tsakrr, ngal tsatsengti hum!

Offline Swoka Ikran

  • Palulukan Makto
  • *****
  • *
  • Posts: 1642
  • Karma: 29
Re: VrrtepCLI: Translator+
« Reply #44 on: May 23, 2011, 06:24:40 pm »
Oh dear god no. It is an utter abomination for an ordinary user-level program to make system-wide changes like modifying C:\Windows. It opens up the door for inexplicable conflicts between different programs (the most common kind, incompatible DLLs, even has a name: "DLL hell"). Even if you're absolutely sure you won't have any adverse effects, e.g. because you're creating a file with a name you "know" is unique, don't do it anyway, because some impressionable young programmers might see it and think it's acceptable.
I put one file in there: vrrtepcli.cmd, so the system can see vrrtepCLI. That CMD file calls the rest of program, which is still kept in %userprofile%\.vrrtepcli The (even worse) alternative was messing with the system-wide PATH value. There's no per-user PATH on WinXP (not sure about Vista/7)...

Putting the entire application in system32 would be silly for the reasons you mentioned (incompatibility, conflicts, and other such issues)

As for DLL hell...that brings back memories of Win9x. :P
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!

 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9891
  • nv Eywa'eveng
  • Karma: 243
  • Oeri ran lu srung
    • Tirea Aean
Re: VrrtepCLI: Translator+
« Reply #45 on: May 23, 2011, 07:01:24 pm »
It works. You just forgot to import sys in the scramble module so that sys.argv can be used.

kelku ikranä a hawnventi yom podcast (na'vi-only): https://tirearadio.com/podcast
Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Swoka Ikran

  • Palulukan Makto
  • *****
  • *
  • Posts: 1642
  • Karma: 29
Re: VrrtepCLI: Translator+
« Reply #46 on: May 23, 2011, 07:19:17 pm »
It works. You just forgot to import sys in the scramble module so that sys.argv can be used.
Oops.  :-[

Will fix and recompile. :)

EDIT: Fixed source and standalone EXE: http://swokaikran.skxawng.lu/files/vcli_path_movable.zip
« Last Edit: May 23, 2011, 07:25:37 pm by Swoka Ikran »
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!

 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Offline Kä'eng

  • Uniltìranyu
  • **
  • Posts: 133
  • Karma: 12
Re: VrrtepCLI: Translator+
« Reply #47 on: May 23, 2011, 07:27:57 pm »
I put one file in there: vrrtepcli.cmd, so the system can see vrrtepCLI. That CMD file calls the rest of program, which is still kept in %userprofile%\.vrrtepcli
I see that right now the uninstaller just leaves it there, polluting system32 forever, slightly slowing down everything that needs to look up DLLs from there (you may not think it's a big effect, but imagine if every program you had ever installed did this). And if the file were deleted upon uninstallation, that would be a problem if multiple users had vrrtepCLI installed (once one user uninstalls, the others can no longer use the program).

Quote
The (even worse) alternative was messing with the system-wide PATH value. There's no per-user PATH on WinXP (not sure about Vista/7)...
You can create one - registry key HKEY_CURRENT_USER\Environment, value PATH. I do this myself for the command-line programs I use the most. Although to make it take effect without rebooting, you have to broadcast a WM_SETTINGCHANGE message.

But honestly I think the best way to make this program "user-friendly" would be to make it so it doesn't have to be started from the command line at all - make it possible to change settings from within the program, don't exit after the first word queried, etc. Command line aficionados such as me can set PATH ourselves. :)
Ma evi, ke'u ke lu prrte' to fwa sim tuteot ayawne.
Slä txo tuteo fmi 'ivampi ngat ro seng, fu nìfya'o, a 'eykefu ngati vä', tsakem ke lu sìltsan.
Tsaw lu ngeyä tokx! Kawtu ke tsun nìmuiä 'ivampi ngat txo ngal ke new tsakemit.
Ha kempe si nga? Nì'awve, nga plltxe san kehe. Tsakrr, ngal tsatsengti hum!

Offline Swoka Ikran

  • Palulukan Makto
  • *****
  • *
  • Posts: 1642
  • Karma: 29
Re: VrrtepCLI: Translator+
« Reply #48 on: May 23, 2011, 08:24:50 pm »
And if the file were deleted upon uninstallation, that would be a problem if multiple users had vrrtepCLI installed (once one user uninstalls, the others can no longer use the program).
The file was left there for exactly this reason.

You can create one - registry key HKEY_CURRENT_USER\Environment, value PATH. I do this myself for the command-line programs I use the most. Although to make it take effect without rebooting, you have to broadcast a WM_SETTINGCHANGE message.
So you CAN do this on XP. :) I always just added my apps to the end of the global path...

Is there a good way to make a batch append registry values? I can do: REG ADD "HKCU\Environment" /v "PATH" /d "%PATH%;%userprofile%\.vrrtepCLI" /f but then the entire global path also gets copied into the user's path...not good. Also, any idea how to do a WM_SETTINGCHANGE from a batch file?

I'm doing this to learn, so if there's a good way to do both of the above in batch, I'm interested. :) Otherwise I'm going to have to write a CLI path updater in Autoit.


EDIT: Did it in Autoit. Works beautifully :) No more files in the system32 folder.

But honestly I think the best way to make this program "user-friendly" would be to make it so it doesn't have to be started from the command line at all - make it possible to change settings from within the program, don't exit after the first word queried, etc.
I agree. TA should add an interactive mode. The program's current mode of operation works wonders when you want to check something quickly (or use the output in another program), but if you want to look up several words...running it several times makes no sense.
« Last Edit: May 23, 2011, 10:21:25 pm by Swoka Ikran »
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!

 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9891
  • nv Eywa'eveng
  • Karma: 243
  • Oeri ran lu srung
    • Tirea Aean
Re: VrrtepCLI: Translator+
« Reply #49 on: May 23, 2011, 08:35:38 pm »
actually you can use numbers in the na'vi->local translation direction to dictate how many consecutive times you get prompted OR how many words it will take in the command line and iterate over them. The games ie scramble and quiz loop seemingly forever until quit.

for example, try doing vrrtepcli 50
it will literally prompt you for 50 na'vi words to translate, one by one. The problem is, I can't get this to work in the opposite direction... ie local language -> na'vi

kelku ikranä a hawnventi yom podcast (na'vi-only): https://tirearadio.com/podcast
Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Swoka Ikran

  • Palulukan Makto
  • *****
  • *
  • Posts: 1642
  • Karma: 29
Re: VrrtepCLI: Translator+
« Reply #50 on: May 23, 2011, 09:08:20 pm »
for example, try doing vrrtepcli 50
it will literally prompt you for 50 na'vi words to translate, one by one. The problem is, I can't get this to work in the opposite direction... ie local language -> na'vi
Doesn't work on Windows. The program runs and gives "Not Found". IIRC, the loop code was in the .SH. The CMD version lacks said code because it's not easily done.

I'll look at re-implementing it...need to research.

Also, quoting myself ;D:
Otherwise I'm going to have to write a CLI path updater in Autoit.
Just tried this...works fine, and no reboot needed :) Whether I'll include this in place of the System32 file is TBD...
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!

 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9891
  • nv Eywa'eveng
  • Karma: 243
  • Oeri ran lu srung
    • Tirea Aean
Re: VrrtepCLI: Translator+
« Reply #51 on: May 23, 2011, 09:19:22 pm »
Ahh. of course. I didn't realize you didn't translate that part.

perhaps it might be smart to svn? got  a lot of versions floating around. I've been trying my best to keep organized.

kelku ikranä a hawnventi yom podcast (na'vi-only): https://tirearadio.com/podcast
Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Swoka Ikran

  • Palulukan Makto
  • *****
  • *
  • Posts: 1642
  • Karma: 29
Re: VrrtepCLI: Translator+
« Reply #52 on: May 23, 2011, 09:36:17 pm »
Ahh. of course. I didn't realize you didn't translate that part.
Working to re-implement it...may be easier than I think. (See edit.) I don't work with batch often anymore, so I forget stuff like this. My main languages now are Autoit and PHP...I'm always up for (re-)learning something though :)

perhaps it might be smart to svn? got  a lot of versions floating around. I've been trying my best to keep organized.
Let's see: 4 copies in folders on my VM's desktop :o : vcli_win, vcli_win_standalone, vcli_win_nosystem32, vcli_win_pathcli_nosystem32_loop...

I think it'd be a good idea. :) I don't really know how to use it as a dev though (my programs are typically closed-source)...I've only ever downloaded source with it :-\

EDIT: Loop function re-implemented...and it works the other way around! vrrtepcli 4 -l lets you type 4 english words and get Na'vi for them.
« Last Edit: May 23, 2011, 09:59:18 pm by Swoka Ikran »
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!

 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9891
  • nv Eywa'eveng
  • Karma: 243
  • Oeri ran lu srung
    • Tirea Aean
Re: VrrtepCLI: Translator+
« Reply #53 on: May 23, 2011, 10:06:03 pm »
really? when I tried to do that, it repeats the same result x times...

kelku ikranä a hawnventi yom podcast (na'vi-only): https://tirearadio.com/podcast
Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Swoka Ikran

  • Palulukan Makto
  • *****
  • *
  • Posts: 1642
  • Karma: 29
Re: VrrtepCLI: Translator+
« Reply #54 on: May 23, 2011, 10:18:53 pm »
really? when I tried to do that, it repeats the same result x times...
Sran. See below:


And for the record:

Note the bold in the installer output. I also got the new path method Kä'eng suggested working. No more files in system32, and no admin privileges needed to install :D (Now the question is: Does it work on 64-bit OSes?)

Also, I wanted to ask: Would you mind if I put an extra line in the header in the output to credit myself?

Currently it's:
Vrrtep CLI v1.7 by Tirea Aean. run 'vrrtepcli -h' for usage.
Python Version

I was thinking:

Vrrtep CLI v1.7 by Tirea Aean. run 'vrrtepcli -h' for usage.
Windows port by Swoka Ikran
Python Version
« Last Edit: May 23, 2011, 10:27:35 pm by Swoka Ikran »
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!

 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Offline Kemaweyan

  • Eywatsyìp
  • ******
  • *
  • Posts: 14675
  • ua Ukraine
  • Karma: 240
  • Swirä letxon
Re: VrrtepCLI: Translator+
« Reply #55 on: May 23, 2011, 10:22:24 pm »
Oeru txoa livu, oel fmayu tsat trray, set ke tsun :) Oe lu Linuksìyä saryu ulte oer prrte' livu fwa tsari tsivun oe srung sivi ngar ;)
Nìrangal frapo tsirvun pivlltxe nìNa'vi :D

Offline Seze

  • LearnNavi DevOps
  • Toruk Makto
  • Palulukan Makto
  • *****
  • *
  • *
  • Posts: 1563
  • us United States
  • Karma: 53
  • One App to rule them all...
Re: VrrtepCLI: Translator+
« Reply #56 on: May 23, 2011, 10:34:04 pm »
Ahh. of course. I didn't realize you didn't translate that part.

perhaps it might be smart to svn? got  a lot of versions floating around. I've been trying my best to keep organized.

SVN is your friend.  Its my source control system of choice ;)


Learn Na'vi Mobile App - Now Available

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9891
  • nv Eywa'eveng
  • Karma: 243
  • Oeri ran lu srung
    • Tirea Aean
Re: VrrtepCLI: Translator+
« Reply #57 on: May 23, 2011, 10:41:45 pm »
Quote from: Swoka Ikran

Also, I wanted to ask: Would you mind if I put an extra line in the header in the output to credit myself?

Currently it's:
Vrrtep CLI v1.7 by Tirea Aean. run 'vrrtepcli -h' for usage.
Python Version

I was thinking:

Vrrtep CLI v1.7 by Tirea Aean. run 'vrrtepcli -h' for usage.
Windows port by Swoka Ikran
Python Version


By all means. I actually was just thinking of a way to do that anyway. I credited you on the site where I host the download and in my version of the ChangeLog already as well.

so do you have a final product for a new release?

Ma Kemaweyan zola'u niprrte'. I am soon about to update the whole set. see Post #1 for download site.
« Last Edit: May 23, 2011, 10:44:33 pm by Tirea Aean »

kelku ikranä a hawnventi yom podcast (na'vi-only): https://tirearadio.com/podcast
Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Swoka Ikran

  • Palulukan Makto
  • *****
  • *
  • Posts: 1642
  • Karma: 29
Re: VrrtepCLI: Translator+
« Reply #58 on: May 23, 2011, 10:53:02 pm »
By all means. I actually was just thinking of a way to do that anyway. I credited you on the site where I host the download and in my version of the ChangeLog already as well.

so do you have a final product for a new release?
Coming up in a few minutes. :)
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!

 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9891
  • nv Eywa'eveng
  • Karma: 243
  • Oeri ran lu srung
    • Tirea Aean
Re: VrrtepCLI: Translator+
« Reply #59 on: May 23, 2011, 10:58:20 pm »
I'm on windows now so I think while I'm here on this partition I will take care of the formatting issues on the windows version so the Readme, license and all are readable and not one,two, or three-liners. I hate that.

kelku ikranä a hawnventi yom podcast (na'vi-only): https://tirearadio.com/podcast
Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

 

Become LearnNavi's friend on Facebook Follow LearnNavi on Twitter! Watch LearnNavi's videos on YouTube

SMF 2.0.15 | SMF © 2017, Simple Machines
Privacy Policy
| XHTML | RSS | WAP2 | Site Rules

LearnNavi is not affiliated with the official Avatar website,
James Cameron, LightStorm Entertainment or The Walt Disney Company.
All trademarks and servicemarks are the properties of their respective owners.
Images in the LearnNavi.org Forums and Gallery may not be used without permission.

LearnNavi Affiliates:
ToS

LearnNavi is the community to learn Na'vi, the Avatar Language
"A place where real friendships are made." -Paul Frommer

AvatarMeet | Learn Na'vi Forum | Learn Na'vi Wiki | Na'viteri

LearnNavi