GithubHelp home page GithubHelp logo

metamorphose / metamorphose2 Goto Github PK

View Code? Open in Web Editor NEW
143.0 18.0 33.0 2.52 MB

Métamorphose Renamer v2

Home Page: http://file-folder-ren.sourceforge.net

Shell 0.06% HTML 6.64% Groff 0.40% NSIS 0.60% Python 91.77% Makefile 0.52% Batchfile 0.01%

metamorphose2's Introduction

Métamorphose 2

Métamorphose is a graphical mass renaming program for files and folders.

These are the command line options:

-h,  --help       Show help screen and exit.
-t,  --timer      Show time taken to complete operations.
-d,  --debug      Show debugging information.
-p=, --path       Specify a directory to load.
-c=, --config     Specify a configuration file to load.
-a=, --auto       Specify automatic mode level to use with configuration file:
                    0 = do not preview items
                    1 = auto preview items
                    2 = auto rename items
                    3 = auto rename items and exit on success
-l=, --language   Override preferred language:
                    en_US
                    fr
                    es
-w=, --wxversion  Specify wxPython Version - use at your own risk!

If no other options are given, you may specify a path to open:

$ metamorphose2 /srv/samba/Windows Likes Spaces

Running from Source

What follows is for developers or those wishing to use the very latest version.

For binary (normal) installs, use the appropriate install file for your system (setup.exe, .deb, etc ...).

Cloning

Cloning the sources from the remote:

git clone https://github.com/metamorphose/metamorphose2.git

Submodules are used, so after cloning don't forget to check them out:

git submodule update --init

Requirements

  • Python 2.6 or 2.7 (not compatible with 3.x)
  • wxPython 2.8 (preferred) or 3.0
  • Python Imaging Library (PIL) 1.1.6 or greater or Pillow 2.3.0 or greater

Running

Create or update the language files:

messages/update_langs.sh

Launch the application:

./metamorphose2

Installing

As root:

make all

Under Linux & freeBSD The makefile should take care of everything for you, it is architecture and distro independant.

Métamorphose will be installed in /usr/share/metamorphose2, you can run it with:

metamorphose2

and access the man page with:

man metamorphose2

If you are using a freedesktop.org compatible window manager (like Gnome or KDE), there should be an entry in Applications -> Accessories.

Removing

Remove the user-specific files here:

  • Windows: C:\Documents and Settings\USERNAME\Application Data\.metamorphose2
  • Linux/BSD: ~/.metamorphose2
  • Mac: /Library/Application Support/.metamorphose2

In Linux & BSD, if you have the sources:

make remove

To remove all user files as well:

make remove remusr=1

Known Issues

Program locks up when 'walking' a large number of files/folders

Not really locked up, but the time it takes to process entries can be long if you are loading many items. During this process the application doesn't refresh, giving the appearance of being locked up but is actually working on stuff.

The time in this state is dependent on your computer, whether the directory is on a local drive or a network share, and of course the number of items.

This will be addressed in a future release.

Unreadable picker items under Linux (possibly other GTK)

There seems to be a bug in wxGTK, the list can become slow and unreadable when dealing with large number of items (over 10 000).

A work around may be possible.

Thumbnails fail

There seems to be some problems with python-imaging under windows. Sometimes the image will not load.

metamorphose2's People

Contributors

ianare avatar javierpra avatar ramkromberg avatar shadowkyogre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metamorphose2's Issues

Ubuntu 20.04

What are the chances of installing on Focal Fossa?

I've been running it on 18.04 for some time and it's great!

FreeBSD No Translation File

Translation file is not being found on FBSD even after running messages/update_langs.sh. The locale is set. This does not affect Linux.

replace text issue

I am using version 0.9.0 of Metamorphose 2 on Ubuntu 18.04.2. I am attempting to rename the cover art jpg file for a series of albums. I am using the replace function, what to replace "cover" and replace with "folder". This appears to be causing some sort of glitch as the preview gives a warning for all matches showing original name of "cover.jpg" and new name of ".jpg", basically removing the file name. If I use some other text in place of "folder", like "somename", it works just fine.

PIL not found, but python2-pillow is installed

Running latest git snapshot on arch linux x64. As far as I know, PIL was replaced by pillow (and there is no PIL package in the repos or the AUR anymore), so I have installed python2-pillow from the official repositories:

community/python2-pillow 2.7.0-2 [installed]
    Python Imaging Library (PIL) fork. Python2 version.

Yet I'm still getting a PIL not found error message at startup. What could be wrong here?

Cannot launch rename operation from terminal only

From what I understand, Metamorphose is supposed to be able to be run from the CLI interface without ever seeing the GUI, is this correct?

I used the GUI to create myself some config files for later reference over the CLI, but whenever I launch metamorphose with the -c and -p arguments at the same time, it crashes.

Example:
metamorphose2 -p=/root/Desktop/Test_Folder -c=/root/Desktop/test_configuration.cfg -a=3

This is the output I get:

Auto mode level set: 3
Traceback (most recent call last):
File "/usr/share/metamorphose2/metamorphose2.py", line 188, in
main(wx_version, cli_options)
File "/usr/share/metamorphose2/metamorphose2.py", line 182, in main
application = BoaApp(0)
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 8628, in init
self._BootstrapApp()
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 8196, in _BootstrapApp
return core.PyApp__BootstrapApp(*args, **kwargs)
File "/usr/share/metamorphose2/metamorphose2.py", line 177, in OnInit
self.main = MainWindow.create(None, cli_options)
File "/usr/share/metamorphose2/MainWindow/init.py", line 45, in create
return MainWindow(parent, options)
File "/usr/share/metamorphose2/MainWindow/init.py", line 600, in init
self.picker.set_path(True)
File "/usr/share/metamorphose2/picker/init.py", line 132, in set_path
self.refresh(True)
File "/usr/share/metamorphose2/picker/init.py", line 369, in refresh
self.select_all()
File "/usr/share/metamorphose2/picker/init.py", line 112, in select_all
self.view.select_all(event)
File "/usr/share/metamorphose2/picker/wxPickerView.py", line 625, in select_all
main.show_preview(event)
File "/usr/share/metamorphose2/MainWindow/init.py", line 620, in show_preview
self.on_preview_button(False)
File "/usr/share/metamorphose2/MainWindow/init.py", line 922, in on_preview_button
self.renamer.preview(event)
File "/usr/share/metamorphose2/renamer/init.py", line 72, in preview
self.__preview.generate_names(event)
File "/usr/share/metamorphose2/renamer/preview.py", line 225, in generate_names
self.run(operations)
File "/usr/share/metamorphose2/renamer/preview.py", line 304, in run
newExt, itemToRename)
File "/usr/share/metamorphose2/operations/insert.py", line 68, in rename_item
parsedText = operations.parse_input(insert.Text.GetValue(), original, self)
File "/usr/share/metamorphose2/operations/opButtons.py", line 185, in parse_input
return self.parser.parse_input(text, file, operation)
File "/usr/share/metamorphose2/operations/opParser.py", line 439, in parse_input
value = self.__date_time(0, file, operation)
File "/usr/share/metamorphose2/operations/opParser.py", line 296, in __date_time
return utils.udate(main, dateTime[op + 1], itemDateTime)
File "/usr/share/metamorphose2/utils.py", line 208, in udate
udate = time.strftime(format.encode(main.encoding), itemDateTime)
LookupError: unknown encoding: None

I have no idea if this is due to something I'm doing wrong, or where exactly a potential bug could be. Any ideas?

For reference, this is the content of my config file, test_configuration.cfg:

