Coder Social home page Coder Social logo

opc-diag's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

opc-diag's Issues

New release for python 3

Hi,

Python 3 compatibility is in develop branch for some time, can you cut a formal release?

Thank you for your work.

Diff fails when before and after files don't match in content

I have a repaired powerpoint file where the repair apparently consisted in removing a .xml.rel file. When trying to diff the problematic and the repaired file, opc fails with the following exception:

KeyError: "No item with name 'ppt/slideLayouts/_rels/slideLayout2.xml.rels'"

The file exists in the first file, but not in the second

diffs look a bit odd

Any reason for the empty lines between the ---, +++, and @@?

$ ./opc-stub diff /tmp/1 /tmp/2
--- /tmp/1/[Content_Types].xml

+++ /tmp/2/[Content_Types].xml

@@ -1,9 +1,9 @@

 <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
 <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
-  <Default ContentType="application/vnd.openxmlformats-officedocument.presentationml.printerSettings" Extension="bin"/>
-  <Default ContentType="application/vnd.openxmlformats-package.relationships+xml" Extension="rels"/>
-  <Default ContentType="application/xml" Extension="xml"/>
-  <Default ContentType="image/jpeg" Extension="jpeg"/>
+  <Default Extension="bin" ContentType="application/vnd.openxmlformats-officedocument.presentationml.printerSettings"/>
+  <Default Extension="jpeg" ContentType="image/jpeg"/>
+  <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
+  <Default Extension="xml" ContentType="application/xml"/>
   <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
   <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
   <Override PartName="/ppt/presProps.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presProps+xml"/>

--- /tmp/1/ppt/presentation.xml

+++ /tmp/2/ppt/presentation.xml

@@ -10,8 +10,8 @@

     <p:sldMasterId id="2147483648" r:id="rId1"/>
   </p:sldMasterIdLst>
   <p:sldIdLst>
-    <p:sldId id="256" r:id="rId7"/>
-    <p:sldId id="257" r:id="rId8"/>
+    <p:sldId r:id="rId7" id="256"/>
+    <p:sldId r:id="rId8" id="257"/>
   </p:sldIdLst>
   <p:sldSz cx="9144000" cy="6858000" type="screen4x3"/>
   <p:notesSz cx="6858000" cy="9144000"/>

I usually see diffs like the following with no empty lines.

diff --git a/opcdiag/view.py b/opcdiag/view.py
index 871f916..b03bd22 100644
--- a/opcdiag/view.py
+++ b/opcdiag/view.py
@@ -20,9 +20,7 @@ def _write(text):
     """
     Write *text* to stdout
     """
-    if sys.version_info[0] == 2:
-        text = text.encode('utf-8')
-    print(text, end='', file=sys.stdout)
+    sys.stdout.write(text)

When I try to redirect the output of a diff to a file i get this error

Command used:

opc diff file1 file2 > diff.out

Traceback (most recent call last):
  File "/usr/local/bin/opc", line 9, in <module>
    load_entry_point('opc-diag==0.9.7', 'console_scripts', 'opc')()
  File "/Library/Python/2.7/site-packages/opcdiag/cli.py", line 309, in main
    command_controller.execute(argv)
  File "/Library/Python/2.7/site-packages/opcdiag/cli.py", line 58, in execute
    command.execute(args, self._app_controller)
  File "/Library/Python/2.7/site-packages/opcdiag/cli.py", line 153, in execute
    app_controller.diff_pkg(args.pkg_1_path, args.pkg_2_path)
  File "/Library/Python/2.7/site-packages/opcdiag/controller.py", line 63, in diff_pkg
    OpcView.package_diff(content_types_diff, rels_diffs, xml_part_diffs)
  File "/Library/Python/2.7/site-packages/opcdiag/view.py", line 51, in package_diff
    _write(text)
  File "/Library/Python/2.7/site-packages/opcdiag/view.py", line 23, in _write
    print(text, end='', file=sys.stdout)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2039' in position 4219: ordinal not in range(128)

No relationship of type error when opening ppt file.

I am making a program with GUI.

This GUI program comprised some functions which are load a ppt file, drag and drop a picture and paste the picture in the ppt file.

Already, I have completed the program and published to my team members as a form of exe file.

This program is working well in my computer, but not working in other member's PC.

Error type very varies and occurs when loading the ppt, dropping the picture and saving the file.

Until now, I collected two error message.

Each line in error messages are as follows

I cannot find what is the problem.

please someone help me..

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.