Code Monkey home page Code Monkey logo

metadataeditor's People

Contributors

danil09234 avatar

Watchers

 avatar

metadataeditor's Issues

Some word files may be without docProps and this will raise a FileNotFoundError

Word file inner part example:

  • temp_file.docx
    • _rels
      • .rels
    • word
      • _rels
        • document.xml.rels
      • media
        • image1.png
      • theme
        • theme1.xml
      • document.xml
      • fontTable.xml
      • footer1.xml
      • numbering.xml
      • settings.xml
      • styles.xml
    • [Content_Types].xml

Error example:

Traceback (most recent call last):
  File "D:\...\gui.py", line 148, in <module>
    AntismirnovaApp().run()
  File "C:\...\AppData\Roaming\Python\Python310\site-packages\kivy\app.py", line 955, in run
    runTouchApp()
  File "C:\...\AppData\Roaming\Python\Python310\site-packages\kivy\base.py", line 574, in runTouchApp
    EventLoop.mainloop()
  File "C:\...\AppData\Roaming\Python\Python310\site-packages\kivy\base.py", line 341, in mainloop
    self.window.mainloop()
  File "C:\...\AppData\Roaming\Python\Python310\site-packages\kivy\core\window\window_sdl2.py", line 651, in mainloop
    self._dispatch_drop_event(action, args)
  File "C:\...\AppData\Roaming\Python\Python310\site-packages\kivy\core\window\window_sdl2.py", line 780, in _dispatch_drop_event
    self.dispatch('on_drop_file', args[0], x, y)
  File "kivy\_event.pyx", line 727, in kivy._event.EventDispatcher.dispatch
  File "kivy\_event.pyx", line 1307, in kivy._event.EventObservers.dispatch
  File "kivy\_event.pyx", line 1231, in kivy._event.EventObservers._dispatch
  File "D:\...\gui.py", line 137, in _on_file_drop
    self.__initialize_file(pathlib.Path(file_path.decode("utf-8")))
  File "D:\...\gui.py", line 109, in __initialize_file
    if (creator := metadata.creator) is not None:
  File "D:\...\word.py", line 350, in creator
    creator = core.creator
  File "D:\...\word.py", line 135, in creator
    return self.__get_property("creator")
  File "D:\...\word.py", line 121, in __get_property
    domtree = xml.dom.minidom.parse(str(self.xml_file_path.absolute()))
  File "C:\Program Files\Python310\lib\xml\dom\minidom.py", line 1988, in parse
    return expatbuilder.parse(file)
  File "C:\Program Files\Python310\lib\xml\dom\expatbuilder.py", line 910, in parse
    with open(file, 'rb') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\...\\temp_file.docx\\docProps\\core.xml'

Function with error

word.py -> WordCoreXml -> __get_property()

Multiple same tags after adding properties in core.xml

Bug in the WordCoreXml class of word.py file

After changing creator property many times, the core.xml file looks like:

core.xml

...
<dc:title/>
<dc:subject/>
<dc:creator/>
<dc:creator>Beta user</dc:creator>
<dc:creator/>
<dc:creator>Beta user</dc:creator>
<cp:keywords/>
<dc:description/>
<cp:lastModifiedBy/>
...

Add file with user preferences

Store preference in .yaml format

Future preferences.yaml example:

preferences.yaml

# Preferences for command "new"
new:
   creator: admin
   last modified by: admin
   application: Microsoft Office Word
   editing time: 0
   revision: 1

# Preferences for command "privet_smirnovoy"
# Will randomly be selected configured number of creators and modifiers & random application from applications list
privet_smirnovoy:
   applications:
       - Minecraft
       - Calculator
       - Excel
   creators:
       - User 1
       - User 2
       - User 3
   modifiers:
       - User 1
       - User 2
   creators number: 2
   modifiers number: 1

MDTooltip WidgetException

Traceback (most recent call last):
  File "D:\...\gui.py", line 938, in <module>
    AntismirnovaApp().run()
  File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\kivy\app.py", line 955, in run
    runTouchApp()
  File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\kivy\base.py", line 574, in runTouchApp
    EventLoop.mainloop()
  File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\kivy\base.py", line 339, in mainloop
    self.idle()
  File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\kivy\base.py", line 379, in idle
    Clock.tick()
  File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\kivy\clock.py", line 733, in tick
    self.post_idle(ts, self.idle())
  File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\kivy\clock.py", line 776, in post_idle
    self._process_events()
  File "kivy\_clock.pyx", line 620, in kivy._clock.CyClockBase._process_events
  File "kivy\_clock.pyx", line 653, in kivy._clock.CyClockBase._process_events
  File "kivy\_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
  File "kivy\_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
  File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\kivymd\uix\tooltip.py", line 238, in display_tooltip
    Window.add_widget(self._tooltip)
  File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\kivy\core\window\__init__.py", line 1487, in add_widget
    raise WidgetException(
kivy.uix.widget.WidgetException: Cannot add <kivymd.uix.tooltip.MDTooltipViewClass object at 0x00000234D9BBD850> to window, it already has a parent <kivy.core.window.window_sdl2.WindowSDL object at 0x00000234B9303A70>

Process finished with exit code 1

Bug reason is unknown

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.