<?xml version="1.0" encoding="UTF-8"?>
<configuration application="Métamorphose-2" version="0.8.2 (beta)" datetime="2018-02-04 21:48:29">
	<page id="0" name="pickerPanel">
		<value id="path" type="wxTextCtrl"></value>
		<value id="foldersOn" type="wxCheckBox">1</value>
		<value id="filesOn" type="wxCheckBox">1</value>
		<value id="FilterSel" type="wxComboBox"></value>
		<value id="filterByRE" type="wxCheckBox">0</value>
		<value id="ignoreCase" type="wxCheckBox">1</value>
		<value id="useLocale" type="wxCheckBox">1</value>
		<value id="walkIt" type="wxCheckBox">0</value>
		<value id="walkDepth" type="wxSpinCtrl">0</value>
		<value id="notType" type="wxCheckBox">0</value>
	</page>
	<page id="2" name="sortingPanel">
		<value id="ascending" type="wxRadioButton">1</value>
		<value id="descending" type="wxRadioButton">0</value>
		<value id="manually" type="wxRadioButton">0</value>
		<value id="dirsPlace" type="wxChoice">0</value>
		<value id="normalSort" type="wxRadioButton">1</value>
		<value id="intelySort" type="wxRadioButton">0</value>
		<value id="byPosition" type="wxRadioButton">0</value>
		<value id="PosStart" type="wxSpinCtrl">0</value>
		<value id="PosLength" type="wxSpinCtrl">1</value>
		<value id="statSortChoice" type="wxChoice">0</value>
		<value id="statSort" type="wxRadioButton">0</value>
	</page>
	<page id="3" name="errorPanel">
		<value id="removeWarnings" type="wxCheckBox">1</value>
		<value id="removeErrors" type="wxCheckBox">1</value>
	</page>
	<page id="1" name="mainPanel">
	</page>
</configuration>

Overall I love Metamorphose and would love to see it grow, it's exactly the kind of program I needed, so major kudos for making it. Please help us help make this thing even better :)

Configuration "parse" faulty...

Metamorphose 2:
Bug noticed since following versions, up to actual versions.
2.0.8.2 (Windows)
2.0.7.1 (Linux - Fedora 14)

Procedure:
Created profile using "move text" + other entries. Profile works fine during active session.
Saved profile configuration.
Reloaded same profile config.

  • Config does not work properly. Under "move text" tab, check box "Eval. as reg. expr." is checked, but it does not work as should (option remains grayed out).

Checking the check box out, and then again back on, recovers normal functionality.

Re-saving config does not help solving wrong behavior.

I could not find any error in the config-file it-self.
Probably configuration does not get "parsed" properly...

Please get config-file under following link:
https://github.com/careca1970/misc_pub/blob/master/jellyfish_rename.cfg

Cursor is always the "Working" one

Version 0.8.2 OS: Linux Mint 16, XFCE desktop.

Mouse cursor always displays as the "working" cursor when mouse pointer is anywhere over the main window.

No translation file found

In FreeBSD10 receiving the following error.

File /usr/local/lib/python2.7/gettext.py line 469, in translation
raise IOError(ENOENT, 'No Translation file found for domain', domain)
IOError: [Error 2] No Translation file found for domain: u'metamorphose2'

LookupError: unknown encoding: None

In Ubuntu 16.04 the latest code crashes with error when loading config file pointing to directory containing some files to rename

Traceback (most recent call last):
File "/usr/share/metamorphose2/MainWindow/init.py", line 687, in load_config
configs.load(self)
File "/usr/share/metamorphose2/configs.py", line 66, in load
LoadConfig(main, dlg.GetPath())
File "/usr/share/metamorphose2/configs.py", line 192, in init
self.__load_file(configFilePath)
File "/usr/share/metamorphose2/configs.py", line 365, in __load_file
main.picker.view.reset_dirpicker_on_config_load()
File "/usr/share/metamorphose2/picker/wxPickerView.py", line 560, in reset_dirpicker_on_config_load
self._refresh_items(True)
File "/usr/share/metamorphose2/picker/wxPickerView.py", line 508, in _refresh_items
self.Core.refresh(True)
File "/usr/share/metamorphose2/picker/init.py", line 369, in refresh
self.select_all()
File "/usr/share/metamorphose2/picker/init.py", line 112, in select_all
self.view.select_all(event)
File "/usr/share/metamorphose2/picker/wxPickerView.py", line 625, in select_all
main.show_preview(event)
File "/usr/share/metamorphose2/MainWindow/init.py", line 620, in show_preview
self.on_preview_button(False)
File "/usr/share/metamorphose2/MainWindow/init.py", line 922, in on_preview_button
self.renamer.preview(event)
File "/usr/share/metamorphose2/renamer/init.py", line 72, in preview
self.__preview.generate_names(event)
File "/usr/share/metamorphose2/renamer/preview.py", line 225, in generate_names
self.run(operations)
File "/usr/share/metamorphose2/renamer/preview.py", line 304, in run
newExt, itemToRename)
File "/usr/share/metamorphose2/operations/replace.py", line 91, in rename_item
newName = operations.parse_input(text, original, self)
File "/usr/share/metamorphose2/operations/opButtons.py", line 185, in parse_input
return self.parser.parse_input(text, file, operation)
File "/usr/share/metamorphose2/operations/opParser.py", line 439, in parse_input
value = self.__date_time(0, file, operation)
File "/usr/share/metamorphose2/operations/opParser.py", line 296, in __date_time
return utils.udate(main, dateTime[op + 1], itemDateTime)
File "/usr/share/metamorphose2/utils.py", line 208, in udate
udate = time.strftime(format.encode(main.encoding), itemDateTime)
LookupError: unknown encoding: None

