Skip to content

Cannot launch rename operation from terminal only #22

@xpelican

Description

@xpelican

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions