Author Topic: Linux VP Manager  (Read 1382 times)

0 Members and 1 Guest are viewing this topic.

Offline Kopachris

  • 28
  • send penguins
    • Steam
    • Twitter
Okay, so all it does right now is dump the VP's index to stdout, but I think that's enough for me to call it 0.1 beta, yes?  I want to make sure it at least does that much on other people's computers as well as mine (I'm paranoid, and this is my first programming project I intend to actually release to the public).  It's written in Python (version 2.6), so you'll need to make sure you have that, but it doesn't have any other dependencies yet.  I'll release it as version 1.0 after I add in extraction and creation support and can call it some degree of "complete".  Version 2.0 should bring a libglade or gtkbuilder interface similar to that of VPView.  I'm doing this partly because I can't find a good VP editor for Linux and partly for the experience, so comments and suggestions would be greatly appreciated.

To use it, just download it, extract it, and run it from the command line as such: "./lvpm.py -l -i [FILE]".  If you don't want it to show the offset, size, and modification date, add the "-q" flag to the command.

EDIT: Finished extraction function.  Now version 0.2 beta.  I'll start working on the creation function today.  Readme (also in dload):
Quote
LVPM -- Linux VP Manager v. 0.2 beta
(c) Copyright 2010 Christopher Koch
Licensed under the WTFPL (see LICENSE file)
README



Contents:
-----------
I. What is this rubbish?
II. How do I install it?
III. All right, how do I use it?
    A. Listing files in a VP archive
    B. Extracting files from a VP archive
IV. TO DO list



I. What is this rubbish?
==========================

This is a Python script to work with Volition Package (VP) archives.  Because I couldn't find any good VP managers for Linux, I decided to make my own.  I hope you like it, but you don't have to.  I made it for myself, but you're welcome to use it if you want to.

As of version 0.2 (this version), LVPM can list files in an archive and extract files/folders from an archive.  By default, a lot of information about the files being dealt with and the operations being performed is displayed, but you can remove all this fluff and have it only print error messages by adding the "-q" or "--quiet" option when you run it.

I plan to continue working on it actively, adding the ability to extract files and create archives until version 1.0.  I won't give it version 1.0 until it seems somewhat "complete".


II. How do I install it?
==========================

Installing LVPM is pretty much as easy as downloading it, extracting it, and running it.  You can put it somewhere in your PATH directories if you want, or even remove the ".py" extension.  I might make those default some other time.

Since I'm packaging this in a 7-zip archive, you'll need 7-zip (7-zip.org) to unpackage it.  (Duh.)  LVPM also requires Python 2.6, but doesn't require any additional libraries yet.  Version 2 of LVPM should bring a nice GTK+ interface similar to VPView, and so will also bring either a libglade or gtkbuilder dependency.

One more thing: you need to make sure you can run it as a program.  In GNOME, right-click on the script and select "Properties".  Go to the "Permissions" tab and make sure "Allow executing this file as a program" is checked.  Alternatively, open up a terminal, and "chmod a+x" it.


III. All right, how do I use it?
=================================

First of all, open up a terminal and cd to wherever LVPM is.  LVPM is command-line-only for now.  The GUI doesn't come until version 2.  LVPM is run like so: "./lvpm.py -[OPTIONS|ecl] -i [INPUT] -o [OUTPUT]".  INPUT is required, and OUTPUT defaults to "data" when using "extract" (i.e. everything in the VP) and the same as the input folder when using "create" (NOTE: Create function isn't available yet).  When using "extract", OUTPUT is the same as what you want to extract from the VP.  LVPM will extract the file or folder specified to [INPUT]/[OUTPUT].

A. Listing files in a VP archive
----------------------------------
To list the files indexed in a VP archive, you just use the "-l" or "--list" option with an input.  No output is needed.  You can specify one, but it won't do anything.  By default, LVPM will list each file's name, offset, size, and last modification time.  Offset and size are given as integer bytes, and the modification time is given in Unix time.  You can quiet this (and other messages) down to just filenames by adding "-q" or "--quiet" to the options.

When you use the list function, you'll probably want to pipe it to grep to search through the listing, as the number of files in a VP archive is likely to overflow your terminal.  To do this, you'll want to do "./lvpm.py -l -i foo.vp | grep -a bar".  The "-a" option in grep is needed to prevent grep from simply returning "binary file matches" instead of actual results.

This list function is essentially a raw dump of an entire VP index, with no formatting other than to remove superfluous null characters from the filenames.

B. Extracting files from a VP archive
---------------------------------------
To extract a file from a VP archive, you just use the "-e" or "--extract" option with an input and an output.  Not specifying an output will cause LVPM to simply extract everything from the archive.  When you extract a file, LVPM will make the proper directories to keep the hierarchy intact.  For instance, if you were to do "./lvpm.py -e -i MV_Core.vp -o data/tables", LVPM would recursively create the folders ./MV_Core/data/tables and extract everything under data/tables thusly.

LVPM can currently extract either individual files or entire folders (including any and all subfolders).  The ability to extract a list of files is on my to-do list.

IV. TO DO:
============
* Extract a list of files
* Add function to create VP archives
* Clean up output
* Clean up and optimize code
* Get and add feature suggestions
* Add a GTK+ interface (much later)

[attachment deleted by admin]
« Last Edit: March 17, 2010, 07:35:49 am by Kopachris »
----
My Bandcamp | Discord: Kopachris | My GitHub

 

Offline Kopachris

  • 28
  • send penguins
    • Steam
    • Twitter
Finished extraction function.  Edited main post.
----
My Bandcamp | Discord: Kopachris | My GitHub

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
could there be some way to integrate this into some of the common file managers, like nautilus?
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Kopachris

  • 28
  • send penguins
    • Steam
    • Twitter
could there be some way to integrate this into some of the common file managers, like nautilus?
I was actually thinking about that.  I'm still looking for some documentation on how to integrate stuff like this with File Roller (GNOME's "Archive Manager").  That would make things immensely simpler, but I'll go with the VPView-like interface if I can't figure something out with File Roller.

EDIT:  Looked at File Roller's source.  The commands to use for different archive types are compiled into it.  A simple Nautilus extension to add an "Extract here" option shouldn't be too hard, I guess.  Once it gets to that point, I'll likely be distributing this as a .deb file (source will still be available for other distros).
« Last Edit: March 18, 2010, 08:14:55 am by Kopachris »
----
My Bandcamp | Discord: Kopachris | My GitHub