OPTION Only preview items that will change checked - removes items from column 'new' not from column 'original', leading to incorrect renaming!

Version 0.8.2 beta
Linux Mint 17

if the option is not selected, the renaming in the list is correct.
screenshot from 2015-06-14 right
(NOTE that the changed items are not highlighted and they should)

if the option is selected, both columns get desynchronized. WARNING: The renaming task is performed INCORRECTLY!
screenshot from 2015-06-14 wrong

I hope this information is useful.
I feel that this bug is quite dangerous as it messes up all the names.
Best regards.

Ubuntu Mate 18.04

$ metamorphose2
Traceback (most recent call last):
File "/usr/share/metamorphose2/metamorphose2.py", line 188, in
main(wx_version, cli_options)
File "/usr/share/metamorphose2/metamorphose2.py", line 173, in main
import MainWindow
File "/usr/share/metamorphose2/MainWindow/init.py", line 38, in
import sorting
File "/usr/share/metamorphose2/sorting/init.py", line 25, in
from exif import EXIF
ImportError: No module named exif

New version available for Python 3 and wxPython 4.1

I realise this project has been dormant for some time but I have been a long time user of metamorphose2, and many thanks to ianare for developing it and looking after it while he had the time.

When I switched to Debian Bullseye a year ago, I made the changes needed to run it with Python3.9 and wxPython 4.1 and I have finally found my way round github to share the outcome.

You can find this version on a fork/branch here.

The are a lot of changes related to the new Python/wxPython, but it doesn't introduce any new functionality or fix any bugs. I haven't the knowledge to create new deb packages, but you can find the simple steps I took to get it to run on clean Linux and Windows systems in the issues, and the instructions in the readme have been updated.

Most of my use/testing is on Debian Bullseye using Python 3.9 and wxPython4.1.1, but I expect it will work with any Python 3 and wxPython4. I have run it on Windows 10, as a quick check. Sorry - I don't have access to a Mac. I am not sure how this will co-exist with earlier versions, so setting up for this new version will potentially break the previous one.

I hope this may help those who have used metamorphose2 in the past and found it as useful as I have.

ImportError: cannot import name EXIF

On Freebsd when running metamorphose2.py

Traceback (most recent call last):
File "/usr/share/metamorphose2/metamorphose2.py", line 53, in
import MainWindow
File "/usr/share/metamorphose2/MainWindow/init.py", line 39, in
import sorting
File "/usr/share/metamorphose2/sorting/init.py", line 25, in
from exif import EXIF
ImportError: cannot import name EXIF

$ pkg info|grep exif
py27-exif-0.9_1 Python library to extract EXIF metadata from JPEG and TIFF image files.

$ ls src/exif/
$

Looks like exif did not get pulled with git. Will try again when internet is available. But a different exif module is installed with pkg. Labelled as bug for now pending further testing.

Freeze when getting the file creation date

