ULX

Author Topic: File Formatting.  (Read 3172 times)

0 Members and 1 Guest are viewing this topic.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
File Formatting.
« on: August 30, 2007, 09:36:00 PM »
okay.. I replied in the usergroup post with this.. but I thought it might be worth making a seperate thread for it so as to not distract the other thread from its intended purpose.


The user.txt and groups.txt files that ULX saves for you in data/ULib give me some really ackward formatting by default.. lets see...

Here is my User.txt file how it should be formatted.. this is also how it IS formatted if I dont try and edit it..

Quote
"saabnl"   

{

   "deny"   

   {

   }

   "type"   "steamid"

   "groups"   

   {

      "admin"

   }

   "id"   "STEAM_0:1:8454402"

   "pass"   ""

   "allow"   

   {

   }

}

"‡????‡ rar"   

{

   "deny"   

   {

   }

   "type"   "steamid"

   "groups"   

   {

      "member"

   }

   "id"   "STEAM_0:1:15207260"

   "pass"   ""

   "allow"   

   {

   }

}



THis is how it gets formatted when I try to save it or edit it.
Quote
"saabnl"    {    "deny"       {    }    "type"   "steamid"    "groups"       {       "admin"    }    "id"   "STEAM_0:1:8454402"    "pass"   ""    "allow"       {    } } "‡????‡ rar"    {    "deny"       {    }    "type"   "steamid"    "groups"       {       "member"    }    "id"   "STEAM_0:1:15207260"    "pass"   ""    "allow"       {    } }

I can go through line by line and reformat it every time.. but this takes ages and doesn't even gurentee that it will work. =-\.. any ideas?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: File Formatting.
« Reply #1 on: August 30, 2007, 10:00:50 PM »
What editor are you using?
Experiencing God's grace one day at a time.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: File Formatting.
« Reply #2 on: August 30, 2007, 11:00:23 PM »
just notepad.. however if I copy and paste it into anything else it goes directly into the goofy formatting.. I dont even have to save it. Its like... It has some weird formatting that just doesn't like to be saved. I dunno..  ???


Edit: I will upload a copy of my file so you can have it.. maybe its my computer.. maybe its the file.. maybe you can tell me!! =)

Here.. http://zakap.com/testcrap/users.txt
Right click it and go to Save File as.. or whatever it is for your OS. then once you have the file.. open it with notepad.. it looks fine.. but then SAVE it.. as anything.. even if you don't edit it and click save it will still go to teh new effed up formatting.

Then try and open it up in something else.. nothing seems to work... copy and paste it into wordpad from notepad.. it pasts with the crappy formatting.. Im soooo very confused.. and it takes a lot to confuse me with computers.. lol
« Last Edit: August 30, 2007, 11:06:13 PM by zakap »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: File Formatting.
« Reply #3 on: August 31, 2007, 04:02:34 AM »
Don't use notepad then.
I use ConTEXT with the Lua highlighter module addin.
http://www.context.cx/
Save it. Looks fine/same.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: File Formatting.
« Reply #4 on: August 31, 2007, 09:11:06 AM »
Thankyou!!!

This program works fine with the files and they don't lose their formatting.


Edit.

Whoever it is MUCH more managable... opening up the user.txt file with ConTEXT gives me a format like this..
Quote
"[llk] t3k"

{

   "deny"

   {

   }

   "type"   "steamid"

   "groups"

   {

      "member"

   }

   "id"   "STEAM_0:0:6192354"

   "pass"   ""

   "allow"

   {

   }
}

and for some reason if each line of the file is seperated like that, ULib freaks out and completely reformats the file to something like this...

Quote
"[llk] t3k"
"{"
"deny"
"{"
"}"
"type"   "steamid"
"groups"
"{"
"member"
"}"
"id"   "STEAM_0:0:6192354"
"pass"   ""
"allow"
"{"
"}"
"}"

but even so.. as long as I remove the extra lines of nothing from teh user.txt file before I reupload it, and I set a macro in ConTEXT to do it, ULib doesn't even know it was edited and everything seems to run fine.

Even so though.. I dunno if it's the way you set up ULib to parse the files or what, but it seems like it's a lot harder than it has to be =)

keep up the good work though guys. I like the new version. =)
« Last Edit: August 31, 2007, 09:56:15 AM by zakap »