Metamorphose is a great tool !!!!!
But I block on one bug that makes me unable to use it.
I want the filenames to be the creation date of the file.
When I configure the date so that it catches the file creation date, Metamorphose freezes.
Here is what I get in the terminal:
Traceback (most recent call last):
File "/usr/share/metamorphose2/operations/dateTime.py", line 240, in get_from_item_checkbox
self._test_time(event)
File "/usr/share/metamorphose2/operations/dateTime.py", line 338, in _test_time
main.show_preview(event)
File "/usr/share/metamorphose2/MainWindow/init.py", line 620, in show_preview
self.on_preview_button(False)
File "/usr/share/metamorphose2/MainWindow/init.py", line 922, in on_preview_button
self.renamer.preview(event)
File "/usr/share/metamorphose2/renamer/init.py", line 72, in preview
self.__preview.generate_names(event)
File "/usr/share/metamorphose2/renamer/preview.py", line 225, in generate_names
self.run(operations)
File "/usr/share/metamorphose2/renamer/preview.py", line 304, in run
newExt, itemToRename)
File "/usr/share/metamorphose2/operations/replace.py", line 91, in rename_item
newName = operations.parse_input(text, original, self)
File "/usr/share/metamorphose2/operations/opButtons.py", line 185, in parse_input
return self.parser.parse_input(text, file, operation)
File "/usr/share/metamorphose2/operations/opParser.py", line 439, in parse_input
value = self.__date_time(0, file, operation)
File "/usr/share/metamorphose2/operations/opParser.py", line 296, in __date_time
return utils.udate(main, dateTime[op + 1], itemDateTime)
File "/usr/share/metamorphose2/utils.py", line 208, in udate
udate = time.strftime(format.encode(main.encoding), itemDateTime)
LookupError: unknown encoding: None

New Ubuntu PPA with patched build

tl;dr -- Metamorphose2 PPA for Ubuntu

This is not an issue, rather a log in the record here on what appears to be unmaintained software (especially given various other issues about installing). Finally got around to creating a new PPA with a build that patches #16 (credit to Alin Andrei for publishing a version of the software with some needed patches already applied).

So for all who are trying to get Metamorphose2 working on a Ubuntu-based system, check the PPA for a Xenial build that may well work fine with newer series too (perhaps someone can report on that here, as and when they get to trying the new build on a series newer than Xenial). Soon a forked Github copy of the program, that will have all the patches already applied.

Does not build

Metamorphose2 is not building due to some missing .html files. According to the Makefile it's just a doc file. Commenting out line 108 of the Makefile bypasses the problem. Tested on Mac OS X Yosemite 10.10.3, Python 2.7.6, wxPython 3.0.2 cocoa.

bug using regex

Using replace and regex I get the following errors:

Traceback (most recent call last):
File "MainWindow__init__.pyo", line 711, in show_preview
File "MainWindow__init__.pyo", line 1010, in on_preview_button
File "renamer__init__.pyo", line 72, in preview
File "renamer\preview.pyo", line 230, in generate_names
File "renamer\preview.pyo", line 308, in run
File "operations\move.pyo", line 186, in rename_item
File "operations\regExpr.pyo", line 139, in create_regex
NameError: global name 'app' is not defined

Traceback (most recent call last):
File "MainWindow__init__.pyo", line 711, in show_preview
File "MainWindow__init__.pyo", line 1010, in on_preview_button
File "renamer__init__.pyo", line 72, in preview
File "renamer\preview.pyo", line 230, in generate_names
File "renamer\preview.pyo", line 308, in run
File "operations\replace.pyo", line 100, in rename_item
NameError: global name 'app' is not defined

Looks like a missing "import app"...

Keypresses not detected in saved configurations (Ubuntu Mate 18.04.5 reinstall)

Had to reinstall a machine with UM 18.04.5 from its .iso and, since then, editing rules is largely compromised: when in the Renamer tab, I can click within each box and position the cursor, but keypresses are no longer detected (can't move with arrow keys, can't add or delete characters). Weirder than that, I can define new rules (and - as long as I stay within the new rule - keyboard works as it should; but as soon as I exit the rule, and return after having clicked elsewhere or having added another one, that same new rule cannot be edited anymore).

However, rename operations, as well as deleting existing rules and other mouse-driven actions, work as intended.

Presently on metamorphose2_0.9.0.beta-1sav0_all.deb, installed via Gdebi (obviously, no missing dependencies); fun thing is that until the reinstall (when I already was on UM 18.04.5, but coming from an upgrade path from 18.04.2) functioning was nominal.

Launched the program with -d parameter, no log whatsoever (neither in ~/.metamorphose, nor in /var/log); FWIW, permissions on all .cfg files are standard 644, file ownership is $USER, and iBus/keyboard configurations have no customizations.

Any suggestion on how to overcome this weirdness is greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.